]> mj.ucw.cz Git - libucw.git/commitdiff
JSON: Let initializers of our anonymous union be compatible with ancient GCC's
authorMartin Mares <mj@ucw.cz>
Wed, 22 Jul 2015 20:20:35 +0000 (22:20 +0200)
committerMartin Mares <mj@ucw.cz>
Wed, 22 Jul 2015 20:20:35 +0000 (22:20 +0200)
ucw-json/json.h

index 199b65371186f51a503ae3b459b68c6ffc622a76..369598b705f9ab255eaeed90c2c715aa8103559c 100644 (file)
@@ -191,8 +191,8 @@ static inline struct json_node *json_new_null(struct json_context *js UNUSED)
 static inline struct json_node *json_new_bool(struct json_context *js UNUSED, bool value)
 {
   static const struct json_node static_bool[2] = {
-    [0] = { .type = JSON_BOOLEAN, .boolean = 0 },
-    [1] = { .type = JSON_BOOLEAN, .boolean = 1 },
+    [0] = { .type = JSON_BOOLEAN, { .boolean = 0 } },
+    [1] = { .type = JSON_BOOLEAN, { .boolean = 1 } },
   };
   return (struct json_node *) &static_bool[value];
 }