No functional changes.
return NULL;
if(strbuffer_init(&strbuff))
- return NULL;
+ return NULL;
if(do_dump(json, flags, 0, dump_to_strbuffer, (void *)&strbuff)) {
strbuffer_close(&strbuff);
typedef void (*free_fn)(void *key);
struct hashtable_list {
- struct hashtable_list *prev;
- struct hashtable_list *next;
+ struct hashtable_list *prev;
+ struct hashtable_list *next;
};
struct hashtable_pair {
if(0xDC00 <= value2 && value2 <= 0xDFFF) {
/* valid second surrogate */
- value = ((value - 0xD800) << 10) +
- (value2 - 0xDC00) +
- 0x10000;
+ value =
+ ((value - 0xD800) << 10) +
+ (value2 - 0xDC00) +
+ 0x10000;
}
else {
/* invalid second surrogate */
strbuffer_clear(&lex->saved_text);
if(lex->token == TOKEN_STRING) {
- free(lex->value.string);
- lex->value.string = NULL;
+ free(lex->value.string);
+ lex->value.string = NULL;
}
c = lex_get(lex, error);
break;
case '{':
- json = parse_object(lex, error);
+ json = parse_object(lex, error);
break;
case '[':
{
json_array_t *array = malloc(sizeof(json_array_t));
if(!array)
- return NULL;
+ return NULL;
json_init(&array->json, JSON_ARRAY);
array->entries = 0;
string = malloc(sizeof(json_string_t));
if(!string)
- return NULL;
+ return NULL;
json_init(&string->json, JSON_STRING);
string->value = strdup(value);
{
json_integer_t *integer = malloc(sizeof(json_integer_t));
if(!integer)
- return NULL;
+ return NULL;
json_init(&integer->json, JSON_INTEGER);
integer->value = value;
{
json_real_t *real = malloc(sizeof(json_real_t));
if(!real)
- return NULL;
+ return NULL;
json_init(&real->json, JSON_REAL);
real->value = value;
count = fread(buffer, 1, BUFFER_SIZE, stdin);
if(count < 0 || count >= BUFFER_SIZE) {
- fprintf(stderr, "unable to read input\n");
- return 1;
+ fprintf(stderr, "unable to read input\n");
+ return 1;
}
buffer[count] = '\0';
value = json_array_get(array, 15);
if(!json_is_integer(value) || json_integer_value(value) != 123)
- fail("json_array_set_new works incorrectly");
+ fail("json_array_set_new works incorrectly");
if(!json_array_set_new(array, 15, NULL))
fail("able to set_new NULL value");
value = json_array_get(array, json_array_size(array) - 1);
if(!json_is_integer(value) || json_integer_value(value) != 321)
- fail("json_array_append_new works incorrectly");
+ fail("json_array_append_new works incorrectly");
if(!json_array_append_new(array, NULL))
fail("able to append_new NULL value");
value = json_object_get(object, "foo");
if(!json_is_integer(value) || json_integer_value(value) != 123)
- fail("json_object_set_new works incorrectly");
+ fail("json_object_set_new works incorrectly");
if(!json_object_set_new(object, NULL, json_integer(432)))
fail("able to set_new NULL key");