From bdd1d93c8f06181ad8eb70abf26753fd449b5b40 Mon Sep 17 00:00:00 2001 From: janwas Date: Sat, 25 Aug 2007 16:38:36 +0000 Subject: [PATCH] whrt: made asserts a tad bit more numerically robust, for what it's worth. Erik had reported that the PMT counter indicates a resolution > 2ms; i cannot see a legitimate reason for this happening :S (compiler bug? debugger bug? bad memory?) This was SVN commit r5301. --- source/lib/sysdep/win/wgfx.cpp | 2 +- source/lib/sysdep/win/whrt/whrt.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/lib/sysdep/win/wgfx.cpp b/source/lib/sysdep/win/wgfx.cpp index 67156f706d..6b39f02917 100644 --- a/source/lib/sysdep/win/wgfx.cpp +++ b/source/lib/sysdep/win/wgfx.cpp @@ -97,7 +97,7 @@ static LibError win_get_gfx_drv_ver() // gfx_card which one is correct; we thus avoid driver-specific // name checks and reporting incorrectly. - LibError ret = ERR::FAIL; // single point of exit (for RegCloseKey) + LibError ret = ERR::FAIL; // single point of exit (for RegCloseKey) DWORD i; char drv_name[MAX_PATH+1]; diff --git a/source/lib/sysdep/win/whrt/whrt.cpp b/source/lib/sysdep/win/whrt/whrt.cpp index 5b1239d12e..5fc81131bf 100644 --- a/source/lib/sysdep/win/whrt/whrt.cpp +++ b/source/lib/sysdep/win/whrt/whrt.cpp @@ -100,8 +100,8 @@ static void InitCounter() counterMask = bit_mask64(counterBits); // sanity checks - debug_assert(nominalFrequency >= 500.0); - debug_assert(resolution <= 2e-3); + debug_assert(nominalFrequency >= 500.0-DBL_EPSILON); + debug_assert(resolution <= 2e-3+DBL_EPSILON); debug_assert(8 <= counterBits && counterBits <= 64); }