@@ -558,7 +558,7 @@ void ScintillaWrapper::rereplace(boost::python::object searchExp, boost::python:
558558void ScintillaWrapper::pymlreplace (boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count, boost::python::object flags, boost::python::object startPosition, boost::python::object endPosition)
559559{
560560 boost::python::str contents;
561- int currentOffset = 0 ;
561+ idx_t currentOffset = 0 ;
562562
563563 if (startPosition.is_none () && endPosition.is_none ())
564564 {
@@ -586,9 +586,9 @@ void ScintillaWrapper::pymlreplace(boost::python::object searchExp, boost::pytho
586586 range.chrg .cpMax = GetLength ();
587587 }
588588
589- currentOffset = range.chrg .cpMin ;
589+ currentOffset = ( idx_t ) range.chrg .cpMin ;
590590
591- range.lpstrText = new char [( range.chrg .cpMax - range.chrg .cpMin ) + 1 ];
591+ range.lpstrText = new char [size_t (( range.chrg .cpMax - range.chrg .cpMin ) + 1 ) ];
592592 callScintilla (SCI_GETTEXTRANGE, 0 , reinterpret_cast <LPARAM>(&range));
593593 contents = boost::python::str (const_cast <const char *>(range.lpstrText ));
594594 delete[] range.lpstrText ;
@@ -704,12 +704,12 @@ void ScintillaWrapper::pyreplace(boost::python::object searchExp, boost::python:
704704 long lineCount = GetLineCount ();
705705 boost::python::object re = re_module.attr (" compile" )(searchExp, flags);
706706
707- int bufferLength = 0 ;
707+ size_t bufferLength = 0 ;
708708 Sci_TextRange range;
709709 range.chrg .cpMin = 0 ;
710710 range.lpstrText = NULL ;
711711 boost::python::tuple result;
712- int currentStartPosition;
712+ idx_t currentStartPosition;
713713 int infiniteLoopCheck = 0 ;
714714 int previousLine = -1 ;
715715 for (int line = start; line < lineCount && (ignoreCount || iCount > 0 ) && (-1 == end || line <= end); ++line)
@@ -739,11 +739,11 @@ void ScintillaWrapper::pyreplace(boost::python::object searchExp, boost::python:
739739 range.chrg .cpMin = PositionFromLine (line);
740740 range.chrg .cpMax = GetLineEndPosition (line);
741741
742- if (bufferLength < ((range.chrg .cpMax - range.chrg .cpMin ) + 1 ))
742+ if (bufferLength < (size_t )( (range.chrg .cpMax - range.chrg .cpMin ) + 1 ))
743743 {
744744 if (range.lpstrText )
745745 delete [] range.lpstrText ;
746- bufferLength = (range.chrg .cpMax - range.chrg .cpMin ) + 1 ;
746+ bufferLength = (size_t )(( range.chrg .cpMax - range.chrg .cpMin ) + 1 ) ;
747747 range.lpstrText = new char [bufferLength + 1 ];
748748 }
749749
@@ -758,12 +758,12 @@ void ScintillaWrapper::pyreplace(boost::python::object searchExp, boost::python:
758758 size_t resultLength = _len (result[0 ]);
759759 if (includeLineEndings)
760760 {
761- currentStartPosition = PositionFromLine (line);
761+ currentStartPosition = ( idx_t ) PositionFromLine (line);
762762 replaceWholeLine (line, result[0 ]);
763763 }
764764 else
765765 {
766- currentStartPosition = range.chrg .cpMin ;
766+ currentStartPosition = ( idx_t ) range.chrg .cpMin ;
767767 replaceLine (line, result[0 ]);
768768 }
769769
@@ -973,7 +973,7 @@ boost::python::str ScintillaWrapper::getWord(boost::python::object position, boo
973973 Sci_TextRange tr;
974974 tr.chrg .cpMin = startPos;
975975 tr.chrg .cpMax = endPos;
976- tr.lpstrText = new char [( endPos - startPos) + 1 ];
976+ tr.lpstrText = new char [size_t (( endPos - startPos) + 1 ) ];
977977 callScintilla (SCI_GETTEXTRANGE, 0 , reinterpret_cast <LPARAM>(&tr));
978978 boost::python::str retVal (const_cast <const char *>(tr.lpstrText ));
979979 delete[] tr.lpstrText ;
0 commit comments