From a8a6f2c88196166d535abd3589f649fcc81b1a90 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Thu, 11 Jun 2015 17:41:07 +0200 Subject: [PATCH] - avoid some compiler warning - build also without SCI_OWNREGEX --- PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp | 2 +- scintilla/boostregex/BoostRegExSearch.cxx | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp b/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp index 9048cfae..ce0aebc9 100644 --- a/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp +++ b/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp @@ -417,7 +417,7 @@ void PluginsManager::notify(const SCNotification *notification) ::MessageBoxA(NULL, e.what(), "Exception", MB_OK); } catch (...) { TCHAR funcInfo[128]; - generic_sprintf(funcInfo, TEXT("notify(SCNotification *notification) : \r notification->nmhdr.code == %d\r notification->nmhdr.hwndFrom == %d\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 == %d"),\ scNotif.nmhdr.code, scNotif.nmhdr.hwndFrom, scNotif.nmhdr.idFrom); pluginCrashAlert(_pluginsCommands[i]._pluginName.c_str(), funcInfo); } diff --git a/scintilla/boostregex/BoostRegExSearch.cxx b/scintilla/boostregex/BoostRegExSearch.cxx index 19a41e7d..b2cf275e 100644 --- a/scintilla/boostregex/BoostRegExSearch.cxx +++ b/scintilla/boostregex/BoostRegExSearch.cxx @@ -241,10 +241,12 @@ namespace Scintilla { #endif +#ifdef SCI_OWNREGEX RegexSearchBase *CreateRegexSearch(CharClassify* /* charClassTable */) { return new BoostRegexSearch(); } +#endif #ifdef SCI_NAMESPACE } @@ -444,14 +446,14 @@ const char *BoostRegexSearch::SubstituteByPosition(Document* doc, const char *te template char *BoostRegexSearch::EncodingDependent::SubstituteByPosition(const char *text, int *length) { char *substituted = stringToCharPtr(_match.format((const CharT*)CharTPtr(text), boost::format_all)); - *length = strlen(substituted); + *length = static_cast(strlen(substituted)); return substituted; } wchar_t *BoostRegexSearch::utf8ToWchar(const char *utf8) { - int utf8Size = strlen(utf8); - int wcharSize = UTF16Length(utf8, utf8Size); + size_t utf8Size = strlen(utf8); + size_t wcharSize = UTF16Length(utf8, utf8Size); wchar_t *w = new wchar_t[wcharSize + 1]; UTF16FromUTF8(utf8, utf8Size, w, wcharSize + 1); w[wcharSize] = 0; @@ -460,7 +462,7 @@ wchar_t *BoostRegexSearch::utf8ToWchar(const char *utf8) char *BoostRegexSearch::wcharToUtf8(const wchar_t *w) { - int wcharSize = wcslen(w); + int wcharSize = static_cast(wcslen(w)); int charSize = UTF8Length(w, wcharSize); char *c = new char[charSize + 1]; UTF8FromUTF16(w, wcharSize, c, charSize);