From 63da9a0fc706504110f131de645e48fc82276fb9 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Thu, 1 Feb 2007 23:05:32 +0000 Subject: [PATCH] - ULONG is always >= 0 - Include limits.h to use ULONG_MAX instead of doing a cast svn path=/trunk/; revision=25676 --- reactos/drivers/base/beep/beep.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reactos/drivers/base/beep/beep.c b/reactos/drivers/base/beep/beep.c index dc5872e0464..53062caa56a 100644 --- a/reactos/drivers/base/beep/beep.c +++ b/reactos/drivers/base/beep/beep.c @@ -14,6 +14,7 @@ #include #include +#include #define NDEBUG #include @@ -183,7 +184,7 @@ BeepDeviceControl(PDEVICE_OBJECT DeviceObject, DPRINT("Beep:\n Freq: %lu Hz\n Dur: %lu ms\n", BeepParam->Frequency, BeepParam->Duration); - if (BeepParam->Duration >= 0) + if (BeepParam->Duration > 0) { DueTime.QuadPart = (LONGLONG)BeepParam->Duration * -10000; @@ -199,7 +200,7 @@ BeepDeviceControl(PDEVICE_OBJECT DeviceObject, FALSE, NULL); } - else if (BeepParam->Duration == (ULONG)-1) + else if (BeepParam->Duration == ULONG_MAX) { if (DeviceExtension->BeepOn == TRUE) {