From 6b5144d176978053b436799f87bc2fc633dabb1c Mon Sep 17 00:00:00 2001 From: Silent Date: Mon, 25 Jun 2018 01:02:08 +0200 Subject: [PATCH] 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 --- PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp | 9 +++++---- PowerEditor/visual.net/notepadPlus.vcxproj | 4 ---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp b/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp index e4d0e0e9..f788bf3e 100644 --- a/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp +++ b/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include "PluginsManager.h" #include "resource.h" @@ -536,7 +537,7 @@ void PluginsManager::runPluginCommand(size_t i) catch (...) { 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); } } @@ -596,7 +597,7 @@ void PluginsManager::notify(const SCNotification *notification) catch (...) { 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); pluginCrashAlert(_pluginInfos[i]->_moduleName.c_str(), funcInfo); } @@ -622,7 +623,7 @@ void PluginsManager::relayNppMessages(UINT Message, WPARAM wParam, LPARAM lParam catch (...) { 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); } } @@ -653,7 +654,7 @@ bool PluginsManager::relayPluginMessages(UINT Message, WPARAM wParam, LPARAM lPa catch (...) { 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); } return true; diff --git a/PowerEditor/visual.net/notepadPlus.vcxproj b/PowerEditor/visual.net/notepadPlus.vcxproj index 718935bd..be3d94cf 100755 --- a/PowerEditor/visual.net/notepadPlus.vcxproj +++ b/PowerEditor/visual.net/notepadPlus.vcxproj @@ -105,7 +105,6 @@ true false 4091;4456;4457;4459 - 18 /Zc:strictStrings %(AdditionalOptions) @@ -143,7 +142,6 @@ true false 4091;4456;4457;4459 - 18 /Zc:strictStrings %(AdditionalOptions) @@ -187,7 +185,6 @@ NoExtensions true 4091;4456;4457;4459 - 18 /Zc:strictStrings %(AdditionalOptions) @@ -239,7 +236,6 @@ copy ..\src\contextMenu.xml ..\bin\contextMenu.xml NoExtensions true 4091;4456;4457;4459 - 18 /Zc:strictStrings %(AdditionalOptions)