silence MSVC warning
[reactos.git] / reactos / apps / utils / net / ping / ping.c
index da5182d..ffcdadb 100644 (file)
@@ -16,7 +16,9 @@
 #include <stdio.h>
 #ifndef _MSC_VER
 
-//#define DBG
+#ifdef DBG
+#undef DBG
+#endif
 
 /* FIXME: Where should this be? */
 #ifdef CopyMemory
@@ -104,9 +106,9 @@ LARGE_INTEGER       TicksPerMs; /* Ticks per millisecond */
 LARGE_INTEGER       TicksPerUs; /* Ticks per microsecond */
 BOOL                UsePerformanceCounter;
 
-
+#ifdef DBG
 /* Display the contents of a buffer */
-VOID DisplayBuffer(
+static VOID DisplayBuffer(
     PVOID Buffer,
     DWORD Size)
 {
@@ -123,9 +125,10 @@ VOID DisplayBuffer(
       printf("%02X ", (p[i]) & 0xFF);
     }
 }
+#endif /* DBG */
 
 /* Display usage information on screen */
-VOID Usage(VOID)
+static VOID Usage(VOID)
 {
        printf("\nUsage: ping [-t] [-n count] [-l size] [-w timeout] destination-host\n\n");
        printf("Options:\n");
@@ -137,7 +140,7 @@ VOID Usage(VOID)
 }
 
 /* Reset configuration to default values */
-VOID Reset(VOID)
+static VOID Reset(VOID)
 {
     LARGE_INTEGER PerformanceCounterFrequency;
 
@@ -173,13 +176,13 @@ VOID Reset(VOID)
 }
 
 /* Return ULONG in a string */
-ULONG GetULONG(LPSTR String)
+static ULONG GetULONG(LPSTR String)
 {
     UINT i, Length;
     ULONG Value;
 
     i = 0;
-    Length = strlen(String);
+    Length = (UINT)_tcslen(String);
     while ((i < Length) && ((String[i] < '0') || (String[i] > '9'))) i++;
     if ((i >= Length) || ((String[i] < '0') || (String[i] > '9'))) {
         InvalidOption = TRUE;
@@ -191,7 +194,7 @@ ULONG GetULONG(LPSTR String)
 }
 
 /* Return ULONG in a string. Try next paramter if not successful */
-ULONG GetULONG2(LPSTR String1, LPSTR String2, PINT i)
+static ULONG GetULONG2(LPSTR String1, LPSTR String2, PINT i)
 {
     ULONG Value;
 
@@ -209,7 +212,7 @@ ULONG GetULONG2(LPSTR String1, LPSTR String2, PINT i)
 }
 
 /* Parse command line parameters */
-BOOL ParseCmdline(int argc, char* argv[])
+static BOOL ParseCmdline(int argc, char* argv[])
 {
     INT i;
     BOOL ShowUsage;
@@ -278,7 +281,7 @@ BOOL ParseCmdline(int argc, char* argv[])
 }
 
 /* Calculate checksum of data */
-WORD Checksum(PUSHORT data, UINT size)
+static WORD Checksum(PUSHORT data, UINT size)
 {
     ULONG sum = 0;
 
@@ -297,7 +300,7 @@ WORD Checksum(PUSHORT data, UINT size)
 }
 
 /* Prepare to ping target */
-BOOL Setup(VOID)
+static BOOL Setup(VOID)
 {
     WORD     wVersionRequested;
     WSADATA  WsaData;
@@ -354,7 +357,7 @@ BOOL Setup(VOID)
 }
 
 /* Close socket */
-VOID Cleanup(VOID)
+static VOID Cleanup(VOID)
 {
     if (IcmpSock != INVALID_SOCKET)
         closesocket(IcmpSock);
@@ -362,7 +365,7 @@ VOID Cleanup(VOID)
     WSACleanup();
 }
 
-VOID QueryTime(PLARGE_INTEGER Time)
+static VOID QueryTime(PLARGE_INTEGER Time)
 {
     if (UsePerformanceCounter) {
         if (QueryPerformanceCounter(Time) == 0) {
@@ -384,7 +387,7 @@ VOID QueryTime(PLARGE_INTEGER Time)
     }
 }
 
-VOID TimeToMsString(LPSTR String, LARGE_INTEGER Time)
+static VOID TimeToMsString(LPSTR String, LARGE_INTEGER Time)
 {
     CHAR          Convstr[40];
     LARGE_INTEGER LargeTime;
@@ -398,7 +401,7 @@ VOID TimeToMsString(LPSTR String, LARGE_INTEGER Time)
 
 /* Locate the ICMP data and print it. Returns TRUE if the packet was good,
    FALSE if not */
-BOOL DecodeResponse(PCHAR buffer, UINT size, PSOCKADDR_IN from)
+static BOOL DecodeResponse(PCHAR buffer, UINT size, PSOCKADDR_IN from)
 {
     PIPv4_HEADER      IpHeader;
     PICMP_ECHO_PACKET Icmp;
@@ -462,7 +465,7 @@ BOOL DecodeResponse(PCHAR buffer, UINT size, PSOCKADDR_IN from)
 }
 
 /* Send and receive one ping */
-BOOL Ping(VOID)
+static BOOL Ping(VOID)
 {
     INT                 Status;
     SOCKADDR            From;