comparison jloadjss.c @ 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 32250b436bca
children d3a9a3804079
comparison
equal deleted inserted replaced
95:0430f484641b 96:6bf5220fa47e
292 assert(ppModule != NULL); 292 assert(ppModule != NULL);
293 assert(bufStart != NULL); 293 assert(bufStart != NULL);
294 *ppModule = NULL; 294 *ppModule = NULL;
295 295
296 // Check the JSSMOD header 296 // Check the JSSMOD header
297 memset(&jssH, 0, sizeof(jssH));
297 JSGETBUF(&jssH, JSSMODHeader); 298 JSGETBUF(&jssH, JSSMODHeader);
298 299
299 if (memcmp(jssH.idMagic, "JM", 2) != 0) 300 if (memcmp(jssH.idMagic, "JM", 2) != 0)
300 { 301 {
301 JSSERROR(DMERR_INVALID_DATA, DMERR_INVALID_DATA, 302 JSSERROR(DMERR_INVALID_DATA, DMERR_INVALID_DATA,
344 JSSMODPattern jssP; 345 JSSMODPattern jssP;
345 int result = DMERR_INVALID_DATA; 346 int result = DMERR_INVALID_DATA;
346 size_t bufSize; 347 size_t bufSize;
347 348
348 // Get header and check size 349 // Get header and check size
350 memset(&jssP, 0, sizeof(jssP));
349 JSGETBUF(&jssP, JSSMODPattern); 351 JSGETBUF(&jssP, JSSMODPattern);
350 bufSize = jssP.size; 352 bufSize = jssP.size;
351 if (bufLeft < jssP.size) 353 if (bufLeft < jssP.size)
352 { 354 {
353 JSSERROR(DMERR_OUT_OF_DATA, DMERR_OUT_OF_DATA, 355 JSSERROR(DMERR_OUT_OF_DATA, DMERR_OUT_OF_DATA,
417 { 419 {
418 JSSMODExtInstrument jssE; 420 JSSMODExtInstrument jssE;
419 JSSExtInstrument *einst; 421 JSSExtInstrument *einst;
420 int i; 422 int i;
421 423
424 memset(&jssE, 0, sizeof(jssE));
422 JSGETBUF(&jssE, JSSMODExtInstrument); 425 JSGETBUF(&jssE, JSSMODExtInstrument);
423 426
424 if ((einst = jssAllocateExtInstrument()) == NULL) 427 if ((einst = jssAllocateExtInstrument()) == NULL)
425 { 428 {
426 JSSERROR(DMERR_MALLOC, DMERR_MALLOC, 429 JSSERROR(DMERR_MALLOC, DMERR_MALLOC,
451 for (index = 0; index < module->ninstruments; index++) 454 for (index = 0; index < module->ninstruments; index++)
452 { 455 {
453 JSSMODInstrument jssI; 456 JSSMODInstrument jssI;
454 JSSInstrument *inst; 457 JSSInstrument *inst;
455 458
459 memset(&jssI, 0, sizeof(jssI));
456 JSGETBUF(&jssI, JSSMODInstrument); 460 JSGETBUF(&jssI, JSSMODInstrument);
457 461
458 if ((inst = jssAllocateInstrument()) == NULL) 462 if ((inst = jssAllocateInstrument()) == NULL)
459 { 463 {
460 JSSERROR(DMERR_MALLOC, DMERR_MALLOC, 464 JSSERROR(DMERR_MALLOC, DMERR_MALLOC,