projects
/
jansson.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b67e130
)
Fix indentation
author
Petri Lehtinen
<petri@digip.org>
Fri, 16 Oct 2009 18:20:38 +0000
(21:20 +0300)
committer
Petri Lehtinen
<petri@digip.org>
Fri, 16 Oct 2009 18:20:38 +0000
(21:20 +0300)
No functional changes.
src/dump.c
patch
|
blob
|
history
src/hashtable.h
patch
|
blob
|
history
src/load.c
patch
|
blob
|
history
src/value.c
patch
|
blob
|
history
test/loads_dumps.c
patch
|
blob
|
history
test/testprogs/test_array.c
patch
|
blob
|
history
test/testprogs/test_object.c
patch
|
blob
|
history
diff --git
a/src/dump.c
b/src/dump.c
index
57de80c
..
7dbc9f2
100644
(file)
--- a/
src/dump.c
+++ b/
src/dump.c
@@
-263,7
+263,7
@@
char *json_dumps(const json_t *json, unsigned long flags)
return NULL;
if(strbuffer_init(&strbuff))
return NULL;
if(strbuffer_init(&strbuff))
- return NULL;
+
return NULL;
if(do_dump(json, flags, 0, dump_to_strbuffer, (void *)&strbuff)) {
strbuffer_close(&strbuff);
if(do_dump(json, flags, 0, dump_to_strbuffer, (void *)&strbuff)) {
strbuffer_close(&strbuff);
diff --git
a/src/hashtable.h
b/src/hashtable.h
index
d01b7e7
..
81a0af5
100644
(file)
--- a/
src/hashtable.h
+++ b/
src/hashtable.h
@@
-13,8
+13,8
@@
typedef int (*key_cmp_fn)(const void *key1, const void *key2);
typedef void (*free_fn)(void *key);
struct hashtable_list {
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 {
};
struct hashtable_pair {
diff --git
a/src/load.c
b/src/load.c
index
cdffa11
..
f004525
100644
(file)
--- a/
src/load.c
+++ b/
src/load.c
@@
-338,9
+338,10
@@
static void lex_scan_string(lex_t *lex, json_error_t *error)
if(0xDC00 <= value2 && value2 <= 0xDFFF) {
/* valid second surrogate */
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 */
}
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) {
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);
}
c = lex_get(lex, error);
@@
-744,7
+745,7
@@
static json_t *parse_value(lex_t *lex, json_error_t *error)
break;
case '{':
break;
case '{':
- json = parse_object(lex, error);
+
json = parse_object(lex, error);
break;
case '[':
break;
case '[':
diff --git
a/src/value.c
b/src/value.c
index
1982b90
..
6497f85
100644
(file)
--- a/
src/value.c
+++ b/
src/value.c
@@
-229,7
+229,7
@@
json_t *json_array(void)
{
json_array_t *array = malloc(sizeof(json_array_t));
if(!array)
{
json_array_t *array = malloc(sizeof(json_array_t));
if(!array)
- return NULL;
+
return NULL;
json_init(&array->json, JSON_ARRAY);
array->entries = 0;
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)
string = malloc(sizeof(json_string_t));
if(!string)
- return NULL;
+
return NULL;
json_init(&string->json, JSON_STRING);
string->value = strdup(value);
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)
{
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_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)
{
json_real_t *real = malloc(sizeof(json_real_t));
if(!real)
- return NULL;
+
return NULL;
json_init(&real->json, JSON_REAL);
real->value = value;
json_init(&real->json, JSON_REAL);
real->value = value;
diff --git
a/test/loads_dumps.c
b/test/loads_dumps.c
index
d2a7240
..
fefe1ba
100644
(file)
--- a/
test/loads_dumps.c
+++ b/
test/loads_dumps.c
@@
-26,8
+26,8
@@
int main(int argc, char *argv[])
count = fread(buffer, 1, BUFFER_SIZE, stdin);
if(count < 0 || count >= BUFFER_SIZE) {
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';
}
buffer[count] = '\0';
diff --git
a/test/testprogs/test_array.c
b/test/testprogs/test_array.c
index
d077fa8
..
45bfefd
100644
(file)
--- a/
test/testprogs/test_array.c
+++ b/
test/testprogs/test_array.c
@@
-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)
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");
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)
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");
if(!json_array_append_new(array, NULL))
fail("able to append_new NULL value");
diff --git
a/test/testprogs/test_object.c
b/test/testprogs/test_object.c
index
657a9c6
..
57650e8
100644
(file)
--- a/
test/testprogs/test_object.c
+++ b/
test/testprogs/test_object.c
@@
-274,7
+274,7
@@
static void test_misc()
value = json_object_get(object, "foo");
if(!json_is_integer(value) || json_integer_value(value) != 123)
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");
if(!json_object_set_new(object, NULL, json_integer(432)))
fail("able to set_new NULL key");