summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuhang Zhao <2546789017@qq.com>2022-08-17 20:08:07 +0800
committerYuhang Zhao <2546789017@qq.com>2022-08-21 19:04:51 +0800
commitc519372dbf9cfeb1fc45e633d2f4870f494fca8f (patch)
treec5982f4bdfa2c459c5b6df6bf1e0536f93c87560
parentc51c4aa2c5593e0fbe2b309f0014a49ae6297606 (diff)
QSystemLibrary: Replace 0 with nullptr
Use modern C++ more. Change-Id: I8ba2a6e95187976b7e4077bb39f05eab04a8575f Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
-rw-r--r--src/corelib/plugin/qsystemlibrary.cpp4
-rw-r--r--src/corelib/plugin/qsystemlibrary_p.h10
2 files changed, 7 insertions, 7 deletions
diff --git a/src/corelib/plugin/qsystemlibrary.cpp b/src/corelib/plugin/qsystemlibrary.cpp
index dfca23ca3a..503bb25206 100644
--- a/src/corelib/plugin/qsystemlibrary.cpp
+++ b/src/corelib/plugin/qsystemlibrary.cpp
@@ -80,10 +80,10 @@ HINSTANCE QSystemLibrary::load(const wchar_t *libraryName, bool onlySystemDirect
}
fullPathAttempt.append(fileName);
HINSTANCE inst = ::LoadLibrary(reinterpret_cast<const wchar_t *>(fullPathAttempt.utf16()));
- if (inst != 0)
+ if (inst != nullptr)
return inst;
}
- return 0;
+ return nullptr;
}
QT_END_NAMESPACE
diff --git a/src/corelib/plugin/qsystemlibrary_p.h b/src/corelib/plugin/qsystemlibrary_p.h
index c24caf3c2e..ebdcaa7b74 100644
--- a/src/corelib/plugin/qsystemlibrary_p.h
+++ b/src/corelib/plugin/qsystemlibrary_p.h
@@ -28,14 +28,14 @@ public:
explicit QSystemLibrary(const QString &libraryName)
{
m_libraryName = libraryName;
- m_handle = 0;
+ m_handle = nullptr;
m_didLoad = false;
}
explicit QSystemLibrary(const wchar_t *libraryName)
{
m_libraryName = QString::fromWCharArray(libraryName);
- m_handle = 0;
+ m_handle = nullptr;
m_didLoad = false;
}
@@ -43,12 +43,12 @@ public:
{
m_handle = load((const wchar_t *)m_libraryName.utf16(), onlySystemDirectory);
m_didLoad = true;
- return (m_handle != 0);
+ return (m_handle != nullptr);
}
bool isLoaded()
{
- return (m_handle != 0);
+ return (m_handle != nullptr);
}
QFunctionPointer resolve(const char *symbol)
@@ -56,7 +56,7 @@ public:
if (!m_didLoad)
load();
if (!m_handle)
- return 0;
+ return nullptr;
return QFunctionPointer(GetProcAddress(m_handle, symbol));
}