- avoid some compiler warning

- build also without SCI_OWNREGEX
This commit is contained in:
Christian Grasser 2015-06-11 17:41:07 +02:00
parent fdd2dbc21f
commit a8a6f2c881
2 changed files with 7 additions and 5 deletions

View File

@ -417,7 +417,7 @@ void PluginsManager::notify(const SCNotification *notification)
::MessageBoxA(NULL, e.what(), "Exception", MB_OK); ::MessageBoxA(NULL, e.what(), "Exception", MB_OK);
} catch (...) { } catch (...) {
TCHAR funcInfo[128]; 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); scNotif.nmhdr.code, scNotif.nmhdr.hwndFrom, scNotif.nmhdr.idFrom);
pluginCrashAlert(_pluginsCommands[i]._pluginName.c_str(), funcInfo); pluginCrashAlert(_pluginsCommands[i]._pluginName.c_str(), funcInfo);
} }

View File

@ -241,10 +241,12 @@ namespace Scintilla
{ {
#endif #endif
#ifdef SCI_OWNREGEX
RegexSearchBase *CreateRegexSearch(CharClassify* /* charClassTable */) RegexSearchBase *CreateRegexSearch(CharClassify* /* charClassTable */)
{ {
return new BoostRegexSearch(); return new BoostRegexSearch();
} }
#endif
#ifdef SCI_NAMESPACE #ifdef SCI_NAMESPACE
} }
@ -444,14 +446,14 @@ const char *BoostRegexSearch::SubstituteByPosition(Document* doc, const char *te
template <class CharT, class CharacterIterator> template <class CharT, class CharacterIterator>
char *BoostRegexSearch::EncodingDependent<CharT, CharacterIterator>::SubstituteByPosition(const char *text, int *length) { char *BoostRegexSearch::EncodingDependent<CharT, CharacterIterator>::SubstituteByPosition(const char *text, int *length) {
char *substituted = stringToCharPtr(_match.format((const CharT*)CharTPtr(text), boost::format_all)); char *substituted = stringToCharPtr(_match.format((const CharT*)CharTPtr(text), boost::format_all));
*length = strlen(substituted); *length = static_cast<int>(strlen(substituted));
return substituted; return substituted;
} }
wchar_t *BoostRegexSearch::utf8ToWchar(const char *utf8) wchar_t *BoostRegexSearch::utf8ToWchar(const char *utf8)
{ {
int utf8Size = strlen(utf8); size_t utf8Size = strlen(utf8);
int wcharSize = UTF16Length(utf8, utf8Size); size_t wcharSize = UTF16Length(utf8, utf8Size);
wchar_t *w = new wchar_t[wcharSize + 1]; wchar_t *w = new wchar_t[wcharSize + 1];
UTF16FromUTF8(utf8, utf8Size, w, wcharSize + 1); UTF16FromUTF8(utf8, utf8Size, w, wcharSize + 1);
w[wcharSize] = 0; w[wcharSize] = 0;
@ -460,7 +462,7 @@ wchar_t *BoostRegexSearch::utf8ToWchar(const char *utf8)
char *BoostRegexSearch::wcharToUtf8(const wchar_t *w) char *BoostRegexSearch::wcharToUtf8(const wchar_t *w)
{ {
int wcharSize = wcslen(w); int wcharSize = static_cast<int>(wcslen(w));
int charSize = UTF8Length(w, wcharSize); int charSize = UTF8Length(w, wcharSize);
char *c = new char[charSize + 1]; char *c = new char[charSize + 1];
UTF8FromUTF16(w, wcharSize, c, charSize); UTF8FromUTF16(w, wcharSize, c, charSize);