From 8759ac2fc072738ac841117de2cda1c7f4fb5c55 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 4 Jun 2019 09:52:39 +0200 Subject: Introduce nullptr Apply Fixits by Qt Creator. Introduce more member initialization. Change-Id: I81c6860188f0e1592c4df2435ff7f91500456741 Reviewed-by: Oliver Wolff --- src/winextras/qwinfunctions.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/winextras/qwinfunctions.cpp') diff --git a/src/winextras/qwinfunctions.cpp b/src/winextras/qwinfunctions.cpp index 82fd25b..e891ad6 100644 --- a/src/winextras/qwinfunctions.cpp +++ b/src/winextras/qwinfunctions.cpp @@ -209,9 +209,9 @@ HRGN QtWin::toHRGN(const QRegion ®ion) { const int size = region.rectCount(); if (size == 0) - return 0; + return nullptr; - HRGN resultRgn = 0; + HRGN resultRgn = nullptr; const auto rects = region.begin(); resultRgn = qt_RectToHRGN(rects[0]); for (int i = 1; i < size; i++) { @@ -231,7 +231,7 @@ HRGN QtWin::toHRGN(const QRegion ®ion) */ QRegion QtWin::fromHRGN(HRGN hrgn) { - DWORD regionDataSize = GetRegionData(hrgn, 0, NULL); + DWORD regionDataSize = GetRegionData(hrgn, 0, nullptr); if (regionDataSize == 0) return QRegion(); @@ -1738,10 +1738,10 @@ void QtWin::enableBlurBehindWindow(QWindow *window, const QRegion ®ion) { Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - DWM_BLURBEHIND dwmbb = {0, 0, 0, 0}; + DWM_BLURBEHIND dwmbb = {0, 0, nullptr, 0}; dwmbb.dwFlags = DWM_BB_ENABLE; dwmbb.fEnable = TRUE; - HRGN rgn = 0; + HRGN rgn = nullptr; if (!region.isNull()) { rgn = toHRGN(region); if (rgn) { @@ -1788,7 +1788,7 @@ void QtWin::enableBlurBehindWindow(QWindow *window) void QtWin::disableBlurBehindWindow(QWindow *window) { Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - DWM_BLURBEHIND dwmbb = {0, 0, 0, 0}; + DWM_BLURBEHIND dwmbb = {0, 0, nullptr, 0}; dwmbb.dwFlags = DWM_BB_ENABLE; DwmEnableBlurBehindWindow(reinterpret_cast(window->winId()), &dwmbb); } @@ -1859,12 +1859,12 @@ void QtWin::setCurrentProcessExplicitAppUserModelID(const QString &id) */ ITaskbarList3 *qt_createITaskbarList3() { - ITaskbarList3 *pTbList = 0; - HRESULT result = CoCreateInstance(CLSID_TaskbarList, 0, CLSCTX_INPROC_SERVER, qIID_ITaskbarList3, reinterpret_cast(&pTbList)); + ITaskbarList3 *pTbList = nullptr; + HRESULT result = CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_INPROC_SERVER, qIID_ITaskbarList3, reinterpret_cast(&pTbList)); if (SUCCEEDED(result)) { if (FAILED(pTbList->HrInit())) { pTbList->Release(); - pTbList = 0; + pTbList = nullptr; } } return pTbList; @@ -1875,12 +1875,12 @@ ITaskbarList3 *qt_createITaskbarList3() */ ITaskbarList2 *qt_createITaskbarList2() { - ITaskbarList3 *pTbList = 0; - HRESULT result = CoCreateInstance(CLSID_TaskbarList, 0, CLSCTX_INPROC_SERVER, qIID_ITaskbarList2, reinterpret_cast(&pTbList)); + ITaskbarList3 *pTbList = nullptr; + HRESULT result = CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_INPROC_SERVER, qIID_ITaskbarList2, reinterpret_cast(&pTbList)); if (SUCCEEDED(result)) { if (FAILED(pTbList->HrInit())) { pTbList->Release(); - pTbList = 0; + pTbList = nullptr; } } return pTbList; -- cgit v1.2.3