diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2014-12-21 08:17:45 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2014-12-21 08:17:45 +0000 |
commit | b3ded48d866f59df3c9e8634eabe6e62596ad2d5 (patch) | |
tree | a7a9f2cdd1a9846b7445e8ec6babbecee79c8c0b /plugins/Popup/src/popup_thread.cpp | |
parent | b2ba573600e650273800774c7fad23268019a353 (diff) |
Popup: changed warning level to w4
git-svn-id: http://svn.miranda-ng.org/main/trunk@11550 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Popup/src/popup_thread.cpp')
-rw-r--r-- | plugins/Popup/src/popup_thread.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/plugins/Popup/src/popup_thread.cpp b/plugins/Popup/src/popup_thread.cpp index 73c406a9b6..29f45dc3d7 100644 --- a/plugins/Popup/src/popup_thread.cpp +++ b/plugins/Popup/src/popup_thread.cpp @@ -2,9 +2,9 @@ Popup Plus plugin for Miranda IM
Copyright © 2002 Luca Santarelli,
- © 2004-2007 Victor Pavlychko
- © 2010 MPK
- © 2010 Merlin_de
+© 2004-2007 Victor Pavlychko
+© 2010 MPK
+© 2010 Merlin_de
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -36,9 +36,9 @@ static LIST<PopupWnd2> popupList(3); // forwards
enum
-{
+{
// message id's
- UTM_PT_FIRST = WM_USER+1607,
+ UTM_PT_FIRST = WM_USER + 1607,
UTM_STOP_THREAD,
UTM_ADD_WINDOW,
UTM_UPDATE_WINDOW,
@@ -56,30 +56,30 @@ bool UpdatePopupPosition(PopupWnd2 *prev, PopupWnd2 *wnd) int POPUP_SPACING = PopupOptions.spacing;
- POINT pos;
- SIZE prevSize = {0}, curSize = wnd->getSize();
+ POINT pos = { 0 };
+ SIZE prevSize = { 0 };
if (prev)
prevSize = prev->getSize();
// we have only one monitor (cant check it together with 1.if)
RECT rc;
- if ( GetSystemMetrics(SM_CMONITORS) == 1)
+ if (GetSystemMetrics(SM_CMONITORS) == 1)
SystemParametersInfo(SPI_GETWORKAREA, 0, &rc, 0);
else { // Multimonitor stuff (we have more then 1)
HWND hWnd;
if (PopupOptions.Monitor == MN_MIRANDA)
- hWnd = (HWND)CallService(MS_CLUI_GETHWND,0,0);
+ hWnd = (HWND)CallService(MS_CLUI_GETHWND, 0, 0);
else // PopupOptions.Monitor == MN_ACTIVE
hWnd = GetForegroundWindow();
HMONITOR hMonitor = MonitorFromWindow(hWnd, MONITOR_DEFAULTTOPRIMARY);
- MONITORINFOEX mnti;
+ MONITORINFOEX mnti;
mnti.cbSize = sizeof(MONITORINFOEX);
- if ( GetMonitorInfo(hMonitor, &mnti) == TRUE)
+ if (GetMonitorInfo(hMonitor, &mnti) == TRUE)
memcpy(&rc, &(mnti.rcWork), sizeof(RECT));
else
- SystemParametersInfo(SPI_GETWORKAREA,0,&rc,0);
+ SystemParametersInfo(SPI_GETWORKAREA, 0, &rc, 0);
}
rc.left += PopupOptions.gapLeft - POPUP_SPACING;
@@ -134,7 +134,7 @@ void RepositionPopups() {
PopupWnd2 *prev = 0;
if (PopupOptions.ReorderPopups) {
- for (int i=0; i < popupList.getCount(); ++i) {
+ for (int i = 0; i < popupList.getCount(); ++i) {
UpdatePopupPosition(prev, popupList[i]);
prev = popupList[i];
}
@@ -152,7 +152,7 @@ static LRESULT CALLBACK PopupThreadManagerWndProc(HWND hwnd, UINT message, WPARA case UTM_STOP_THREAD:
gTerminating = true;
if (db_get_b(NULL, MODULNAME, "FastExit", 0))
- for (int i=0; i < popupList.getCount(); ++i)
+ for (int i = 0; i < popupList.getCount(); ++i)
PUDeletePopup(popupList[i]->getHwnd());
PostQuitMessage(0);
break;
@@ -160,7 +160,7 @@ static LRESULT CALLBACK PopupThreadManagerWndProc(HWND hwnd, UINT message, WPARA case UTM_ADD_WINDOW:
if (gTerminating)
break;
- UpdatePopupPosition(popupList.getCount() ? popupList[popupList.getCount()-1] : 0, wnd);
+ UpdatePopupPosition(popupList.getCount() ? popupList[popupList.getCount() - 1] : 0, wnd);
popupList.insert(wnd);
++nPopups;
wnd->callMethodAsync(&PopupWnd2::m_show, 0);
@@ -178,15 +178,15 @@ static LRESULT CALLBACK PopupThreadManagerWndProc(HWND hwnd, UINT message, WPARA break;
case UTM_REMOVE_WINDOW:
- {
- for (int i=popupList.getCount()-1; i >= 0; i--)
- if (popupList[i] == wnd)
- popupList.remove(i);
- }
- RepositionPopups();
- --nPopups;
- delete wnd;
- break;
+ {
+ for (int i = popupList.getCount() - 1; i >= 0; i--)
+ if (popupList[i] == wnd)
+ popupList.remove(i);
+ }
+ RepositionPopups();
+ --nPopups;
+ delete wnd;
+ break;
case UTM_LOCK_QUEUE:
++gLockCount;
@@ -202,7 +202,7 @@ static LRESULT CALLBACK PopupThreadManagerWndProc(HWND hwnd, UINT message, WPARA }
// thread func
-static unsigned __stdcall PopupThread(void *arg)
+static unsigned __stdcall PopupThread(void *)
{
// Create manager window
DWORD err;
@@ -218,7 +218,7 @@ static unsigned __stdcall PopupThread(void *arg) wcl.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
wcl.lpszMenuName = NULL;
wcl.lpszClassName = _T("PopupThreadManagerWnd");
- wcl.hIconSm = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
+ wcl.hIconSm = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
g_wndClass.cPopupThreadManagerWnd = RegisterClassEx(&wcl);
err = GetLastError();
if (!g_wndClass.cPopupThreadManagerWnd) {
@@ -228,7 +228,7 @@ static unsigned __stdcall PopupThread(void *arg) }
gHwndManager = CreateWindow(_T("PopupThreadManagerWnd"), NULL, 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, hInst, NULL);
- SetWindowPos(gHwndManager, 0, 0, 0, 0, 0, SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE|SWP_DEFERERASE|SWP_NOSENDCHANGING|SWP_HIDEWINDOW);
+ SetWindowPos(gHwndManager, 0, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_DEFERERASE | SWP_NOSENDCHANGING | SWP_HIDEWINDOW);
MSG msg;
while (GetMessage(&msg, NULL, 0, 0)) {
@@ -260,7 +260,7 @@ void UnloadPopupThread() WaitForSingleObject(hThread, INFINITE);
CloseHandle(hThread);
- for (int i=0; i < popupList.getCount(); ++i)
+ for (int i = 0; i < popupList.getCount(); ++i)
delete popupList[i];
popupList.destroy();
}
|