From ce05f397dad28eb7779af687b04e9b599612aa64 Mon Sep 17 00:00:00 2001 From: "R. Belmont" Date: Sun, 1 May 2011 17:04:45 +0000 Subject: [PATCH] mc146818: Fix uninitialized variable found by Valgrind [R. Belmont] --- src/emu/machine/mc146818.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/emu/machine/mc146818.c b/src/emu/machine/mc146818.c index 9b8fa827cc9..78282504dc5 100644 --- a/src/emu/machine/mc146818.c +++ b/src/emu/machine/mc146818.c @@ -143,6 +143,9 @@ void mc146818_device::device_start() { m_last_refresh = machine().time(); emu_timer *timer = timer_alloc(); + + memset(m_data, 0, sizeof(m_data)); + if (m_type == MC146818_UTC) { // hack: for apollo we increase the update frequency to stay in sync with real time timer->adjust(attotime::from_hz(2), 0, attotime::from_hz(2)); @@ -363,7 +366,7 @@ void mc146818_device::set_base_datetime() machine().base_datetime(systime); - current_time = m_type == MC146818_UTC ? systime.utc_time: systime.local_time; + current_time = (m_type == MC146818_UTC) ? systime.utc_time: systime.local_time; // temporary hack to go back 20 year (e.g. from 2010 -> 1990) // current_time.year -= 20;