From e3654c22459c0dd1c1cdf4aa0cda64c60f2a8299 Mon Sep 17 00:00:00 2001 From: Petri Lehtinen Date: Sun, 5 Sep 2010 17:21:36 +0300 Subject: [PATCH] Don't use designated struct initializers It's a C99 feature and not available on all compilers (Visual C++, for example). --- src/load.c | 5 +---- src/value.c | 15 +++------------ 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/load.c b/src/load.c index 17ebcb7..925a850 100644 --- a/src/load.c +++ b/src/load.c @@ -817,10 +817,7 @@ json_t *json_loads(const char *string, size_t flags, json_error_t *error) json_t *result; (void)flags; /* unused */ - string_data_t stream_data = { - .data = string, - .pos = 0 - }; + string_data_t stream_data = {string, 0}; if(lex_init(&lex, string_get, string_eof, (void *)&stream_data)) return NULL; diff --git a/src/value.c b/src/value.c index 3576b81..75236b4 100644 --- a/src/value.c +++ b/src/value.c @@ -835,30 +835,21 @@ double json_number_value(const json_t *json) json_t *json_true(void) { - static json_t the_true = { - .type = JSON_TRUE, - .refcount = (size_t)-1 - }; + static json_t the_true = {JSON_TRUE, (size_t)-1}; return &the_true; } json_t *json_false(void) { - static json_t the_false = { - .type = JSON_FALSE, - .refcount = (size_t)-1 - }; + static json_t the_false = {JSON_FALSE, (size_t)-1}; return &the_false; } json_t *json_null(void) { - static json_t the_null = { - .type = JSON_NULL, - .refcount = (size_t)-1 - }; + static json_t the_null = {JSON_NULL, (size_t)-1}; return &the_null; } -- 2.1.4