Skip to content

Commit 97316c7

Browse files
committed
- fix cast warnings
- remove some whitespaces
1 parent 72aaf66 commit 97316c7

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

PythonScript/src/Match.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ boost::python::tuple Match::py_span_name(boost::python::str groupName)
118118

119119
int Match::py_lastindex()
120120
{
121-
int lastGroup = groupCount() - 1;
121+
int lastGroup = static_cast<int>(groupCount() - 1);
122122
while(lastGroup > 0 && !group(lastGroup)->matched())
123123
--lastGroup;
124124

@@ -131,7 +131,7 @@ boost::python::tuple Match::py_groups()
131131
PyObject* groupsTuple = PyTuple_New(size - 1);
132132
for(size_t index = 1; index < size; ++index)
133133
{
134-
boost::python::str groupContent = py_group_number(index);
134+
boost::python::str groupContent = py_group_number(static_cast<int>(index));
135135
// PyTuple_SetItem steals a reference, but because it's a boost::python::object, it'll be Py_DECREF'd by the next iteration
136136
Py_INCREF(groupContent.ptr());
137137
PyTuple_SetItem(groupsTuple, index - 1, groupContent.ptr());

PythonScript/src/ScintillaWrapper.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ void ScintillaWrapper::replaceImpl(boost::python::object searchStr, boost::pytho
839839
if (isPythonReplaceFunction)
840840
{
841841
m_pythonReplaceFunction = replaceStr;
842-
replacer.startReplace(text, length, startPosition, maxCount, searchChars.c_str(), &ScintillaWrapper::convertWithPython, reinterpret_cast<void*>(this), flags, replacements);
842+
replacer.startReplace(text, length, startPosition, maxCount, searchChars.c_str(), &ScintillaWrapper::convertWithPython, reinterpret_cast<void*>(this), flags, replacements);
843843
}
844844
else
845845
{
@@ -979,16 +979,14 @@ void ScintillaWrapper::searchImpl(boost::python::object searchStr,
979979
{
980980
NppPythonScript::Replacer<NppPythonScript::Utf8CharTraits> replacer;
981981

982-
replacer.search(text, length, startPosition, maxCount, searchChars.c_str(), &ScintillaWrapper::searchPythonHandler, reinterpret_cast<void*>(this), flags);
982+
replacer.search(text, length, startPosition, maxCount, searchChars.c_str(), &ScintillaWrapper::searchPythonHandler, reinterpret_cast<void*>(this), flags);
983983
}
984984
else
985985
{
986986
NppPythonScript::Replacer<NppPythonScript::AnsiCharTraits> replacer;
987987

988-
replacer.search(text, length, startPosition, maxCount, searchChars.c_str(), &ScintillaWrapper::searchPythonHandler, reinterpret_cast<void*>(this), flags);
988+
replacer.search(text, length, startPosition, maxCount, searchChars.c_str(), &ScintillaWrapper::searchPythonHandler, reinterpret_cast<void*>(this), flags);
989989
}
990-
991-
992990
}
993991

994992

@@ -1034,7 +1032,6 @@ void ScintillaWrapper::notAllowedInCallback(const char *message)
10341032
{
10351033
throw NotAllowedInCallbackException(message);
10361034
}
1037-
10381035
}
10391036

10401037
void ScintillaWrapper::swapColours()

0 commit comments

Comments
 (0)