mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-19 03:45:30 +08:00
Use nullptr
This commit is contained in:
@@ -79,7 +79,7 @@ namespace BlackInput
|
|||||||
{
|
{
|
||||||
Q_ASSERT_X(g_keyboardWindows == nullptr, "CKeyboardWindows::init", "Windows supports only one keyboard instance. Cannot initialize a second one!");
|
Q_ASSERT_X(g_keyboardWindows == nullptr, "CKeyboardWindows::init", "Windows supports only one keyboard instance. Cannot initialize a second one!");
|
||||||
g_keyboardWindows = this;
|
g_keyboardWindows = this;
|
||||||
m_keyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, CKeyboardWindows::keyboardProc, GetModuleHandle(NULL), 0);
|
m_keyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, CKeyboardWindows::keyboardProc, GetModuleHandle(nullptr), 0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ namespace BlackMisc
|
|||||||
std::array<WCHAR, MAX_PATH> wszCommandLine = {{}};
|
std::array<WCHAR, MAX_PATH> wszCommandLine = {{}};
|
||||||
command.toWCharArray(wszCommandLine.data());
|
command.toWCharArray(wszCommandLine.data());
|
||||||
|
|
||||||
int result = CreateProcess (nullptr, wszCommandLine.data(), 0, 0, inherit, flags, nullptr, nullptr, &startupInfo, &processInfo);
|
int result = CreateProcess (nullptr, wszCommandLine.data(), nullptr, nullptr, inherit, flags, nullptr, nullptr, &startupInfo, &processInfo);
|
||||||
|
|
||||||
if (result == 0)
|
if (result == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ namespace BlackMisc
|
|||||||
QString languageToIsoCode(LanguageCodePage codePage)
|
QString languageToIsoCode(LanguageCodePage codePage)
|
||||||
{
|
{
|
||||||
const LCID locale = codePage.wLanguage;
|
const LCID locale = codePage.wLanguage;
|
||||||
const int nchars = GetLocaleInfo(locale, LOCALE_SISO639LANGNAME, NULL, 0);
|
const int nchars = GetLocaleInfo(locale, LOCALE_SISO639LANGNAME, nullptr, 0);
|
||||||
std::vector<wchar_t> language(nchars);
|
std::vector<wchar_t> language(static_cast<size_t>(nchars));
|
||||||
GetLocaleInfo(locale, LOCALE_SISO639LANGNAME, language.data(), nchars);
|
GetLocaleInfo(locale, LOCALE_SISO639LANGNAME, language.data(), nchars);
|
||||||
const QString iso = QString::fromWCharArray(language.data(), nchars);
|
const QString iso = QString::fromWCharArray(language.data(), nchars);
|
||||||
return iso;
|
return iso;
|
||||||
@@ -76,7 +76,7 @@ namespace BlackMisc
|
|||||||
VS_FIXEDFILEINFO *pFileInfo = nullptr;
|
VS_FIXEDFILEINFO *pFileInfo = nullptr;
|
||||||
|
|
||||||
// Get the version info for the file requested
|
// Get the version info for the file requested
|
||||||
dwSize = GetFileVersionInfoSize(pszFilePath, NULL);
|
dwSize = GetFileVersionInfoSize(pszFilePath, nullptr);
|
||||||
if (dwSize == 0)
|
if (dwSize == 0)
|
||||||
{
|
{
|
||||||
result.errorMsg = QString("Error in GetFileVersionInfoSize: %1\n").arg(GetLastError());
|
result.errorMsg = QString("Error in GetFileVersionInfoSize: %1\n").arg(GetLastError());
|
||||||
|
|||||||
Reference in New Issue
Block a user