From 0ca0de7698b523effaaf6cc9c608e936fa5aaf86 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 2 Dec 2014 21:55:57 +0000 Subject: useless calls of mir_*strlen in DrawText replaced with -1 git-svn-id: http://svn.miranda-ng.org/main/trunk@11223 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/WebView/src/webview.cpp | 6 +++--- plugins/WebView/src/webview.h | 3 ++- plugins/WebView/src/webview_datawnd.cpp | 10 +++++----- plugins/WebView/src/webview_getdata.cpp | 6 +++--- 4 files changed, 13 insertions(+), 12 deletions(-) (limited to 'plugins/WebView') diff --git a/plugins/WebView/src/webview.cpp b/plugins/WebView/src/webview.cpp index 6efe057862..560b577c2d 100644 --- a/plugins/WebView/src/webview.cpp +++ b/plugins/WebView/src/webview.cpp @@ -29,9 +29,9 @@ MSG messages; DWORD winheight; int StartUpDelay = 0; -DWORD Xposition, Yposition; -DWORD BackgoundClr, TextClr; -DWORD WindowHeight, WindowWidth; +int Xposition, Yposition; +int WindowHeight, WindowWidth; +COLORREF BackgoundClr, TextClr; UINT_PTR timerId; UINT_PTR Countdown; diff --git a/plugins/WebView/src/webview.h b/plugins/WebView/src/webview.h index 3aab03a26b..eea8f08c03 100644 --- a/plugins/WebView/src/webview.h +++ b/plugins/WebView/src/webview.h @@ -135,7 +135,8 @@ void ReadFromFile(void *hContact); * some globals for window settings */ -extern DWORD Xposition, Yposition, BackgoundClr, TextClr, WindowHeight, WindowWidth; +extern int Xposition, Yposition, WindowHeight, WindowWidth; +extern COLORREF BackgoundClr, TextClr; extern UINT_PTR timerId, Countdown; extern LOGFONT lf; extern HFONT h_font; diff --git a/plugins/WebView/src/webview_datawnd.cpp b/plugins/WebView/src/webview_datawnd.cpp index a552c52554..5af34f604a 100644 --- a/plugins/WebView/src/webview_datawnd.cpp +++ b/plugins/WebView/src/webview_datawnd.cpp @@ -62,10 +62,10 @@ INT_PTR CALLBACK DlgProcFind(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara free(tempbuffer); Filter(buff); - CharUpperBuffA(buff, mir_strlen(buff)); + CharUpperBuffA(buff, (int)strlen(buff)); GetDlgItemTextA(hwndDlg, IDC_FINDWHAT, NewSearchstr, SIZEOF(NewSearchstr)); - CharUpperBuffA(NewSearchstr, mir_strlen(NewSearchstr)); + CharUpperBuffA(NewSearchstr, (int)strlen(NewSearchstr)); OLDstartposition = startposition; @@ -516,15 +516,15 @@ void ValidatePosition(HWND hwndDlg) MONITORINFO monitorInfo; monitorInfo.cbSize = sizeof(MONITORINFO); - if ( GetMonitorInfo(hMonitor, &monitorInfo)) + if (GetMonitorInfo(hMonitor, &monitorInfo)) CopyMemory(&r, &monitorInfo.rcMonitor, sizeof(RECT)); // /window going off right of screen* - if ((Xposition + WindowWidth) >= r.right) + if (Xposition + WindowWidth >= r.right) Xposition = r.right - WindowWidth; // window going off bottom of screen - if ((Yposition + (WindowHeight)) >= r.bottom) + if (Yposition + WindowHeight >= r.bottom) Yposition = r.bottom - WindowHeight; // window going off left of screen diff --git a/plugins/WebView/src/webview_getdata.cpp b/plugins/WebView/src/webview_getdata.cpp index 64bbd6c805..f2683750e1 100644 --- a/plugins/WebView/src/webview_getdata.cpp +++ b/plugins/WebView/src/webview_getdata.cpp @@ -149,7 +149,7 @@ void GetData(void *param) size_t cbLen = mir_strlen(nlhrReply->pData); char *szInfo = (char*)malloc(cbLen + 2); mir_strncpy(szInfo, nlhrReply->pData, cbLen); - downloadsize = mir_strlen(nlhrReply->pData); + downloadsize = (ULONG)mir_strlen(nlhrReply->pData); trunccount = 0; mir_strncpy(truncated2, szInfo, MAXSIZE2); @@ -202,13 +202,13 @@ void GetData(void *param) memset(&pos, 0, sizeof(pos)); // XXX: looks bad. // end string pos = strstr(truncated2, tempstring2); - statposend = pos - truncated2 + strlen(tempstring2); + statposend = pos - truncated2 + (int)strlen(tempstring2); if (statpos > statposend) { memset(&truncated2, ' ', statpos); memset(&pos, 0, sizeof(pos)); // XXX: looks bad. pos = strstr(truncated2, tempstring2); - statposend = pos - truncated2 + strlen(tempstring2); + statposend = pos - truncated2 + (int)strlen(tempstring2); } if (statpos < statposend) { memset(&raw, 0, sizeof(raw)); -- cgit v1.2.3