comparison tools/fanalyze.c @ 2041:493d79ea50a8

Fix uninitialized value warnings (not possible in practice, but gcc moans anyway.)
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 30 Nov 2018 06:52:32 +0200
parents 3a7ce77c7f2d
children 45d9db50d996
comparison
equal deleted inserted replaced
2040:3a7ce77c7f2d 2041:493d79ea50a8
338 338
339 BOOL dmGetData(const int type, const DMSourceFile *file, const size_t offs, Uint32 *mval) 339 BOOL dmGetData(const int type, const DMSourceFile *file, const size_t offs, Uint32 *mval)
340 { 340 {
341 Uint8 *data = file->data + offs; 341 Uint8 *data = file->data + offs;
342 if (offs + dmGrepTypes[type].bsize >= file->size) 342 if (offs + dmGrepTypes[type].bsize >= file->size)
343 {
344 *mval = 0;
343 return FALSE; 345 return FALSE;
344 346 }
347
345 switch (type) 348 switch (type)
346 { 349 {
347 case DMGV_uint8: 350 case DMGV_uint8:
348 *mval = *((uint8_t *) data); 351 *mval = *((uint8_t *) data);
349 break; 352 break;
363 case DMGV_uint32_be: 366 case DMGV_uint32_be:
364 *mval = DM_BE32_TO_NATIVE(*((Uint32 *) data)); 367 *mval = DM_BE32_TO_NATIVE(*((Uint32 *) data));
365 break; 368 break;
366 369
367 default: 370 default:
371 *mval = 0;
368 return FALSE; 372 return FALSE;
369 } 373 }
370 return TRUE; 374 return TRUE;
371 } 375 }
372 376