Use true and false in preference to TRUE and FALSE

The TRUE and FALSE macros are obsolete and should be replaced with
true and false (all lower case) respectively.

Change-Id: Iee352e8173500683e6319be0abbf5bacf29016e0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Sergio Ahumada 2012-09-04 19:39:07 +02:00 committed by Qt by Nokia
parent 10ed50002c
commit 56d5c909af
26 changed files with 73 additions and 73 deletions

View File

@ -121,7 +121,7 @@ bool QFSFileEnginePrivate::nativeOpen(QIODevice::OpenMode openMode)
if (openMode & QIODevice::WriteOnly) if (openMode & QIODevice::WriteOnly)
accessRights |= GENERIC_WRITE; accessRights |= GENERIC_WRITE;
SECURITY_ATTRIBUTES securityAtts = { sizeof(SECURITY_ATTRIBUTES), NULL, FALSE }; SECURITY_ATTRIBUTES securityAtts = { sizeof(SECURITY_ATTRIBUTES), NULL, false };
// WriteOnly can create files, ReadOnly cannot. // WriteOnly can create files, ReadOnly cannot.
DWORD creationDisp = (openMode & QIODevice::WriteOnly) ? OPEN_ALWAYS : OPEN_EXISTING; DWORD creationDisp = (openMode & QIODevice::WriteOnly) ? OPEN_ALWAYS : OPEN_EXISTING;
@ -639,7 +639,7 @@ bool QFSFileEngine::link(const QString &newName)
IPersistFile *ppf; IPersistFile *ppf;
hres = psl->QueryInterface(IID_IPersistFile, (void **)&ppf); hres = psl->QueryInterface(IID_IPersistFile, (void **)&ppf);
if (SUCCEEDED(hres)) { if (SUCCEEDED(hres)) {
hres = ppf->Save((wchar_t*)linkName.utf16(), TRUE); hres = ppf->Save((wchar_t*)linkName.utf16(), true);
if (SUCCEEDED(hres)) if (SUCCEEDED(hres))
ret = true; ret = true;
ppf->Release(); ppf->Release();

View File

@ -135,7 +135,7 @@ static void duplicateStdWriteChannel(Q_PIPE *pipe, DWORD nStdHandle)
HANDLE hStdWriteChannel = GetStdHandle(nStdHandle); HANDLE hStdWriteChannel = GetStdHandle(nStdHandle);
HANDLE hCurrentProcess = GetCurrentProcess(); HANDLE hCurrentProcess = GetCurrentProcess();
DuplicateHandle(hCurrentProcess, hStdWriteChannel, hCurrentProcess, DuplicateHandle(hCurrentProcess, hStdWriteChannel, hCurrentProcess,
&pipe[1], 0, TRUE, DUPLICATE_SAME_ACCESS); &pipe[1], 0, true, DUPLICATE_SAME_ACCESS);
} }
/* /*
@ -149,7 +149,7 @@ bool QProcessPrivate::createChannel(Channel &channel)
if (&channel == &stderrChannel && processChannelMode == QProcess::MergedChannels) { if (&channel == &stderrChannel && processChannelMode == QProcess::MergedChannels) {
return DuplicateHandle(GetCurrentProcess(), stdoutChannel.pipe[1], GetCurrentProcess(), return DuplicateHandle(GetCurrentProcess(), stdoutChannel.pipe[1], GetCurrentProcess(),
&stderrChannel.pipe[1], 0, TRUE, DUPLICATE_SAME_ACCESS); &stderrChannel.pipe[1], 0, true, DUPLICATE_SAME_ACCESS);
} }
if (channel.type == Channel::Normal) { if (channel.type == Channel::Normal) {
@ -182,7 +182,7 @@ bool QProcessPrivate::createChannel(Channel &channel)
return true; return true;
} else if (channel.type == Channel::Redirect) { } else if (channel.type == Channel::Redirect) {
// we're redirecting the channel to/from a file // we're redirecting the channel to/from a file
SECURITY_ATTRIBUTES secAtt = { sizeof(SECURITY_ATTRIBUTES), NULL, TRUE }; SECURITY_ATTRIBUTES secAtt = { sizeof(SECURITY_ATTRIBUTES), NULL, true };
if (&channel == &stdinChannel) { if (&channel == &stdinChannel) {
// try to open in read-only mode // try to open in read-only mode
@ -244,7 +244,7 @@ bool QProcessPrivate::createChannel(Channel &channel)
HANDLE tmpHandle = source->pipe[1]; HANDLE tmpHandle = source->pipe[1];
if (!DuplicateHandle(GetCurrentProcess(), tmpHandle, if (!DuplicateHandle(GetCurrentProcess(), tmpHandle,
GetCurrentProcess(), &source->pipe[1], GetCurrentProcess(), &source->pipe[1],
0, TRUE, DUPLICATE_SAME_ACCESS)) 0, true, DUPLICATE_SAME_ACCESS))
return false; return false;
CloseHandle(tmpHandle); CloseHandle(tmpHandle);
@ -270,7 +270,7 @@ bool QProcessPrivate::createChannel(Channel &channel)
HANDLE tmpHandle = sink->pipe[0]; HANDLE tmpHandle = sink->pipe[0];
if (!DuplicateHandle(GetCurrentProcess(), tmpHandle, if (!DuplicateHandle(GetCurrentProcess(), tmpHandle,
GetCurrentProcess(), &sink->pipe[0], GetCurrentProcess(), &sink->pipe[0],
0, TRUE, DUPLICATE_SAME_ACCESS)) 0, true, DUPLICATE_SAME_ACCESS))
return false; return false;
CloseHandle(tmpHandle); CloseHandle(tmpHandle);
@ -484,7 +484,7 @@ void QProcessPrivate::startProcess()
stdinChannel.pipe[0], stdoutChannel.pipe[1], stderrChannel.pipe[1] stdinChannel.pipe[0], stdoutChannel.pipe[1], stderrChannel.pipe[1]
}; };
success = CreateProcess(0, (wchar_t*)args.utf16(), success = CreateProcess(0, (wchar_t*)args.utf16(),
0, 0, TRUE, dwCreationFlags, 0, 0, true, dwCreationFlags,
environment.isEmpty() ? 0 : envlist.data(), environment.isEmpty() ? 0 : envlist.data(),
workingDirectory.isEmpty() ? 0 : (wchar_t*)QDir::toNativeSeparators(workingDirectory).utf16(), workingDirectory.isEmpty() ? 0 : (wchar_t*)QDir::toNativeSeparators(workingDirectory).utf16(),
&startupInfo, pid); &startupInfo, pid);
@ -585,7 +585,7 @@ static BOOL QT_WIN_CALLBACK qt_terminateApp(HWND hwnd, LPARAM procId)
if (currentProcId == (DWORD)procId) if (currentProcId == (DWORD)procId)
PostMessage(hwnd, WM_CLOSE, 0, 0); PostMessage(hwnd, WM_CLOSE, 0, 0);
return TRUE; return true;
} }
void QProcessPrivate::terminateProcess() void QProcessPrivate::terminateProcess()
@ -853,7 +853,7 @@ bool QProcessPrivate::startDetached(const QString &program, const QStringList &a
0, 0, 0, 0, 0, 0, 0, 0, 0, 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}; };
success = CreateProcess(0, (wchar_t*)args.utf16(), success = CreateProcess(0, (wchar_t*)args.utf16(),
0, 0, FALSE, CREATE_UNICODE_ENVIRONMENT | CREATE_NEW_CONSOLE, 0, 0, 0, false, CREATE_UNICODE_ENVIRONMENT | CREATE_NEW_CONSOLE, 0,
workingDir.isEmpty() ? 0 : (wchar_t*)workingDir.utf16(), workingDir.isEmpty() ? 0 : (wchar_t*)workingDir.utf16(),
&startupInfo, &pinfo); &startupInfo, &pinfo);

View File

@ -1032,7 +1032,7 @@ static QString windowsConfigPath(int type)
GetSpecialFolderPath SHGetSpecialFolderPath = (GetSpecialFolderPath)library.resolve("SHGetSpecialFolderPathW"); GetSpecialFolderPath SHGetSpecialFolderPath = (GetSpecialFolderPath)library.resolve("SHGetSpecialFolderPathW");
if (SHGetSpecialFolderPath) { if (SHGetSpecialFolderPath) {
wchar_t path[MAX_PATH]; wchar_t path[MAX_PATH];
SHGetSpecialFolderPath(0, path, type, FALSE); SHGetSpecialFolderPath(0, path, type, false);
result = QString::fromWCharArray(path); result = QString::fromWCharArray(path);
} }

View File

@ -100,9 +100,9 @@ QString QStandardPaths::writableLocation(StandardLocation type)
case DataLocation: case DataLocation:
case GenericDataLocation: case GenericDataLocation:
#if defined Q_OS_WINCE #if defined Q_OS_WINCE
if (SHGetSpecialFolderPath(0, path, CSIDL_APPDATA, FALSE)) if (SHGetSpecialFolderPath(0, path, CSIDL_APPDATA, false))
#else #else
if (SHGetSpecialFolderPath(0, path, CSIDL_LOCAL_APPDATA, FALSE)) if (SHGetSpecialFolderPath(0, path, CSIDL_LOCAL_APPDATA, false))
#endif #endif
result = convertCharArray(path); result = convertCharArray(path);
if (isTestModeEnabled()) if (isTestModeEnabled())
@ -116,38 +116,38 @@ QString QStandardPaths::writableLocation(StandardLocation type)
break; break;
case DesktopLocation: case DesktopLocation:
if (SHGetSpecialFolderPath(0, path, CSIDL_DESKTOPDIRECTORY, FALSE)) if (SHGetSpecialFolderPath(0, path, CSIDL_DESKTOPDIRECTORY, false))
result = convertCharArray(path); result = convertCharArray(path);
break; break;
case DownloadLocation: // TODO implement with SHGetKnownFolderPath(FOLDERID_Downloads) (starting from Vista) case DownloadLocation: // TODO implement with SHGetKnownFolderPath(FOLDERID_Downloads) (starting from Vista)
case DocumentsLocation: case DocumentsLocation:
if (SHGetSpecialFolderPath(0, path, CSIDL_PERSONAL, FALSE)) if (SHGetSpecialFolderPath(0, path, CSIDL_PERSONAL, false))
result = convertCharArray(path); result = convertCharArray(path);
break; break;
case FontsLocation: case FontsLocation:
if (SHGetSpecialFolderPath(0, path, CSIDL_FONTS, FALSE)) if (SHGetSpecialFolderPath(0, path, CSIDL_FONTS, false))
result = convertCharArray(path); result = convertCharArray(path);
break; break;
case ApplicationsLocation: case ApplicationsLocation:
if (SHGetSpecialFolderPath(0, path, CSIDL_PROGRAMS, FALSE)) if (SHGetSpecialFolderPath(0, path, CSIDL_PROGRAMS, false))
result = convertCharArray(path); result = convertCharArray(path);
break; break;
case MusicLocation: case MusicLocation:
if (SHGetSpecialFolderPath(0, path, CSIDL_MYMUSIC, FALSE)) if (SHGetSpecialFolderPath(0, path, CSIDL_MYMUSIC, false))
result = convertCharArray(path); result = convertCharArray(path);
break; break;
case MoviesLocation: case MoviesLocation:
if (SHGetSpecialFolderPath(0, path, CSIDL_MYVIDEO, FALSE)) if (SHGetSpecialFolderPath(0, path, CSIDL_MYVIDEO, false))
result = convertCharArray(path); result = convertCharArray(path);
break; break;
case PicturesLocation: case PicturesLocation:
if (SHGetSpecialFolderPath(0, path, CSIDL_MYPICTURES, FALSE)) if (SHGetSpecialFolderPath(0, path, CSIDL_MYPICTURES, false))
result = convertCharArray(path); result = convertCharArray(path);
break; break;
@ -186,7 +186,7 @@ QStringList QStandardPaths::standardLocations(StandardLocation type)
case ConfigLocation: // same as DataLocation, on Windows case ConfigLocation: // same as DataLocation, on Windows
case DataLocation: case DataLocation:
case GenericDataLocation: case GenericDataLocation:
if (SHGetSpecialFolderPath(0, path, CSIDL_COMMON_APPDATA, FALSE)) { if (SHGetSpecialFolderPath(0, path, CSIDL_COMMON_APPDATA, false)) {
QString result = convertCharArray(path); QString result = convertCharArray(path);
if (type != GenericDataLocation) { if (type != GenericDataLocation) {
if (!QCoreApplication::organizationName().isEmpty()) if (!QCoreApplication::organizationName().isEmpty())

View File

@ -54,7 +54,7 @@ QWindowsPipeWriter::QWindowsPipeWriter(HANDLE pipe, QObject * parent)
{ {
#if !defined(Q_OS_WINCE) || (_WIN32_WCE >= 0x600) #if !defined(Q_OS_WINCE) || (_WIN32_WCE >= 0x600)
DuplicateHandle(GetCurrentProcess(), pipe, GetCurrentProcess(), DuplicateHandle(GetCurrentProcess(), pipe, GetCurrentProcess(),
&writePipe, 0, FALSE, DUPLICATE_SAME_ACCESS); &writePipe, 0, false, DUPLICATE_SAME_ACCESS);
#else #else
Q_UNUSED(pipe); Q_UNUSED(pipe);
writePipe = GetCurrentProcess(); writePipe = GetCurrentProcess();
@ -103,7 +103,7 @@ void QWindowsPipeWriter::run()
{ {
OVERLAPPED overl; OVERLAPPED overl;
memset(&overl, 0, sizeof overl); memset(&overl, 0, sizeof overl);
overl.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); overl.hEvent = CreateEvent(NULL, true, false, NULL);
forever { forever {
lock.lock(); lock.lock();
while(data.isEmpty() && (!quitNow)) { while(data.isEmpty() && (!quitNow)) {
@ -138,7 +138,7 @@ void QWindowsPipeWriter::run()
} }
#ifndef Q_OS_WINCE #ifndef Q_OS_WINCE
if (GetLastError() == ERROR_IO_PENDING) { if (GetLastError() == ERROR_IO_PENDING) {
if (!GetOverlappedResult(writePipe, &overl, &written, TRUE)) { if (!GetOverlappedResult(writePipe, &overl, &written, true)) {
CloseHandle(overl.hEvent); CloseHandle(overl.hEvent);
return; return;
} }

View File

@ -168,7 +168,7 @@ QWinOverlappedIoNotifier::QWinOverlappedIoNotifier(QObject *parent)
lastNumberOfBytes(0), lastNumberOfBytes(0),
lastErrorCode(ERROR_SUCCESS) lastErrorCode(ERROR_SUCCESS)
{ {
hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); hEvent = CreateEvent(NULL, true, false, NULL);
connect(this, &QWinOverlappedIoNotifier::_q_notify, connect(this, &QWinOverlappedIoNotifier::_q_notify,
this, &QWinOverlappedIoNotifier::_q_notified, Qt::QueuedConnection); this, &QWinOverlappedIoNotifier::_q_notified, Qt::QueuedConnection);
} }

View File

@ -1001,7 +1001,7 @@ void QEventDispatcherWin32::activateEventNotifiers()
//### this could break if events are removed/added in the activation //### this could break if events are removed/added in the activation
for (int i=0; i<d->winEventNotifierList.count(); i++) { for (int i=0; i<d->winEventNotifierList.count(); i++) {
#if !defined(Q_OS_WINCE) #if !defined(Q_OS_WINCE)
if (WaitForSingleObjectEx(d->winEventNotifierList.at(i)->handle(), 0, TRUE) == WAIT_OBJECT_0) if (WaitForSingleObjectEx(d->winEventNotifierList.at(i)->handle(), 0, true) == WAIT_OBJECT_0)
d->activateEventNotifier(d->winEventNotifierList.at(i)); d->activateEventNotifier(d->winEventNotifierList.at(i));
#else #else
if (WaitForSingleObject(d->winEventNotifierList.at(i)->handle(), 0) == WAIT_OBJECT_0) if (WaitForSingleObject(d->winEventNotifierList.at(i)->handle(), 0) == WAIT_OBJECT_0)

View File

@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
QMutexPrivate::QMutexPrivate() QMutexPrivate::QMutexPrivate()
{ {
event = CreateEvent(0, FALSE, FALSE, 0); event = CreateEvent(0, false, false, 0);
if (!event) if (!event)
qWarning("QMutexData::QMutexData: Cannot create event"); qWarning("QMutexData::QMutexData: Cannot create event");
} }

View File

@ -127,7 +127,7 @@ QThreadData *QThreadData::current()
GetCurrentProcess(), GetCurrentProcess(),
&realHandle, &realHandle,
0, 0,
FALSE, false,
DUPLICATE_SAME_ACCESS); DUPLICATE_SAME_ACCESS);
#else #else
realHandle = (HANDLE)GetCurrentThreadId(); realHandle = (HANDLE)GetCurrentThreadId();

View File

@ -64,7 +64,7 @@ class QWaitConditionEvent
public: public:
inline QWaitConditionEvent() : priority(0), wokenUp(false) inline QWaitConditionEvent() : priority(0), wokenUp(false)
{ {
event = CreateEvent(NULL, TRUE, FALSE, NULL); event = CreateEvent(NULL, true, false, NULL);
} }
inline ~QWaitConditionEvent() { CloseHandle(event); } inline ~QWaitConditionEvent() { CloseHandle(event); }
int priority; int priority;

View File

@ -363,7 +363,7 @@ static bool read_jpeg_image(QImage *outImage,
// If high quality not required, use fast decompression // If high quality not required, use fast decompression
if( quality < HIGH_QUALITY_THRESHOLD ) { if( quality < HIGH_QUALITY_THRESHOLD ) {
info->dct_method = JDCT_IFAST; info->dct_method = JDCT_IFAST;
info->do_fancy_upsampling = FALSE; info->do_fancy_upsampling = false;
} }
(void) jpeg_calc_output_dimensions(info); (void) jpeg_calc_output_dimensions(info);

View File

@ -69,7 +69,7 @@ bool QLocalServerPrivate::addListener()
SECURITY_ATTRIBUTES sa; SECURITY_ATTRIBUTES sa;
sa.nLength = sizeof(SECURITY_ATTRIBUTES); sa.nLength = sizeof(SECURITY_ATTRIBUTES);
sa.bInheritHandle = FALSE; //non inheritable handle, same as default sa.bInheritHandle = false; //non inheritable handle, same as default
sa.lpSecurityDescriptor = 0; //default security descriptor sa.lpSecurityDescriptor = 0; //default security descriptor
QScopedPointer<SECURITY_DESCRIPTOR> pSD; QScopedPointer<SECURITY_DESCRIPTOR> pSD;
@ -166,9 +166,9 @@ bool QLocalServerPrivate::addListener()
return false; return false;
} }
} }
SetSecurityDescriptorOwner(pSD.data(), pTokenUser->User.Sid, FALSE); SetSecurityDescriptorOwner(pSD.data(), pTokenUser->User.Sid, false);
SetSecurityDescriptorGroup(pSD.data(), pTokenGroup->PrimaryGroup, FALSE); SetSecurityDescriptorGroup(pSD.data(), pTokenGroup->PrimaryGroup, false);
if (!SetSecurityDescriptorDacl(pSD.data(), TRUE, acl, FALSE)) { if (!SetSecurityDescriptorDacl(pSD.data(), false, acl, false)) {
setError(QLatin1String("QLocalServerPrivate::addListener")); setError(QLatin1String("QLocalServerPrivate::addListener"));
FreeSid(worldSID); FreeSid(worldSID);
return false; return false;
@ -252,7 +252,7 @@ bool QLocalServerPrivate::listen(const QString &name)
// Use only one event for all listeners of one socket. // Use only one event for all listeners of one socket.
// The idea is that listener events are rare, so polling all listeners once in a while is // The idea is that listener events are rare, so polling all listeners once in a while is
// cheap compared to waiting for N additional events in each iteration of the main loop. // cheap compared to waiting for N additional events in each iteration of the main loop.
eventHandle = CreateEvent(NULL, TRUE, FALSE, NULL); eventHandle = CreateEvent(NULL, true, false, NULL);
connectionEventNotifier = new QWinEventNotifier(eventHandle , q); connectionEventNotifier = new QWinEventNotifier(eventHandle , q);
q->connect(connectionEventNotifier, SIGNAL(activated(HANDLE)), q, SLOT(_q_onNewConnection())); q->connect(connectionEventNotifier, SIGNAL(activated(HANDLE)), q, SLOT(_q_onNewConnection()));
@ -282,7 +282,7 @@ void QLocalServerPrivate::_q_onNewConnection()
for (int i = 0; i < listeners.size(); ) { for (int i = 0; i < listeners.size(); ) {
HANDLE handle = listeners[i].handle; HANDLE handle = listeners[i].handle;
if (listeners[i].connected if (listeners[i].connected
|| GetOverlappedResult(handle, &listeners[i].overlapped, &dummy, FALSE)) || GetOverlappedResult(handle, &listeners[i].overlapped, &dummy, false))
{ {
listeners.removeAt(i); listeners.removeAt(i);

View File

@ -175,7 +175,7 @@ bool q_reduceConfigAttributes(QVector<EGLint> *configAttributes)
i = configAttributes->indexOf(EGL_BIND_TO_TEXTURE_RGBA); i = configAttributes->indexOf(EGL_BIND_TO_TEXTURE_RGBA);
if (i >= 0) { if (i >= 0) {
configAttributes->replace(i,EGL_BIND_TO_TEXTURE_RGB); configAttributes->replace(i,EGL_BIND_TO_TEXTURE_RGB);
configAttributes->replace(i+1,TRUE); configAttributes->replace(i+1,true);
} }
#endif #endif

View File

@ -364,11 +364,11 @@ bool ICOReader::readBMPHeader(quint32 imageOffset, BMP_INFOHDR * header)
if (iod) { if (iod) {
if (iod->seek(startpos + imageOffset)) { if (iod->seek(startpos + imageOffset)) {
if (readBMPInfoHeader(iod, header)) { if (readBMPInfoHeader(iod, header)) {
return TRUE; return true;
} }
} }
} }
return FALSE; return false;
} }
void ICOReader::findColorInfo(QImage & image) void ICOReader::findColorInfo(QImage & image)

View File

@ -377,9 +377,9 @@ static int choosePixelFormat(HDC hdc,
iAttributes[i++] = testFlag(additional.formatFlags, QWindowsGLDirectRendering) ? iAttributes[i++] = testFlag(additional.formatFlags, QWindowsGLDirectRendering) ?
WGL_FULL_ACCELERATION_ARB : WGL_NO_ACCELERATION_ARB; WGL_FULL_ACCELERATION_ARB : WGL_NO_ACCELERATION_ARB;
iAttributes[i++] = WGL_SUPPORT_OPENGL_ARB; iAttributes[i++] = WGL_SUPPORT_OPENGL_ARB;
iAttributes[i++] = TRUE; iAttributes[i++] = true;
iAttributes[i++] = WGL_DRAW_TO_WINDOW_ARB; iAttributes[i++] = WGL_DRAW_TO_WINDOW_ARB;
iAttributes[i++] = TRUE; iAttributes[i++] = true;
iAttributes[i++] = WGL_COLOR_BITS_ARB; iAttributes[i++] = WGL_COLOR_BITS_ARB;
iAttributes[i++] = 24; iAttributes[i++] = 24;
switch (format.swapBehavior()) { switch (format.swapBehavior()) {
@ -387,17 +387,17 @@ static int choosePixelFormat(HDC hdc,
break; break;
case QSurfaceFormat::SingleBuffer: case QSurfaceFormat::SingleBuffer:
iAttributes[i++] = WGL_DOUBLE_BUFFER_ARB; iAttributes[i++] = WGL_DOUBLE_BUFFER_ARB;
iAttributes[i++] = FALSE; iAttributes[i++] = false;
break; break;
case QSurfaceFormat::DoubleBuffer: case QSurfaceFormat::DoubleBuffer:
case QSurfaceFormat::TripleBuffer: case QSurfaceFormat::TripleBuffer:
iAttributes[i++] = WGL_DOUBLE_BUFFER_ARB; iAttributes[i++] = WGL_DOUBLE_BUFFER_ARB;
iAttributes[i++] = TRUE; iAttributes[i++] = true;
break; break;
} }
if (format.stereo()) { if (format.stereo()) {
iAttributes[i++] = WGL_STEREO_ARB; iAttributes[i++] = WGL_STEREO_ARB;
iAttributes[i++] = TRUE; iAttributes[i++] = true;
} }
if (format.depthBufferSize() >= 0) { if (format.depthBufferSize() >= 0) {
iAttributes[i++] = WGL_DEPTH_BITS_ARB; iAttributes[i++] = WGL_DEPTH_BITS_ARB;
@ -435,13 +435,13 @@ static int choosePixelFormat(HDC hdc,
int samplesValuePosition = 0; int samplesValuePosition = 0;
if (sampleBuffersRequested) { if (sampleBuffersRequested) {
iAttributes[i++] = WGL_SAMPLE_BUFFERS_ARB; iAttributes[i++] = WGL_SAMPLE_BUFFERS_ARB;
iAttributes[i++] = TRUE; iAttributes[i++] = true;
iAttributes[i++] = WGL_SAMPLES_ARB; iAttributes[i++] = WGL_SAMPLES_ARB;
samplesValuePosition = i; samplesValuePosition = i;
iAttributes[i++] = format.samples(); iAttributes[i++] = format.samples();
} else if (samples == 0 || samples == 1 ) { } else if (samples == 0 || samples == 1 ) {
iAttributes[i++] = WGL_SAMPLE_BUFFERS_ARB; iAttributes[i++] = WGL_SAMPLE_BUFFERS_ARB;
iAttributes[i++] = FALSE; iAttributes[i++] = false;
} }
// If sample buffer request cannot be satisfied, reduce request. // If sample buffer request cannot be satisfied, reduce request.
int pixelFormat = 0; int pixelFormat = 0;

View File

@ -697,7 +697,7 @@ static void showSystemMenu(QWindow* w)
{ {
QWindow *topLevel = QWindowsWindow::topLevelOf(w); QWindow *topLevel = QWindowsWindow::topLevelOf(w);
HWND topLevelHwnd = QWindowsWindow::handleOf(topLevel); HWND topLevelHwnd = QWindowsWindow::handleOf(topLevel);
HMENU menu = GetSystemMenu(topLevelHwnd, FALSE); HMENU menu = GetSystemMenu(topLevelHwnd, false);
if (!menu) if (!menu)
return; // no menu for this window return; // no menu for this window
@ -722,7 +722,7 @@ static void showSystemMenu(QWindow* w)
closeItem.cbSize = sizeof(MENUITEMINFO); closeItem.cbSize = sizeof(MENUITEMINFO);
closeItem.fMask = MIIM_STATE; closeItem.fMask = MIIM_STATE;
closeItem.fState = MFS_DEFAULT; closeItem.fState = MFS_DEFAULT;
SetMenuItemInfo(menu, SC_CLOSE, FALSE, &closeItem); SetMenuItemInfo(menu, SC_CLOSE, false, &closeItem);
#undef enabled #undef enabled
#undef disabled #undef disabled

View File

@ -93,8 +93,8 @@ BOOL QT_WIN_CALLBACK monitorEnumCallback(HMONITOR hMonitor, HDC, LPRECT, LPARAM
MONITORINFOEX info; MONITORINFOEX info;
memset(&info, 0, sizeof(MONITORINFOEX)); memset(&info, 0, sizeof(MONITORINFOEX));
info.cbSize = sizeof(MONITORINFOEX); info.cbSize = sizeof(MONITORINFOEX);
if (GetMonitorInfo(hMonitor, &info) == FALSE) if (GetMonitorInfo(hMonitor, &info) == false)
return TRUE; return true;
WindowsScreenDataList *result = reinterpret_cast<WindowsScreenDataList *>(p); WindowsScreenDataList *result = reinterpret_cast<WindowsScreenDataList *>(p);
QWindowsScreenData data; QWindowsScreenData data;
@ -131,7 +131,7 @@ BOOL QT_WIN_CALLBACK monitorEnumCallback(HMONITOR hMonitor, HDC, LPRECT, LPARAM
data.flags |= QWindowsScreenData::PrimaryScreen; data.flags |= QWindowsScreenData::PrimaryScreen;
data.name = QString::fromWCharArray(info.szDevice); data.name = QString::fromWCharArray(info.szDevice);
result->append(data); result->append(data);
return TRUE; return true;
} }
static inline WindowsScreenDataList monitorData() static inline WindowsScreenDataList monitorData()

View File

@ -138,7 +138,7 @@ static inline bool launchMail(const QUrl &url)
STARTUPINFO si; STARTUPINFO si;
ZeroMemory(&si, sizeof(si)); ZeroMemory(&si, sizeof(si));
si.cb = 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)); qErrnoWarning("Unable to launch '%s'", qPrintable(command));
return false; return false;
} }

View File

@ -511,7 +511,7 @@ void WindowCreationData::initialize(HWND hwnd, bool frameChange, qreal opacityLe
SetWindowPos(hwnd, HWND_BOTTOM, 0, 0, 0, 0, swpFlags); SetWindowPos(hwnd, HWND_BOTTOM, 0, 0, 0, 0, swpFlags);
} }
if (flags & (Qt::CustomizeWindowHint|Qt::WindowTitleHint)) { if (flags & (Qt::CustomizeWindowHint|Qt::WindowTitleHint)) {
HMENU systemMenu = GetSystemMenu(hwnd, FALSE); HMENU systemMenu = GetSystemMenu(hwnd, false);
if (flags & Qt::WindowCloseButtonHint) if (flags & Qt::WindowCloseButtonHint)
EnableMenuItem(systemMenu, SC_CLOSE, MF_BYCOMMAND|MF_ENABLED); EnableMenuItem(systemMenu, SC_CLOSE, MF_BYCOMMAND|MF_ENABLED);
else else
@ -557,7 +557,7 @@ QMargins QWindowsGeometryHint::frame(DWORD style, DWORD exStyle)
#ifndef Q_OS_WINCE #ifndef Q_OS_WINCE
style &= ~(WS_OVERLAPPED); // Not permitted, see docs. style &= ~(WS_OVERLAPPED); // Not permitted, see docs.
#endif #endif
if (!AdjustWindowRectEx(&rect, style, FALSE, exStyle)) if (!AdjustWindowRectEx(&rect, style, false, exStyle))
qErrnoWarning("%s: AdjustWindowRectEx failed", __FUNCTION__); qErrnoWarning("%s: AdjustWindowRectEx failed", __FUNCTION__);
const QMargins result(qAbs(rect.left), qAbs(rect.top), const QMargins result(qAbs(rect.left), qAbs(rect.top),
qAbs(rect.right), qAbs(rect.bottom)); 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. // maximizing the widget, and then remove the maximize button afterwards.
if (flags & Qt::WindowTitleHint && if (flags & Qt::WindowTitleHint &&
!(flags & (Qt::WindowMinMaxButtonsHint | Qt::FramelessWindowHint))) { !(flags & (Qt::WindowMinMaxButtonsHint | Qt::FramelessWindowHint))) {
fakedMaximize = TRUE; fakedMaximize = true;
setStyle(style() | WS_MAXIMIZEBOX); setStyle(style() | WS_MAXIMIZEBOX);
} }
} }
@ -1107,7 +1107,7 @@ bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message,
WPARAM, LPARAM) WPARAM, LPARAM)
{ {
// Ignore invalid update bounding rectangles // Ignore invalid update bounding rectangles
if (!GetUpdateRect(m_data.hwnd, 0, FALSE)) if (!GetUpdateRect(m_data.hwnd, 0, false))
return false; return false;
if (message == WM_ERASEBKGND) // Backing store - ignored. if (message == WM_ERASEBKGND) // Backing store - ignored.
return true; return true;
@ -1537,7 +1537,7 @@ static inline DWORD cornerToWinOrientation(Qt::Corner corner)
bool QWindowsWindow::startSystemResize(const QPoint &, 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; return false;
ReleaseCapture(); ReleaseCapture();

View File

@ -120,10 +120,10 @@ QGLXContext::QGLXContext(QXcbScreen *screen, const QSurfaceFormat &format, QPlat
// Could not create a context using glXCreateContextAttribsARB, falling back to glXCreateNewContext. // Could not create a context using glXCreateContextAttribsARB, falling back to glXCreateNewContext.
if (!m_context) { if (!m_context) {
m_context = glXCreateNewContext(DISPLAY_FROM_XCB(screen), config, GLX_RGBA_TYPE, m_shareContext, TRUE); m_context = glXCreateNewContext(DISPLAY_FROM_XCB(screen), config, GLX_RGBA_TYPE, m_shareContext, true);
if (!m_context && m_shareContext) { if (!m_context && m_shareContext) {
// re-try without a shared glx context // re-try without a shared glx context
m_context = glXCreateNewContext(DISPLAY_FROM_XCB(screen), config, GLX_RGBA_TYPE, 0, TRUE); m_context = glXCreateNewContext(DISPLAY_FROM_XCB(screen), config, GLX_RGBA_TYPE, 0, true);
if (m_context) if (m_context)
m_shareContext = 0; m_shareContext = 0;
} }

View File

@ -1403,7 +1403,7 @@ int QFileDialogPrivate::maxNameLength(const QString &path)
#elif defined(Q_OS_WIN) #elif defined(Q_OS_WIN)
DWORD maxLength; DWORD maxLength;
const QString drive = path.left(3); const QString drive = path.left(3);
if (::GetVolumeInformation(reinterpret_cast<const wchar_t *>(drive.utf16()), NULL, 0, NULL, &maxLength, NULL, NULL, 0) == FALSE) if (::GetVolumeInformation(reinterpret_cast<const wchar_t *>(drive.utf16()), NULL, 0, NULL, &maxLength, NULL, NULL, 0) == false)
return -1; return -1;
return maxLength; return maxLength;
#else #else

View File

@ -77,7 +77,7 @@ HMENU qt_getWindowsSystemMenu(const QWidget *w)
{ {
if (QWindow *window = QApplicationPrivate::windowForWidget(w)) if (QWindow *window = QApplicationPrivate::windowForWidget(w))
if (void *handle = QGuiApplication::platformNativeInterface()->nativeResourceForWindow("handle", window)) if (void *handle = QGuiApplication::platformNativeInterface()->nativeResourceForWindow("handle", window))
return GetSystemMenu(reinterpret_cast<HWND>(handle), FALSE); return GetSystemMenu(reinterpret_cast<HWND>(handle), false);
return 0; return 0;
} }
#endif #endif

View File

@ -799,7 +799,7 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
type = GTK_ARROW_DOWN; type = GTK_ARROW_DOWN;
gtkPainter.paintArrow(gtkTreeHeader, "button", option->rect.adjusted(1, 1, -1, -1), type, state, gtkPainter.paintArrow(gtkTreeHeader, "button", option->rect.adjusted(1, 1, -1, -1), type, state,
GTK_SHADOW_NONE, FALSE, style); GTK_SHADOW_NONE, false, style);
} }
break; break;
@ -965,7 +965,7 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
GdkColor color = fromQColor(arrowColor); GdkColor color = fromQColor(arrowColor);
d->gtk_widget_modify_fg (gtkArrow, state, &color); d->gtk_widget_modify_fg (gtkArrow, state, &color);
gtkPainter.paintArrow(gtkArrow, "button", arrowRect, gtkPainter.paintArrow(gtkArrow, "button", arrowRect,
type, state, shadow, FALSE, gtkArrow->style, type, state, shadow, false, gtkArrow->style,
QString::number(arrowColor.rgba(), 16)); QString::number(arrowColor.rgba(), 16));
// Passing NULL will revert the color change // Passing NULL will revert the color change
d->gtk_widget_modify_fg (gtkArrow, state, NULL); d->gtk_widget_modify_fg (gtkArrow, state, NULL);
@ -1009,7 +1009,7 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
"focus-line-width", &focus_line_width, NULL); "focus-line-width", &focus_line_width, NULL);
// See https://bugzilla.mozilla.org/show_bug.cgi?id=405421 for info about this hack // See https://bugzilla.mozilla.org/show_bug.cgi?id=405421 for info about this hack
g_object_set_data(G_OBJECT(gtkEntry), "transparent-bg-hint", GINT_TO_POINTER(TRUE)); g_object_set_data(G_OBJECT(gtkEntry), "transparent-bg-hint", GINT_TO_POINTER(true));
if (!interior_focus && option->state & State_HasFocus) if (!interior_focus && option->state & State_HasFocus)
rect.adjust(focus_line_width, focus_line_width, -focus_line_width, -focus_line_width); rect.adjust(focus_line_width, focus_line_width, -focus_line_width, -focus_line_width);
@ -1571,7 +1571,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
if (gtkArrow) { if (gtkArrow) {
gtkCachedPainter.setClipRect(option->rect); gtkCachedPainter.setClipRect(option->rect);
gtkCachedPainter.paintArrow( gtkArrow, "arrow", arrowRect, gtkCachedPainter.paintArrow( gtkArrow, "arrow", arrowRect,
GTK_ARROW_DOWN, state, GTK_SHADOW_NONE, TRUE, GTK_ARROW_DOWN, state, GTK_SHADOW_NONE, true,
style, arrowPath.toString() + QString::number(option->direction)); style, arrowPath.toString() + QString::number(option->direction));
} }
} }
@ -1787,7 +1787,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
gtkPainter.paintArrow( scrollbarWidget, horizontal ? "hscrollbar" : "vscrollbar", scrollBarAddLine.adjusted(4, 4, -4, -4), gtkPainter.paintArrow( scrollbarWidget, horizontal ? "hscrollbar" : "vscrollbar", scrollBarAddLine.adjusted(4, 4, -4, -4),
horizontal ? (reverse ? GTK_ARROW_LEFT : GTK_ARROW_RIGHT) : horizontal ? (reverse ? GTK_ARROW_LEFT : GTK_ARROW_RIGHT) :
GTK_ARROW_DOWN, state, GTK_SHADOW_NONE, FALSE, style); GTK_ARROW_DOWN, state, GTK_SHADOW_NONE, false, style);
} }
if (scrollBar->subControls & SC_ScrollBarSubLine) { if (scrollBar->subControls & SC_ScrollBarSubLine) {
@ -1813,7 +1813,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
gtkPainter.paintArrow(scrollbarWidget, horizontal ? "hscrollbar" : "vscrollbar", scrollBarSubLine.adjusted(4, 4, -4, -4), gtkPainter.paintArrow(scrollbarWidget, horizontal ? "hscrollbar" : "vscrollbar", scrollBarSubLine.adjusted(4, 4, -4, -4),
horizontal ? (reverse ? GTK_ARROW_RIGHT : GTK_ARROW_LEFT) : horizontal ? (reverse ? GTK_ARROW_RIGHT : GTK_ARROW_LEFT) :
GTK_ARROW_UP, state, GTK_SHADOW_NONE, FALSE, style); GTK_ARROW_UP, state, GTK_SHADOW_NONE, false, style);
} }
} }
break; break;
@ -1957,7 +1957,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
state = GTK_STATE_INSENSITIVE; state = GTK_STATE_INSENSITIVE;
gtkPainter.paintArrow( gtkSpinButton, "spinbutton", arrowRect, GTK_ARROW_UP, state, gtkPainter.paintArrow( gtkSpinButton, "spinbutton", arrowRect, GTK_ARROW_UP, state,
GTK_SHADOW_NONE, FALSE, style); GTK_SHADOW_NONE, false, style);
arrowRect.moveCenter(downRect.center()); arrowRect.moveCenter(downRect.center());
@ -1965,7 +1965,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
state = GTK_STATE_INSENSITIVE; state = GTK_STATE_INSENSITIVE;
gtkPainter.paintArrow( gtkSpinButton, "spinbutton", arrowRect, GTK_ARROW_DOWN, state, gtkPainter.paintArrow( gtkSpinButton, "spinbutton", arrowRect, GTK_ARROW_DOWN, state,
GTK_SHADOW_NONE, FALSE, style); GTK_SHADOW_NONE, false, style);
} }
} }
break; break;
@ -2863,7 +2863,7 @@ void QGtkStyle::drawControl(ControlElement element,
GtkStateType state = enabled ? (act ? GTK_STATE_PRELIGHT: GTK_STATE_NORMAL) : GTK_STATE_INSENSITIVE; GtkStateType state = enabled ? (act ? GTK_STATE_PRELIGHT: GTK_STATE_NORMAL) : GTK_STATE_INSENSITIVE;
GtkShadowType shadowType = (state == GTK_STATE_PRELIGHT) ? GTK_SHADOW_OUT : GTK_SHADOW_IN; GtkShadowType shadowType = (state == GTK_STATE_PRELIGHT) ? GTK_SHADOW_OUT : GTK_SHADOW_IN;
gtkPainter.paintArrow(gtkMenuItem, "menuitem", vSubMenuRect, QApplication::isRightToLeft() ? GTK_ARROW_LEFT : GTK_ARROW_RIGHT, state, gtkPainter.paintArrow(gtkMenuItem, "menuitem", vSubMenuRect, QApplication::isRightToLeft() ? GTK_ARROW_LEFT : GTK_ARROW_RIGHT, state,
shadowType, FALSE, style); shadowType, false, style);
} }
} }
painter->restore(); painter->restore();

View File

@ -109,7 +109,7 @@ int APIENTRY WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR /*cmdPara
// If there exists an other instance of this application // If there exists an other instance of this application
// it will be the owner of a mutex with the unique ID. // it will be the owner of a mutex with the unique ID.
HANDLE mutex = CreateMutex(NULL, TRUE, (LPCWSTR)uid.utf16()); HANDLE mutex = CreateMutex(NULL, true, (LPCWSTR)uid.utf16());
if (mutex && ERROR_ALREADY_EXISTS == GetLastError()) { if (mutex && ERROR_ALREADY_EXISTS == GetLastError()) {
CloseHandle(mutex); CloseHandle(mutex);

View File

@ -1666,7 +1666,7 @@ BOOL IsUserAdmin()
&AdministratorsGroup); &AdministratorsGroup);
if (b) { if (b) {
if (!CheckTokenMembership( NULL, AdministratorsGroup, &b)) if (!CheckTokenMembership( NULL, AdministratorsGroup, &b))
b = FALSE; b = false;
FreeSid(AdministratorsGroup); FreeSid(AdministratorsGroup);
} }

View File

@ -72,7 +72,7 @@ void tst_QWinEventNotifier::simple_timerSet()
void tst_QWinEventNotifier::simple() void tst_QWinEventNotifier::simple()
{ {
simpleHEvent = CreateEvent(0, TRUE, FALSE, 0); simpleHEvent = CreateEvent(0, true, false, 0);
QVERIFY(simpleHEvent); QVERIFY(simpleHEvent);
QWinEventNotifier n(simpleHEvent); QWinEventNotifier n(simpleHEvent);