QSystemLibrary: Replace 0 with nullptr
Use modern C++ more. Change-Id: I8ba2a6e95187976b7e4077bb39f05eab04a8575f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
parent
c51c4aa2c5
commit
c519372dbf
@ -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
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user