Fix format specifier warnings - /Wv:18 can now be removed

As a follow up to my previous pull request, this PR fixes the last remaining improper format specifiers. This allows to remove /Wv:18 compilation flag completely, since (presumably) the only reason it was added in the first place were those format specifier warnings, introduced in VS2015.

Effectively, all this PR does is applying fixes suggested by the compiler (included in those warnings).

Close #4604
This commit is contained in:
Silent 2018-06-25 01:02:08 +02:00 committed by Don HO
parent 587d3494c7
commit 6b5144d176
2 changed files with 5 additions and 8 deletions

View File

@ -29,6 +29,7 @@
#include <shlwapi.h> #include <shlwapi.h>
#include <DbgHelp.h> #include <DbgHelp.h>
#include <algorithm> #include <algorithm>
#include <cinttypes>
#include "PluginsManager.h" #include "PluginsManager.h"
#include "resource.h" #include "resource.h"
@ -536,7 +537,7 @@ void PluginsManager::runPluginCommand(size_t i)
catch (...) catch (...)
{ {
TCHAR funcInfo[128]; TCHAR funcInfo[128];
generic_sprintf(funcInfo, TEXT("runPluginCommand(size_t i : %d)"), i); generic_sprintf(funcInfo, TEXT("runPluginCommand(size_t i : %zd)"), i);
pluginCrashAlert(_pluginsCommands[i]._pluginName.c_str(), funcInfo); pluginCrashAlert(_pluginsCommands[i]._pluginName.c_str(), funcInfo);
} }
} }
@ -596,7 +597,7 @@ void PluginsManager::notify(const SCNotification *notification)
catch (...) catch (...)
{ {
TCHAR funcInfo[256]; TCHAR funcInfo[256];
generic_sprintf(funcInfo, TEXT("notify(SCNotification *notification) : \r notification->nmhdr.code == %d\r notification->nmhdr.hwndFrom == %p\r notification->nmhdr.idFrom == %d"),\ generic_sprintf(funcInfo, TEXT("notify(SCNotification *notification) : \r notification->nmhdr.code == %d\r notification->nmhdr.hwndFrom == %p\r notification->nmhdr.idFrom == %" PRIuPTR),\
scNotif.nmhdr.code, scNotif.nmhdr.hwndFrom, scNotif.nmhdr.idFrom); scNotif.nmhdr.code, scNotif.nmhdr.hwndFrom, scNotif.nmhdr.idFrom);
pluginCrashAlert(_pluginInfos[i]->_moduleName.c_str(), funcInfo); pluginCrashAlert(_pluginInfos[i]->_moduleName.c_str(), funcInfo);
} }
@ -622,7 +623,7 @@ void PluginsManager::relayNppMessages(UINT Message, WPARAM wParam, LPARAM lParam
catch (...) catch (...)
{ {
TCHAR funcInfo[128]; TCHAR funcInfo[128];
generic_sprintf(funcInfo, TEXT("relayNppMessages(UINT Message : %d, WPARAM wParam : %d, LPARAM lParam : %d)"), Message, wParam, lParam); generic_sprintf(funcInfo, TEXT("relayNppMessages(UINT Message : %u, WPARAM wParam : %" PRIuPTR ", LPARAM lParam : %" PRIiPTR ")"), Message, wParam, lParam);
pluginCrashAlert(_pluginInfos[i]->_moduleName.c_str(), funcInfo); pluginCrashAlert(_pluginInfos[i]->_moduleName.c_str(), funcInfo);
} }
} }
@ -653,7 +654,7 @@ bool PluginsManager::relayPluginMessages(UINT Message, WPARAM wParam, LPARAM lPa
catch (...) catch (...)
{ {
TCHAR funcInfo[128]; TCHAR funcInfo[128];
generic_sprintf(funcInfo, TEXT("relayPluginMessages(UINT Message : %d, WPARAM wParam : %d, LPARAM lParam : %d)"), Message, wParam, lParam); generic_sprintf(funcInfo, TEXT("relayPluginMessages(UINT Message : %u, WPARAM wParam : %" PRIuPTR ", LPARAM lParam : %" PRIiPTR ")"), Message, wParam, lParam);
pluginCrashAlert(_pluginInfos[i]->_moduleName.c_str(), funcInfo); pluginCrashAlert(_pluginInfos[i]->_moduleName.c_str(), funcInfo);
} }
return true; return true;

View File

@ -105,7 +105,6 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<SmallerTypeCheck>false</SmallerTypeCheck> <SmallerTypeCheck>false</SmallerTypeCheck>
<DisableSpecificWarnings>4091;4456;4457;4459</DisableSpecificWarnings> <DisableSpecificWarnings>4091;4456;4457;4459</DisableSpecificWarnings>
<WarningVersion>18</WarningVersion>
<AdditionalOptions>/Zc:strictStrings %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:strictStrings %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<Link> <Link>
@ -143,7 +142,6 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<SmallerTypeCheck>false</SmallerTypeCheck> <SmallerTypeCheck>false</SmallerTypeCheck>
<DisableSpecificWarnings>4091;4456;4457;4459</DisableSpecificWarnings> <DisableSpecificWarnings>4091;4456;4457;4459</DisableSpecificWarnings>
<WarningVersion>18</WarningVersion>
<AdditionalOptions>/Zc:strictStrings %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:strictStrings %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<Link> <Link>
@ -187,7 +185,6 @@
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet> <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<DisableSpecificWarnings>4091;4456;4457;4459</DisableSpecificWarnings> <DisableSpecificWarnings>4091;4456;4457;4459</DisableSpecificWarnings>
<WarningVersion>18</WarningVersion>
<AdditionalOptions>/Zc:strictStrings %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:strictStrings %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<Link> <Link>
@ -239,7 +236,6 @@ copy ..\src\contextMenu.xml ..\bin\contextMenu.xml
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet> <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<DisableSpecificWarnings>4091;4456;4457;4459</DisableSpecificWarnings> <DisableSpecificWarnings>4091;4456;4457;4459</DisableSpecificWarnings>
<WarningVersion>18</WarningVersion>
<AdditionalOptions>/Zc:strictStrings %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:strictStrings %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<Link> <Link>