From b77b5cc5be5d7ca00c6bf6c4b83585cbbf3d91fd Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Thu, 6 Sep 2012 10:54:50 +0200 Subject: Revert "Use true and false in preference to TRUE and FALSE" Even though I really think the change was the right thing to do, it seems like Windows people don't like this change because of some Windows Data Types specific rules. This reverts parts of the commit 56d5c909af6473be64a1ae487b45bd444a9a8553. Change-Id: I2c67d9b1bab36fc63937ef386aef56d2a4472a04 Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwindowsglcontext.cpp | 14 +++++++------- src/plugins/platforms/windows/qwindowskeymapper.cpp | 4 ++-- src/plugins/platforms/windows/qwindowsscreen.cpp | 6 +++--- src/plugins/platforms/windows/qwindowsservices.cpp | 2 +- src/plugins/platforms/windows/qwindowswindow.cpp | 10 +++++----- 5 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp index 576aa920b4..dcc3725708 100644 --- a/src/plugins/platforms/windows/qwindowsglcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp @@ -377,9 +377,9 @@ static int choosePixelFormat(HDC hdc, iAttributes[i++] = testFlag(additional.formatFlags, QWindowsGLDirectRendering) ? WGL_FULL_ACCELERATION_ARB : WGL_NO_ACCELERATION_ARB; iAttributes[i++] = WGL_SUPPORT_OPENGL_ARB; - iAttributes[i++] = true; + iAttributes[i++] = TRUE; iAttributes[i++] = WGL_DRAW_TO_WINDOW_ARB; - iAttributes[i++] = true; + iAttributes[i++] = TRUE; iAttributes[i++] = WGL_COLOR_BITS_ARB; iAttributes[i++] = 24; switch (format.swapBehavior()) { @@ -387,17 +387,17 @@ static int choosePixelFormat(HDC hdc, break; case QSurfaceFormat::SingleBuffer: iAttributes[i++] = WGL_DOUBLE_BUFFER_ARB; - iAttributes[i++] = false; + iAttributes[i++] = FALSE; break; case QSurfaceFormat::DoubleBuffer: case QSurfaceFormat::TripleBuffer: iAttributes[i++] = WGL_DOUBLE_BUFFER_ARB; - iAttributes[i++] = true; + iAttributes[i++] = TRUE; break; } if (format.stereo()) { iAttributes[i++] = WGL_STEREO_ARB; - iAttributes[i++] = true; + iAttributes[i++] = TRUE; } if (format.depthBufferSize() >= 0) { iAttributes[i++] = WGL_DEPTH_BITS_ARB; @@ -435,13 +435,13 @@ static int choosePixelFormat(HDC hdc, int samplesValuePosition = 0; if (sampleBuffersRequested) { iAttributes[i++] = WGL_SAMPLE_BUFFERS_ARB; - iAttributes[i++] = true; + iAttributes[i++] = TRUE; iAttributes[i++] = WGL_SAMPLES_ARB; samplesValuePosition = i; iAttributes[i++] = format.samples(); } else if (samples == 0 || samples == 1 ) { iAttributes[i++] = WGL_SAMPLE_BUFFERS_ARB; - iAttributes[i++] = false; + iAttributes[i++] = FALSE; } // If sample buffer request cannot be satisfied, reduce request. int pixelFormat = 0; diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp index 633773de00..044d31e972 100644 --- a/src/plugins/platforms/windows/qwindowskeymapper.cpp +++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp @@ -697,7 +697,7 @@ static void showSystemMenu(QWindow* w) { QWindow *topLevel = QWindowsWindow::topLevelOf(w); HWND topLevelHwnd = QWindowsWindow::handleOf(topLevel); - HMENU menu = GetSystemMenu(topLevelHwnd, false); + HMENU menu = GetSystemMenu(topLevelHwnd, FALSE); if (!menu) return; // no menu for this window @@ -722,7 +722,7 @@ static void showSystemMenu(QWindow* w) closeItem.cbSize = sizeof(MENUITEMINFO); closeItem.fMask = MIIM_STATE; closeItem.fState = MFS_DEFAULT; - SetMenuItemInfo(menu, SC_CLOSE, false, &closeItem); + SetMenuItemInfo(menu, SC_CLOSE, FALSE, &closeItem); #undef enabled #undef disabled diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp index 16cd4b49dd..d843236695 100644 --- a/src/plugins/platforms/windows/qwindowsscreen.cpp +++ b/src/plugins/platforms/windows/qwindowsscreen.cpp @@ -93,8 +93,8 @@ BOOL QT_WIN_CALLBACK monitorEnumCallback(HMONITOR hMonitor, HDC, LPRECT, LPARAM MONITORINFOEX info; memset(&info, 0, sizeof(MONITORINFOEX)); info.cbSize = sizeof(MONITORINFOEX); - if (GetMonitorInfo(hMonitor, &info) == false) - return true; + if (GetMonitorInfo(hMonitor, &info) == FALSE) + return TRUE; WindowsScreenDataList *result = reinterpret_cast(p); QWindowsScreenData data; @@ -131,7 +131,7 @@ BOOL QT_WIN_CALLBACK monitorEnumCallback(HMONITOR hMonitor, HDC, LPRECT, LPARAM data.flags |= QWindowsScreenData::PrimaryScreen; data.name = QString::fromWCharArray(info.szDevice); result->append(data); - return true; + return TRUE; } static inline WindowsScreenDataList monitorData() diff --git a/src/plugins/platforms/windows/qwindowsservices.cpp b/src/plugins/platforms/windows/qwindowsservices.cpp index f06c7f2655..a2688a1d61 100644 --- a/src/plugins/platforms/windows/qwindowsservices.cpp +++ b/src/plugins/platforms/windows/qwindowsservices.cpp @@ -138,7 +138,7 @@ static inline bool launchMail(const QUrl &url) STARTUPINFO si; ZeroMemory(&si, sizeof(si)); si.cb = sizeof(si); - if (!CreateProcess(NULL, (wchar_t*)command.utf16(), NULL, NULL, false, 0, NULL, NULL, &si, &pi)) { + if (!CreateProcess(NULL, (wchar_t*)command.utf16(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) { qErrnoWarning("Unable to launch '%s'", qPrintable(command)); return false; } diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 7ffd0de58c..b43032dc1a 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -511,7 +511,7 @@ void WindowCreationData::initialize(HWND hwnd, bool frameChange, qreal opacityLe SetWindowPos(hwnd, HWND_BOTTOM, 0, 0, 0, 0, swpFlags); } if (flags & (Qt::CustomizeWindowHint|Qt::WindowTitleHint)) { - HMENU systemMenu = GetSystemMenu(hwnd, false); + HMENU systemMenu = GetSystemMenu(hwnd, FALSE); if (flags & Qt::WindowCloseButtonHint) EnableMenuItem(systemMenu, SC_CLOSE, MF_BYCOMMAND|MF_ENABLED); else @@ -557,7 +557,7 @@ QMargins QWindowsGeometryHint::frame(DWORD style, DWORD exStyle) #ifndef Q_OS_WINCE style &= ~(WS_OVERLAPPED); // Not permitted, see docs. #endif - if (!AdjustWindowRectEx(&rect, style, false, exStyle)) + if (!AdjustWindowRectEx(&rect, style, FALSE, exStyle)) qErrnoWarning("%s: AdjustWindowRectEx failed", __FUNCTION__); const QMargins result(qAbs(rect.left), qAbs(rect.top), qAbs(rect.right), qAbs(rect.bottom)); @@ -869,7 +869,7 @@ void QWindowsWindow::show_sys() const // maximizing the widget, and then remove the maximize button afterwards. if (flags & Qt::WindowTitleHint && !(flags & (Qt::WindowMinMaxButtonsHint | Qt::FramelessWindowHint))) { - fakedMaximize = true; + fakedMaximize = TRUE; setStyle(style() | WS_MAXIMIZEBOX); } } @@ -1107,7 +1107,7 @@ bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message, WPARAM, LPARAM) { // Ignore invalid update bounding rectangles - if (!GetUpdateRect(m_data.hwnd, 0, false)) + if (!GetUpdateRect(m_data.hwnd, 0, FALSE)) return false; if (message == WM_ERASEBKGND) // Backing store - ignored. return true; @@ -1537,7 +1537,7 @@ static inline DWORD cornerToWinOrientation(Qt::Corner corner) bool QWindowsWindow::startSystemResize(const QPoint &, Qt::Corner corner) { - if (!GetSystemMenu(m_data.hwnd, false)) + if (!GetSystemMenu(m_data.hwnd, FALSE)) return false; ReleaseCapture(); -- cgit v1.2.3