Patchwork [10/14] Zero json struct with memset() instea of = {} to keep compiler happy.

login
register
mail settings
Submitter Jes Sorensen
Date Aug. 30, 2010, 3:59 p.m.
Message ID <1283183960-28404-11-git-send-email-Jes.Sorensen@redhat.com>
Download mbox | patch
Permalink /patch/63100/
State New
Headers show

Comments

Jes Sorensen - Aug. 30, 2010, 3:59 p.m.
From: Jes Sorensen <Jes.Sorensen@redhat.com>

This keeps the compiler happy when building with -Wextra while
effectively generating the same code.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
 qjson.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Patch

diff --git a/qjson.c b/qjson.c
index e4ee433..f259547 100644
--- a/qjson.c
+++ b/qjson.c
@@ -36,8 +36,9 @@  static void parse_json(JSONMessageParser *parser, QList *tokens)
 
 QObject *qobject_from_jsonv(const char *string, va_list *ap)
 {
-    JSONParsingState state = {};
+    JSONParsingState state;
 
+    memset(&state, 0, sizeof(state));
     state.ap = ap;
 
     json_message_parser_init(&state.parser, parse_json);