GUAC-1172: Remove use of stdbool.h and bool from guac_json - FreeRDP is not compatible with use of the standard bool.

This commit is contained in:
Michael Jumper 2015-07-05 23:26:40 -07:00
parent 8a36358e94
commit 4d7634da9e
2 changed files with 16 additions and 18 deletions

View File

@ -48,10 +48,10 @@ void guac_common_json_flush(guac_client* client, guac_stream* stream,
}
bool guac_common_json_write(guac_client* client, guac_stream* stream,
int guac_common_json_write(guac_client* client, guac_stream* stream,
guac_common_json_state* json_state, const char* buffer, int length) {
bool blob_written = false;
int blob_written = 0;
/*
* Append to and flush the JSON buffer as necessary to write the given
@ -67,7 +67,7 @@ bool guac_common_json_write(guac_client* client, guac_stream* stream,
/* Flush if more room is needed */
if (json_state->size + blob_length > sizeof(json_state->buffer)) {
guac_common_json_flush(client, stream, json_state);
blob_written = true;
blob_written = 1;
}
/* Append data to JSON buffer */
@ -86,11 +86,11 @@ bool guac_common_json_write(guac_client* client, guac_stream* stream,
}
bool guac_common_json_write_string(guac_client* client,
int guac_common_json_write_string(guac_client* client,
guac_stream* stream, guac_common_json_state* json_state,
const char* str) {
bool blob_written = false;
int blob_written = 0;
/* Write starting quote */
blob_written |= guac_common_json_write(client, stream,
@ -132,11 +132,11 @@ bool guac_common_json_write_string(guac_client* client,
}
bool guac_common_json_write_property(guac_client* client, guac_stream* stream,
int guac_common_json_write_property(guac_client* client, guac_stream* stream,
guac_common_json_state* json_state, const char* name,
const char* value) {
bool blob_written = false;
int blob_written = 0;
/* Write leading comma if not first property */
if (json_state->properties_written != 0)
@ -173,7 +173,7 @@ void guac_common_json_begin_object(guac_client* client, guac_stream* stream,
}
bool guac_common_json_end_object(guac_client* client, guac_stream* stream,
int guac_common_json_end_object(guac_client* client, guac_stream* stream,
guac_common_json_state* json_state) {
/* Write final brace of JSON object */

View File

@ -25,8 +25,6 @@
#include "config.h"
#include <stdbool.h>
#include <guacamole/client.h>
#include <guacamole/stream.h>
@ -97,9 +95,9 @@ void guac_common_json_flush(guac_client* client, guac_stream* stream,
* The number of bytes in the buffer.
*
* @return
* true if at least one blob was written, false otherwise.
* Non-zero if at least one blob was written, zero otherwise.
*/
bool guac_common_json_write(guac_client* client, guac_stream* stream,
int guac_common_json_write(guac_client* client, guac_stream* stream,
guac_common_json_state* json_state, const char* buffer, int length);
/**
@ -123,9 +121,9 @@ bool guac_common_json_write(guac_client* client, guac_stream* stream,
* The string to write.
*
* @return
* true if at least one blob was written, false otherwise.
* Non-zero if at least one blob was written, zero otherwise.
*/
bool guac_common_json_write_string(guac_client* client,
int guac_common_json_write_string(guac_client* client,
guac_stream* stream, guac_common_json_state* json_state,
const char* str);
@ -152,9 +150,9 @@ bool guac_common_json_write_string(guac_client* client,
* The value of the property to write.
*
* @return
* true if at least one blob was written, false otherwise.
* Non-zero if at least one blob was written, zero otherwise.
*/
bool guac_common_json_write_property(guac_client* client, guac_stream* stream,
int guac_common_json_write_property(guac_client* client, guac_stream* stream,
guac_common_json_state* json_state, const char* name,
const char* value);
@ -192,9 +190,9 @@ void guac_common_json_begin_object(guac_client* client, guac_stream* stream,
* The state object whose in-progress JSON object should be terminated.
*
* @return
* true if at least one blob was written, false otherwise.
* Non-zero if at least one blob was written, zero otherwise.
*/
bool guac_common_json_end_object(guac_client* client, guac_stream* stream,
int guac_common_json_end_object(guac_client* client, guac_stream* stream,
guac_common_json_state* json_state);
#endif