From 379a5998fad3cd736704cf78be14d25ff4617723 Mon Sep 17 00:00:00 2001 From: sje Date: Wed, 23 May 2007 23:45:25 +0000 Subject: added newlines removed warnings fix for icons and options error git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@185 4f64403b-2f21-0410-a795-97e2b3489a10 --- ping_protocol/rawping.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ping_protocol/rawping.cpp') diff --git a/ping_protocol/rawping.cpp b/ping_protocol/rawping.cpp index 008a2a8..de8fa34 100644 --- a/ping_protocol/rawping.cpp +++ b/ping_protocol/rawping.cpp @@ -27,7 +27,7 @@ USHORT ip_checksum(USHORT* buffer, int size) return (USHORT)(~cksum); } -SOCKET sd = -1; +SOCKET sd = (SOCKET)-1; char packet[1024]; char recv_buff[1024]; USHORT seq_no = 0; @@ -40,7 +40,7 @@ extern int init_raw_ping() { return 1; } - if(sd != -1) + if(sd != (SOCKET)-1) closesocket(sd); // Create the socket @@ -110,7 +110,7 @@ extern int raw_ping(char *host, int timeout) { bool use_hi_res = false; LARGE_INTEGER hr_freq, hr_send_time; - DWORD send_time; + DWORD send_time = 0; if(QueryPerformanceFrequency(&hr_freq)) { use_hi_res = true; QueryPerformanceCounter(&hr_send_time); @@ -128,7 +128,7 @@ extern int raw_ping(char *host, int timeout) { int fromlen = sizeof(source); IPHeader *reply_header = (IPHeader *)recv_buff; ICMPHeader *reply; - DWORD start, current_time; + DWORD start = 0, current_time = 0; LARGE_INTEGER hr_start, hr_current_time, hr_timeout; if(use_hi_res) { hr_timeout.QuadPart = (timeout * hr_freq.QuadPart / 1000); @@ -199,7 +199,7 @@ extern int raw_ping(char *host, int timeout) { extern int cleanup_raw_ping() { if(inited) { closesocket(sd); - sd = -1; + sd = (SOCKET)-1; WSACleanup(); } return 0; -- cgit v1.2.3