changeset 96:6bf5220fa47e

Urgh .. use memset to silence some bogus GCC warnings about using potentially uninitialized values, while that will not actually be possible. In any case, it is annoying.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 02 Oct 2012 18:52:28 +0300
parents 0430f484641b
children 2884a611042b
files jloadjss.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/jloadjss.c	Tue Oct 02 18:51:16 2012 +0300
+++ b/jloadjss.c	Tue Oct 02 18:52:28 2012 +0300
@@ -294,6 +294,7 @@
     *ppModule = NULL;
 
     // Check the JSSMOD header
+    memset(&jssH, 0, sizeof(jssH));
     JSGETBUF(&jssH, JSSMODHeader);
 
     if (memcmp(jssH.idMagic, "JM", 2) != 0)
@@ -346,6 +347,7 @@
         size_t bufSize;
 
         // Get header and check size
+        memset(&jssP, 0, sizeof(jssP));
         JSGETBUF(&jssP, JSSMODPattern);
         bufSize = jssP.size;
         if (bufLeft < jssP.size)
@@ -419,6 +421,7 @@
         JSSExtInstrument *einst;
         int i;
 
+        memset(&jssE, 0, sizeof(jssE));
         JSGETBUF(&jssE, JSSMODExtInstrument);
 
         if ((einst = jssAllocateExtInstrument()) == NULL)
@@ -453,6 +456,7 @@
         JSSMODInstrument jssI;
         JSSInstrument *inst;
 
+        memset(&jssI, 0, sizeof(jssI));
         JSGETBUF(&jssI, JSSMODInstrument);
 
         if ((inst = jssAllocateInstrument()) == NULL)