Author: janderwald
Date: Fri Feb 2 02:05:32 2007
New Revision: 25676
URL:
http://svn.reactos.org/svn/reactos?rev=25676&view=rev
Log:
- ULONG is always >= 0
- Include limits.h to use ULONG_MAX instead of doing a cast
Modified:
trunk/reactos/drivers/base/beep/beep.c
Modified: trunk/reactos/drivers/base/beep/beep.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/beep/beep.c?r…
==============================================================================
--- trunk/reactos/drivers/base/beep/beep.c (original)
+++ trunk/reactos/drivers/base/beep/beep.c Fri Feb 2 02:05:32 2007
@@ -14,6 +14,7 @@
#include <ntddk.h>
#include <ntddbeep.h>
+#include <limits.h>
#define NDEBUG
#include <debug.h>
@@ -183,7 +184,7 @@
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 @@
FALSE,
NULL);
}
- else if (BeepParam->Duration == (ULONG)-1)
+ else if (BeepParam->Duration == ULONG_MAX)
{
if (DeviceExtension->BeepOn == TRUE)
{