diff options
-rw-r--r-- | ping_protocol/icmp.cpp | 2 | ||||
-rw-r--r-- | ping_protocol/icmp.h | 2 | ||||
-rw-r--r-- | ping_protocol/log.h | 2 | ||||
-rw-r--r-- | ping_protocol/menu.cpp | 2 | ||||
-rw-r--r-- | ping_protocol/menu.h | 2 | ||||
-rw-r--r-- | ping_protocol/options.cpp | 20 | ||||
-rw-r--r-- | ping_protocol/options.h | 2 | ||||
-rw-r--r-- | ping_protocol/pinggraph.cpp | 2 | ||||
-rw-r--r-- | ping_protocol/pinglist.cpp | 2 | ||||
-rw-r--r-- | ping_protocol/pingproto.cpp | 5 | ||||
-rw-r--r-- | ping_protocol/pingproto.mdsp | 10 | ||||
-rw-r--r-- | ping_protocol/pingthread.cpp | 4 | ||||
-rw-r--r-- | ping_protocol/pingthread.h | 2 | ||||
-rw-r--r-- | ping_protocol/rawping.cpp | 10 | ||||
-rw-r--r-- | ping_protocol/rawping.h | 2 | ||||
-rw-r--r-- | ping_protocol/utils.cpp | 2 |
16 files changed, 35 insertions, 36 deletions
diff --git a/ping_protocol/icmp.cpp b/ping_protocol/icmp.cpp index a9cd296..fc2ac16 100644 --- a/ping_protocol/icmp.cpp +++ b/ping_protocol/icmp.cpp @@ -80,4 +80,4 @@ bool ICMP::ping(char *host, IP_ECHO_REPLY &reply) { }
return (reply.Status == 0);
-}
\ No newline at end of file +}
diff --git a/ping_protocol/icmp.h b/ping_protocol/icmp.h index 19aca1d..df37540 100644 --- a/ping_protocol/icmp.h +++ b/ping_protocol/icmp.h @@ -63,4 +63,4 @@ public: unsigned int get_timeout() {return timeout;}
};
-#endif //_ICMP_H
\ No newline at end of file +#endif //_ICMP_H
diff --git a/ping_protocol/log.h b/ping_protocol/log.h index d19d5c9..e1a9a24 100644 --- a/ping_protocol/log.h +++ b/ping_protocol/log.h @@ -10,4 +10,4 @@ int GetLogFilename(WPARAM wParam, LPARAM lParam); int SetLogFilename(WPARAM wParam, LPARAM lParam);
int ViewLogData(WPARAM wParam, LPARAM lParam);
-#endif
\ No newline at end of file +#endif
diff --git a/ping_protocol/menu.cpp b/ping_protocol/menu.cpp index b05f849..cb815df 100644 --- a/ping_protocol/menu.cpp +++ b/ping_protocol/menu.cpp @@ -93,4 +93,4 @@ void InitMenus() { hMenuGraph = (HANDLE)CallService( MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&menu );
hEventMenuBuild = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, MenuBuild);
-}
\ No newline at end of file +}
diff --git a/ping_protocol/menu.h b/ping_protocol/menu.h index f302259..3725226 100644 --- a/ping_protocol/menu.h +++ b/ping_protocol/menu.h @@ -7,4 +7,4 @@ void InitMenus();
-#endif
\ No newline at end of file +#endif
diff --git a/ping_protocol/options.cpp b/ping_protocol/options.cpp index 50e1061..101be95 100644 --- a/ping_protocol/options.cpp +++ b/ping_protocol/options.cpp @@ -8,7 +8,7 @@ static BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l {
HWND hw;
OPENFILENAME ofn = {0};
- char *strptr;
+ //char *strptr;
switch ( msg ) {
case WM_INITDIALOG: {
@@ -25,7 +25,7 @@ static BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l CheckDlgButton(hwndDlg, IDC_CHK_USESTATUSMSG, options.use_status_msg);
hw = GetDlgItem(hwndDlg, IDC_TSTATUS);
EnableWindow(hw, options.no_test_status? FALSE : TRUE);
-
+ /*
for(int i = ID_STATUS_OFFLINE; i != ID_STATUS_OUTTOLUNCH; i++) {
strptr = (char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)i, (LPARAM)0);
hw = GetDlgItem(hwndDlg, IDC_RSTATUS);
@@ -45,7 +45,7 @@ static BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l SendMessage(hw, CB_SETCURSEL, (WPARAM)(options.tstatus - ID_STATUS_OFFLINE), 0);
hw = GetDlgItem(hwndDlg, IDC_DSTATUS);
SendMessage(hw, CB_SETCURSEL, (WPARAM)(options.off_status - ID_STATUS_OFFLINE), 0);
-
+ */
SetDlgItemInt(hwndDlg, IDC_RPT, options.retries, FALSE);
SetDlgItemText(hwndDlg, IDC_ED_FILENAME, options.log_filename);
@@ -129,8 +129,8 @@ static BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l break;
case WM_NOTIFY:
- if (((LPNMHDR)lParam)->code == PSN_APPLY ) {
-
+ if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY ) {
+ /*
{
int sel1, sel2, sel3, sel4;
@@ -158,7 +158,7 @@ static BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l if(sel3 != -1)
options.tstatus = ID_STATUS_OFFLINE + sel3;
}
-
+ */
BOOL trans_success;
DWORD new_ping_period = GetDlgItemInt( hwndDlg, IDC_PPM, &trans_success, FALSE);
@@ -227,7 +227,7 @@ BOOL CALLBACK DlgProcDestEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar DBVARIANT dbv;
if(!DBGetContactSetting(0, PROTO, "DefaultPingGroup", &dbv))
selgroup = true;
- int gi = 1, selind = -1, selind_defgroup;
+ int gi = 1, selind = -1, selind_defgroup = -1;
do {
strptr = (char *)CallService(MS_CLIST_GROUPGETNAME2, (WPARAM)gi, 0);
if(strptr) {
@@ -357,7 +357,6 @@ BOOL CALLBACK DlgProcDestEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar // ping destinations list window
static BOOL CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- OPENFILENAME ofn = {0};
HWND hw;
int sel;
@@ -372,7 +371,8 @@ static BOOL CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM hw = GetDlgItem(hwndDlg, IDC_LST_DEST);
for(PINGLIST::iterator i = temp_list.begin(); i != temp_list.end(); i++) {
- int index = SendMessage(hw, LB_INSERTSTRING, (WPARAM)-1, (LPARAM)i->pszLabel);
+ //int index =
+ SendMessage(hw, LB_INSERTSTRING, (WPARAM)-1, (LPARAM)i->pszLabel);
}
}
@@ -544,7 +544,7 @@ static BOOL CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM break;
case WM_NOTIFY:
- if (((LPNMHDR)lParam)->code == PSN_APPLY ) {
+ if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY ) {
CallService(PROTO "/SetAndSavePingList", (WPARAM)&temp_list, 0);
CallService(PROTO "/GetPingList", 0, (LPARAM)&temp_list);
// the following will be affected due to list rebuild event
diff --git a/ping_protocol/options.h b/ping_protocol/options.h index 0360b47..522d1d6 100644 --- a/ping_protocol/options.h +++ b/ping_protocol/options.h @@ -20,4 +20,4 @@ int PingOptInit(WPARAM wParam,LPARAM lParam); void LoadOptions();
void SaveOptions();
-#endif
\ No newline at end of file +#endif
diff --git a/ping_protocol/pinggraph.cpp b/ping_protocol/pinggraph.cpp index f6a9da5..db6a907 100644 --- a/ping_protocol/pinggraph.cpp +++ b/ping_protocol/pinggraph.cpp @@ -40,7 +40,7 @@ LRESULT CALLBACK GraphWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar return TRUE;
case WM_SHOWWINDOW:
if(wParam == TRUE && lParam == 0) {
- WindowData *wd = (WindowData *)GetWindowLong(hwnd, GWL_USERDATA);
+ //WindowData *wd = (WindowData *)GetWindowLong(hwnd, GWL_USERDATA);
KillTimer(hwnd, ID_REPAINT_TIMER);
#ifdef min
diff --git a/ping_protocol/pinglist.cpp b/ping_protocol/pinglist.cpp index 086fb3e..9cebcfc 100644 --- a/ping_protocol/pinglist.cpp +++ b/ping_protocol/pinglist.cpp @@ -115,7 +115,7 @@ void read_ping_address(PINGADDRESS &pa) { }
pa.status = DBGetContactSettingWord(pa.hContact, PROTO, "Status", options.nrstatus);
- pa.port = (int)DBGetContactSettingDword(pa.hContact, PROTO, "Port", -1);
+ pa.port = (int)DBGetContactSettingDword(pa.hContact, PROTO, "Port", (DWORD)-1);
if(!DBGetContactSetting(pa.hContact, PROTO, "Proto", &dbv)) {
strncpy(pa.pszProto, dbv.pszVal, MAX_PINGADDRESS_STRING_LENGTH);
diff --git a/ping_protocol/pingproto.cpp b/ping_protocol/pingproto.cpp index 5982c52..bf925f2 100644 --- a/ping_protocol/pingproto.cpp +++ b/ping_protocol/pingproto.cpp @@ -28,7 +28,7 @@ int GetCaps(WPARAM wParam,LPARAM lParam) //ret = PF2_ONLINE | PF2_INVISIBLE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND
// | PF2_HEAVYDND | PF2_FREECHAT | PF2_OUTTOLUNCH | PF2_ONTHEPHONE; //}
//ret = options.nrstatus | options.off_status | options.rstatus;
- ret = Proto_Status2Flag(options.rstatus);
+ ret = Proto_Status2Flag(options.rstatus) | Proto_Status2Flag(options.nrstatus) | Proto_Status2Flag(options.tstatus);
if(options.off_status != ID_STATUS_OFFLINE)
ret |= Proto_Status2Flag(options.off_status);
}
@@ -40,6 +40,7 @@ int GetCaps(WPARAM wParam,LPARAM lParam) //| PF2_HEAVYDND | PF2_FREECHAT | PF2_OUTTOLUNCH | PF2_ONTHEPHONE; //}
//ret = options.nrstatus | options.off_status | options.rstatus;
//ret = Proto_Status2Flag(options.rstatus) | Proto_Status2Flag(options.off_status);
+ ret = Proto_Status2Flag(options.nrstatus) | Proto_Status2Flag(options.tstatus);
break;
case PFLAGNUM_4:
break;
@@ -139,7 +140,7 @@ int GetStatus(WPARAM wParam,LPARAM lParam) PLUGININFOEX pluginInfo={
sizeof(PLUGININFOEX),
"Ping Protocol",
- PLUGIN_MAKE_VERSION(0, 5, 0, 0),
+ PLUGIN_MAKE_VERSION(0, 5, 0, 1),
"Ping labelled IP addresses or domain names.",
"Scott Ellis",
"mail@scottellis.com.au",
diff --git a/ping_protocol/pingproto.mdsp b/ping_protocol/pingproto.mdsp index 6c9da34..803f8cf 100644 --- a/ping_protocol/pingproto.mdsp +++ b/ping_protocol/pingproto.mdsp @@ -110,9 +110,7 @@ extraResourceOptions= 1=pingproto.rc
[Other]
[History]
-pingproto.rc,8074
-pingproto.h,752
-common.h,2379
-pinglist.cpp,0
-pinglist.h,604
-pingproto.cpp,4039
+options.cpp,19900
+pinggraph.cpp,919
+pinglist.cpp,4263
+rawping.cpp,3666
diff --git a/ping_protocol/pingthread.cpp b/ping_protocol/pingthread.cpp index c9a5fbd..275667b 100644 --- a/ping_protocol/pingthread.cpp +++ b/ping_protocol/pingthread.cpp @@ -74,7 +74,7 @@ DWORD WINAPI sttCheckStatusThreadProc( void *vp) end_t = clock();
- int wait = (options.ping_period - ((end_t - start_t) / (double)CLOCKS_PER_SEC)) * 1000;
+ int wait = (int)((options.ping_period - ((end_t - start_t) / (double)CLOCKS_PER_SEC)) * 1000);
if(wait > 0)
WaitForSingleObjectEx(hWakeEvent, wait, TRUE);
@@ -140,7 +140,7 @@ DWORD WINAPI sttCheckStatusThreadProc( void *vp) i->round_trip_time = pa.round_trip_time;
history_entry.first = i->round_trip_time;
- history_entry.second = time(0);
+ history_entry.second = (DWORD)time(0);
i->history.push_back(history_entry);
// maintain history (-1 represents no response)
while(i->history.size() >= MAX_HISTORY) {
diff --git a/ping_protocol/pingthread.h b/ping_protocol/pingthread.h index c23b2dc..32c0d77 100644 --- a/ping_protocol/pingthread.h +++ b/ping_protocol/pingthread.h @@ -18,4 +18,4 @@ void stop_ping_thread(); int FillList(WPARAM wParam, LPARAM lParam);
-#endif
\ No newline at end of file +#endif
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;
diff --git a/ping_protocol/rawping.h b/ping_protocol/rawping.h index 2201d19..5c93986 100644 --- a/ping_protocol/rawping.h +++ b/ping_protocol/rawping.h @@ -58,4 +58,4 @@ extern USHORT ip_checksum(USHORT* buffer, int size); extern int init_raw_ping();
extern int raw_ping(char *host, int timeout);
extern int cleanup_raw_ping();
-#endif
\ No newline at end of file +#endif
diff --git a/ping_protocol/utils.cpp b/ping_protocol/utils.cpp index 2c35d0d..16bd8b1 100644 --- a/ping_protocol/utils.cpp +++ b/ping_protocol/utils.cpp @@ -288,7 +288,7 @@ void import_ping_address(int index, PINGADDRESS &pa) { strncpy(pa.pszLabel, dbv.pszVal, MAX_PINGADDRESS_STRING_LENGTH);
DBFreeVariant(&dbv);
- pa.port = (int)DBGetContactSettingDword(0, "PingPlug", os4.str().c_str(), -1);
+ pa.port = (int)DBGetContactSettingDword(0, "PingPlug", os4.str().c_str(), (DWORD)-1);
DBGetContactSetting(0, "PingPlug", os5.str().c_str(), &dbv);
strncpy(pa.pszProto, dbv.pszVal, MAX_PINGADDRESS_STRING_LENGTH);
|