- fixed some uninitialized values found with valgrind

This commit is contained in:
Volker Ruppert 2012-02-10 18:08:17 +00:00
parent a304bd5fd7
commit f5ca539534
3 changed files with 4 additions and 0 deletions

View File

@ -1006,6 +1006,7 @@ int redolog_t::make_header(const char* type, Bit64u size)
Bit32u flip=0;
// Set standard header values
memset(&header, 0, sizeof(redolog_header_t));
strcpy((char*)header.standard.magic, STANDARD_HEADER_MAGIC);
strcpy((char*)header.standard.type, REDOLOG_TYPE);
strcpy((char*)header.standard.subtype, type);

View File

@ -213,6 +213,8 @@ bx_sb16_c::bx_sb16_c(void)
memset(&mpu401, 0, sizeof(mpu401));
memset(&dsp, 0, sizeof(dsp));
memset(&opl, 0, sizeof(opl));
currentdma8 = 0;
currentdma16 = 0;
mpu401.timer_handle = BX_NULL_TIMER_HANDLE;
dsp.timer_handle = BX_NULL_TIMER_HANDLE;
opl.timer_handle = BX_NULL_TIMER_HANDLE;

View File

@ -113,6 +113,7 @@ static inline int array_ensure_allocated(array_t* array, int index)
array->pointer = (char*)realloc(array->pointer, new_size);
if (!array->pointer)
return -1;
memset(array->pointer + array->size, 0, new_size - array->size);
array->size = new_size;
array->next = index + 1;
}