From 2cae01edea22659421bb5ccafa26cd5e0fbcbad6 Mon Sep 17 00:00:00 2001 From: Stanislav Shwartsman Date: Mon, 17 Apr 2017 20:38:18 +0000 Subject: [PATCH] better way of fixing shift of 1 by 64-bit to avoid integer overflow --- bochs/iodev/hpet.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bochs/iodev/hpet.cc b/bochs/iodev/hpet.cc index b960c861f..76f93816c 100644 --- a/bochs/iodev/hpet.cc +++ b/bochs/iodev/hpet.cc @@ -258,7 +258,7 @@ void bx_hpet_c::update_irq(HPETTimer *timer, bx_bool set) } else { route = timer_int_route(timer); } - mask = (Bit64u)(1 << timer->tn); + mask = (BX_CONST64(1) << timer->tn); if (!set || !timer_enabled(timer) || !hpet_enabled()) { s.isr &= ~mask; if (!timer_fsb_route(timer)) { @@ -464,7 +464,7 @@ void bx_hpet_c::write_aligned(bx_phy_address address, Bit32u value) case HPET_STATUS: val = new_val & s.isr; for (i = 0; i < s.num_timers; i++) { - if (val & (Bit64u)(1 << i)) { + if (val & (BX_CONST64(1) << i)) { update_irq(&s.timer[i], 0); } }