From fa80b0458a63285a5d9f9841e07f5415c0ff2345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Strohh=C3=A4cker?= Date: Tue, 1 Dec 2009 11:08:34 +0000 Subject: [PATCH] fix some warnings about float precision Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3508 --- src/hardware/cmos.cpp | 3 ++- src/hardware/opl.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hardware/cmos.cpp b/src/hardware/cmos.cpp index 26a0e79f..35f3df88 100644 --- a/src/hardware/cmos.cpp +++ b/src/hardware/cmos.cpp @@ -68,7 +68,8 @@ static void cmos_checktimer(void) { LOG(LOG_PIT,LOG_NORMAL)("RTC Timer at %.2f hz",1000.0/cmos.timer.delay); // PIC_AddEvent(cmos_timerevent,cmos.timer.delay); /* A rtc is always running */ - PIC_AddEvent(cmos_timerevent,(double)cmos.timer.delay-fmod(PIC_FullIndex(),(double)cmos.timer.delay)); //Should be more like a real pc. Check + double remd=fmod(PIC_FullIndex(),(double)cmos.timer.delay); + PIC_AddEvent(cmos_timerevent,(float)((double)cmos.timer.delay-remd)); //Should be more like a real pc. Check // status reg A reading with this (and with other delays actually) } diff --git a/src/hardware/opl.cpp b/src/hardware/opl.cpp index b179a037..d09a79b6 100644 --- a/src/hardware/opl.cpp +++ b/src/hardware/opl.cpp @@ -62,7 +62,7 @@ static const fltype frqmul_tab[16] = { 0.5,1,2,3,4,5,6,7,8,9,10,10,12,12,15,15 }; // calculated frequency multiplication values (depend on sampling rate) -static float frqmul[16]; +static fltype frqmul[16]; // key scale levels static Bit8u kslev[8][16];