diff options
author | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:03:31 +0100 |
---|---|---|
committer | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:07:33 +0100 |
commit | a7c24ca48995cf2bf436156302f96b91bf135409 (patch) | |
tree | 953835509ff1b778833e78fd7b74b05e05e77c84 /plugins/TopToolBar/src/toolbarwnd.cpp | |
parent | 591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff) |
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/TopToolBar/src/toolbarwnd.cpp')
-rw-r--r-- | plugins/TopToolBar/src/toolbarwnd.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/plugins/TopToolBar/src/toolbarwnd.cpp b/plugins/TopToolBar/src/toolbarwnd.cpp index 2a73eb86ad..40bc4cf571 100644 --- a/plugins/TopToolBar/src/toolbarwnd.cpp +++ b/plugins/TopToolBar/src/toolbarwnd.cpp @@ -12,7 +12,7 @@ static wchar_t pluginname[] = L"TopToolBar"; static void PaintToolbar(HWND hwnd)
{
- InvalidateRect(hwnd, 0, FALSE);
+ InvalidateRect(hwnd, nullptr, FALSE);
PAINTSTRUCT paintst;
HDC hdc = BeginPaint(hwnd, &paintst);
@@ -24,7 +24,7 @@ static void PaintToolbar(HWND hwnd) int yScroll = 0;
HDC hdcMem = CreateCompatibleDC(hdc);
- HBITMAP hBmpOsb = CreateBitmap(clRect.right, clRect.bottom, 1, GetDeviceCaps(hdc, BITSPIXEL), NULL);
+ HBITMAP hBmpOsb = CreateBitmap(clRect.right, clRect.bottom, 1, GetDeviceCaps(hdc, BITSPIXEL), nullptr);
HBITMAP hOldBmp = (HBITMAP)SelectObject(hdcMem, hBmpOsb);
SetBkMode(hdcMem, TRANSPARENT);
@@ -122,7 +122,7 @@ LRESULT CALLBACK TopToolBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara return FALSE;
case WM_DESTROY:
- g_ctrl->hWnd = NULL;
+ g_ctrl->hWnd = nullptr;
break;
case WM_MOVE:
@@ -178,7 +178,7 @@ LRESULT CALLBACK TopToolBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara if (id != 0) {
mir_cslock lck(csButtonsHook);
TopButtonInt* b = idtopos(id);
- if (b == NULL || b->isSep())
+ if (b == nullptr || b->isSep())
return 0;
if (b->dwFlags & TTBBF_ASPUSHBUTTON)
@@ -186,11 +186,11 @@ LRESULT CALLBACK TopToolBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara if (b->bPushed) { //Dn -> Up
if (!(b->dwFlags & TTBBF_ISLBUTTON)) // must be always true
- if (b->pszService != NULL)
+ if (b->pszService != nullptr)
CallService(b->pszService, b->wParamUp, b->lParamUp);
}
else { //Up -> Dn
- if (b->pszService != NULL)
+ if (b->pszService != nullptr)
CallService(b->pszService, b->wParamDown, b->lParamDown);
}
@@ -241,14 +241,14 @@ LRESULT CALLBACK TopToolBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara void CALLBACK OnEventFire()
{
HWND parent = pcli->hwndContactList;
- if (parent == NULL) // no clist, no buttons
+ if (parent == nullptr) // no clist, no buttons
return;
WNDCLASS wndclass = {0};
wndclass.lpfnWndProc = TopToolBarProc;
wndclass.cbWndExtra = sizeof(void *);
wndclass.hInstance = hInst;
- wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wndclass.hCursor = LoadCursor(nullptr, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
wndclass.lpszClassName = pluginname;
RegisterClass(&wndclass);
@@ -256,7 +256,7 @@ void CALLBACK OnEventFire() g_ctrl->pButtonList = (SortedList *)&Buttons;
g_ctrl->hWnd = CreateWindow(pluginname, L"Toolbar",
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
- 0, 0, 0, g_ctrl->nLastHeight, parent, NULL, hInst, NULL);
+ 0, 0, 0, g_ctrl->nLastHeight, parent, nullptr, hInst, nullptr);
SetWindowLongPtr(g_ctrl->hWnd, 0, (LONG_PTR)g_ctrl);
LoadBackgroundOptions();
@@ -268,7 +268,7 @@ void CALLBACK OnEventFire() InitInternalButtons();
// if there's no customized frames, create our own
- if (g_ctrl->hFrame == NULL) {
+ if (g_ctrl->hFrame == nullptr) {
CLISTFrame Frame = { sizeof(Frame) };
Frame.tname = L"Toolbar";
Frame.hWnd = g_ctrl->hWnd;
@@ -290,7 +290,7 @@ int LoadBackgroundOptions() bkColour = db_get_dw(NULL, TTB_OPTDIR, "BkColour", TTBDEFAULT_BKCOLOUR);
if (hBmpBackground) {
DeleteObject(hBmpBackground);
- hBmpBackground = NULL;
+ hBmpBackground = nullptr;
}
if (db_get_b(NULL, TTB_OPTDIR, "UseBitmap", TTBDEFAULT_USEBITMAP)) {
|