Fix indentation

No functional changes.
This commit is contained in:
Petri Lehtinen 2009-10-16 21:20:38 +03:00
parent b67e130fda
commit 86dc1d629b
7 changed files with 19 additions and 18 deletions

View File

@ -263,7 +263,7 @@ char *json_dumps(const json_t *json, unsigned long flags)
return NULL;
if(strbuffer_init(&strbuff))
return NULL;
return NULL;
if(do_dump(json, flags, 0, dump_to_strbuffer, (void *)&strbuff)) {
strbuffer_close(&strbuff);

View File

@ -13,8 +13,8 @@ typedef int (*key_cmp_fn)(const void *key1, const void *key2);
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 {

View File

@ -338,9 +338,10 @@ static void lex_scan_string(lex_t *lex, json_error_t *error)
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 */
@ -505,8 +506,8 @@ static int lex_scan(lex_t *lex, json_error_t *error)
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);
@ -744,7 +745,7 @@ static json_t *parse_value(lex_t *lex, json_error_t *error)
break;
case '{':
json = parse_object(lex, error);
json = parse_object(lex, error);
break;
case '[':

View File

@ -229,7 +229,7 @@ json_t *json_array(void)
{
json_array_t *array = malloc(sizeof(json_array_t));
if(!array)
return NULL;
return NULL;
json_init(&array->json, JSON_ARRAY);
array->entries = 0;
@ -480,7 +480,7 @@ json_t *json_string_nocheck(const char *value)
string = malloc(sizeof(json_string_t));
if(!string)
return NULL;
return NULL;
json_init(&string->json, JSON_STRING);
string->value = strdup(value);
@ -540,7 +540,7 @@ json_t *json_integer(int 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;
@ -577,7 +577,7 @@ json_t *json_real(double 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;

View File

@ -26,8 +26,8 @@ int main(int argc, char *argv[])
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';

View File

@ -94,7 +94,7 @@ static void test_misc(void)
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");
@ -104,7 +104,7 @@ static void test_misc(void)
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");

View File

@ -274,7 +274,7 @@ static void test_misc()
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");