<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;MUTILS_DLL_EXPORT;_DEBUG;_LIB;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_DLL;QT_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4714;4324;4127</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<MinimalRebuild>false</MinimalRebuild>
<ControlFlowGuard>false</ControlFlowGuard>
<WholeProgramOptimization>true</WholeProgramOptimization>
+ <DisableSpecificWarnings>4714;4324;4127</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
<ClCompile>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<MinimalRebuild>false</MinimalRebuild>
<ControlFlowGuard>false</ControlFlowGuard>
<WholeProgramOptimization>true</WholeProgramOptimization>
+ <DisableSpecificWarnings>4714;4324;4127</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;MUTILS_DLL_EXPORT;_DEBUG;_LIB;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_DLL;QT_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
<ClCompile>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<MinimalRebuild>false</MinimalRebuild>
<ControlFlowGuard>false</ControlFlowGuard>
<WholeProgramOptimization>true</WholeProgramOptimization>
+ <DisableSpecificWarnings>4714;4324;4127</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;MUTILS_DLL_EXPORT;_DEBUG;_LIB;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_DLL;QT_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
<ClCompile>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<MinimalRebuild>false</MinimalRebuild>
<ControlFlowGuard>false</ControlFlowGuard>
<WholeProgramOptimization>true</WholeProgramOptimization>
+ <DisableSpecificWarnings>4714;4324;4127</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
QByteArray digest(const bool bAsHex = true) { return bAsHex ? finalize().toHex() : finalize(); }
protected:
- Hash(const char* key = NULL) {/*nothing to do*/};
+ Hash(const char* /*key*/ = NULL) {/*nothing to do*/};
virtual bool process(const quint8 *const data, const quint32 len) = 0;
virtual QByteArray finalize(void) = 0;
bool read(quint32 &command, quint32 &flags, QStringList ¶ms);
private:
- IPCChannel(const IPCChannel&) : p(NULL), m_appVersionNo(-1) { throw "Constructor is disabled!"; }
+ IPCChannel(const IPCChannel&) : p(NULL), m_appVersionNo((unsigned int)(-1)) { throw "Constructor is disabled!"; }
IPCChannel &operator=(const IPCChannel&) { throw "Assignment operator is disabled!"; return *this; }
const QString m_applicationId;
return bias;
}
- return 0;
+ // return 0;
}
-static int compare_left(nat_char const *a,nat_char const *b)
+static int compare_left(nat_char const *a, nat_char const *b)
{
/* Compare two left-aligned numbers: the first to have a
different value wins. */
return +1;
}
- return 0;
+ // return 0;
}
static int strnatcmp0(nat_char const *a, nat_char const *b, const bool fold_case)
///////////////////////////////////////////////////////////////////////////////
// Invalid parameters handler
-static void my_invalid_param_handler(const wchar_t* exp, const wchar_t* fun, const wchar_t* fil, unsigned int, uintptr_t)
+static void my_invalid_param_handler(const wchar_t* /*exp*/, const wchar_t* /*fun*/, const wchar_t* /*fil*/, unsigned int, uintptr_t)
{
MUtils::OS::fatal_exit(L"Invalid parameter handler invoked, application will exit!");
}
}
// Global exception handler
-static LONG WINAPI my_exception_handler(struct _EXCEPTION_POINTERS *ExceptionInfo)
+static LONG WINAPI my_exception_handler(struct _EXCEPTION_POINTERS* /*ExceptionInfo*/)
{
MUtils::OS::fatal_exit(L"Unhandeled exception handler invoked, application will exit!");
return LONG_MAX;
QString MUtils::make_unique_file(const QString &basePath, const QString &baseName, const QString &extension, const bool fancy, const bool placeholder)
{
- return make_unique_file(QDir(basePath), baseName, extension, fancy);
+ return make_unique_file(QDir(basePath), baseName, extension, fancy, placeholder);
}
QString MUtils::make_unique_file(const QDir &basePath, const QString &baseName, const QString &extension, const bool fancy, const bool placeholder)
if (placeholder && (!fileName.isEmpty()))
{
- QFile placeholder(fileName);
- if (placeholder.open(QIODevice::WriteOnly))
+ QFile placeholderFile(fileName);
+ if (placeholderFile.open(QIODevice::WriteOnly))
{
- placeholder.close();
+ placeholderFile.close();
}
}
}
progress_callback_data_t;
-static DWORD __stdcall copy_file_progress(LARGE_INTEGER TotalFileSize, LARGE_INTEGER TotalBytesTransferred, LARGE_INTEGER StreamSize, LARGE_INTEGER StreamBytesTransferred, DWORD dwStreamNumber, DWORD dwCallbackReason, HANDLE hSourceFile, HANDLE hDestinationFile, LPVOID lpData)
+static DWORD __stdcall copy_file_progress(LARGE_INTEGER TotalFileSize, LARGE_INTEGER TotalBytesTransferred, LARGE_INTEGER /*StreamSize*/, LARGE_INTEGER /*StreamBytesTransferred*/, DWORD /*dwStreamNumber*/, DWORD /*dwCallbackReason*/, HANDLE /*hSourceFile*/, HANDLE /*hDestinationFile*/, LPVOID lpData)
{
if(const progress_callback_data_t *data = (progress_callback_data_t*) lpData)
{
return true;;
}
- freeSpace = -1;
+ freeSpace = static_cast<quint64>(-1);
return false;
}
static MUtils::Internal::CriticalSection g_fatal_exit_lock;
static QAtomicInt g_fatal_exit_flag;
-static BOOL CALLBACK fatal_exit_enum_helper(const HWND hwnd, const LPARAM lParam)
+static BOOL CALLBACK fatal_exit_enum_helper(const HWND hwnd, const LPARAM /*lParam*/)
{
SetWindowPos(hwnd, HWND_NOTOPMOST, NULL, NULL, NULL, NULL, SWP_ASYNCWINDOWPOS | SWP_NOMOVE | SWP_NOSIZE);
return TRUE;
bool MUtils::Registry::RegistryKey::value_read(const QString &valueName, quint32 &value) const
{
value = 0;
- DWORD size = sizeof(quint32), type = -1;
+ DWORD size = sizeof(quint32), type = static_cast<DWORD>(-1);
CHECK_STATUS(KEY_READ);
return (RegQueryValueEx(p->m_hKey, valueName.isEmpty() ? NULL : MUTILS_WCHR(valueName), 0, &type, reinterpret_cast<BYTE*>(&value), &size) == ERROR_SUCCESS) && (type == REG_DWORD);
}
bool MUtils::Registry::RegistryKey::value_read(const QString &valueName, QString &value) const
{
value = QString();
- wchar_t buffer[2048]; DWORD size = sizeof(wchar_t) * 2048, type = -1;
+ wchar_t buffer[2048]; DWORD size = sizeof(wchar_t) * 2048, type = static_cast<DWORD>(-1);
CHECK_STATUS(KEY_READ);
if((RegQueryValueEx(p->m_hKey, valueName.isEmpty() ? NULL : MUTILS_WCHR(valueName), 0, &type, reinterpret_cast<BYTE*>(&(buffer[0])), &size) == ERROR_SUCCESS) && ((type == REG_SZ) || (type == REG_EXPAND_SZ)))
{
{
if(const unsigned char *data = get_sound_from_cache(name))
{
- return PlaySound(LPCWSTR(data), NULL, (SND_MEMORY | (bAsync ? SND_ASYNC : SND_SYNC))) != FALSE;
+ return PlaySoundW(LPCWSTR(data), NULL, (SND_MEMORY | (bAsync ? SND_ASYNC : SND_SYNC)));
}
}
bool MUtils::Sound::play_system_sound(const QString &alias, const bool &bAsync)
{
- return PlaySound(MUTILS_WCHR(alias), GetModuleHandle(NULL), (SND_ALIAS | (bAsync ? SND_ASYNC : SND_SYNC))) != FALSE;
+ if (!alias.isEmpty())
+ {
+ return PlaySoundW(MUTILS_WCHR(alias), NULL, (SND_ALIAS | (bAsync ? SND_ASYNC : SND_SYNC)));
+ }
+
+ return false;
}
bool MUtils::Sound::play_sound_file(const QString &library, const unsigned short uiSoundIdx, const bool &bAsync)
if(libraryFile.exists() && libraryFile.isFile())
{
- if(const HMODULE module = GetModuleHandleW(MUTILS_WCHR(QDir::toNativeSeparators(libraryFile.canonicalFilePath()))))
+ if(const HMODULE module = LoadLibraryW(MUTILS_WCHR(QDir::toNativeSeparators(libraryFile.canonicalFilePath()))))
{
- result = (PlaySound(MAKEINTRESOURCE(uiSoundIdx), module, (SND_RESOURCE | (bAsync ? SND_ASYNC : SND_SYNC))) != FALSE);
+ result = PlaySoundW(MAKEINTRESOURCE(uiSoundIdx), module, (SND_RESOURCE | (bAsync ? SND_ASYNC : SND_SYNC)));
+ FreeLibrary(module);
}
- else if(const HMODULE module = LoadLibraryW(MUTILS_WCHR(QDir::toNativeSeparators(libraryFile.canonicalFilePath()))))
+ else
{
- result = (PlaySound(MAKEINTRESOURCE(uiSoundIdx), module, (SND_RESOURCE | (bAsync ? SND_ASYNC : SND_SYNC))) != FALSE);
- FreeLibrary(module);
+ qWarning("PlaySound: File \"%s\" failed to load!", MUTILS_UTF8(libraryFile.absoluteFilePath()));
}
}
else
g_terminal_log_file.reset(new QFile(MUTILS_QSTR(logfile)));
if(g_terminal_log_file->open(QIODevice::WriteOnly))
{
- static const char MARKER[3] = { char(0xEF), char(0xBB), char(0xBF) };
+ static const char MARKER[3] = { '\xEF', '\xBB', '\xBF' };
g_terminal_log_file->write(MARKER, 3);
}
free(logfile);
return -1;
}
- list.swap(g_translation_data->keys());
+ list = g_translation_data->keys();
return list.count();
}