@@ -90,7 +90,7 @@ static bool inline isBrace(int ch) {
9090 return strchr (" []{}()" , ch) != NULL ;
9191}
9292
93- static std::string getRange (GUI::ScintillaWindow *sw, int start, int end) {
93+ static std::string getRange (GUI::ScintillaWindow *sw, intptr_t start, intptr_t end) {
9494 if (end <= start) return std::string ();
9595
9696 std::vector<char > buffer (end - start + 1 );
@@ -104,14 +104,14 @@ static std::string getRange(GUI::ScintillaWindow *sw, int start, int end) {
104104 return std::string (buffer.begin (), buffer.end () - 1 ); // don't copy the null
105105}
106106
107- static std::string getWordAt (GUI::ScintillaWindow *sw, int pos) {
108- int word_start = sw->Call (SCI_WORDSTARTPOSITION, pos, true );
109- int word_end = sw->Call (SCI_WORDENDPOSITION, pos, true );
107+ static std::string getWordAt (GUI::ScintillaWindow *sw, intptr_t pos) {
108+ intptr_t word_start = sw->Call (SCI_WORDSTARTPOSITION, pos, true );
109+ intptr_t word_end = sw->Call (SCI_WORDENDPOSITION, pos, true );
110110 return getRange (sw, word_start, word_end);
111111}
112112
113- static std::string getLuaIdentifierAt (GUI::ScintillaWindow *sw, int pos) {
114- const int line = sw->Call (SCI_LINEFROMPOSITION);
113+ static std::string getLuaIdentifierAt (GUI::ScintillaWindow *sw, intptr_t pos) {
114+ const intptr_t line = sw->Call (SCI_LINEFROMPOSITION);
115115
116116 Sci_TextToFind ttf = {
117117 {
@@ -317,29 +317,29 @@ bool LuaConsole::processNotification(const SCNotification *scn) {
317317}
318318
319319void LuaConsole::maintainIndentation () {
320- int curPos = m_sciInput->Call (SCI_GETCURRENTPOS);
321- int curLine = m_sciInput->Call (SCI_LINEFROMPOSITION, curPos);
322- int prevIndent = m_sciInput->Call (SCI_GETLINEINDENTATION, curLine - 1 );
320+ intptr_t curPos = m_sciInput->Call (SCI_GETCURRENTPOS);
321+ intptr_t curLine = m_sciInput->Call (SCI_LINEFROMPOSITION, curPos);
322+ intptr_t prevIndent = m_sciInput->Call (SCI_GETLINEINDENTATION, curLine - 1 );
323323 m_sciInput->Call (SCI_SETLINEINDENTATION, curLine, prevIndent);
324324 curPos = m_sciInput->Call (SCI_GETLINEINDENTPOSITION, curLine);
325325 m_sciInput->Call (SCI_SETEMPTYSELECTION, curPos);
326326}
327327
328328void LuaConsole::braceMatch () {
329- int curPos = m_sciInput->Call (SCI_GETCURRENTPOS);
330- int bracePos = INVALID_POSITION;
329+ intptr_t curPos = m_sciInput->Call (SCI_GETCURRENTPOS);
330+ intptr_t bracePos = INVALID_POSITION;
331331
332332 // Check on both sides
333- if (isBrace (m_sciInput->Call (SCI_GETCHARAT, curPos - 1 ))) {
333+ if (isBrace (static_cast < int >( m_sciInput->Call (SCI_GETCHARAT, curPos - 1 ) ))) {
334334 bracePos = curPos - 1 ;
335335 }
336- else if (isBrace (m_sciInput->Call (SCI_GETCHARAT, curPos))) {
336+ else if (isBrace (static_cast < int >( m_sciInput->Call (SCI_GETCHARAT, curPos) ))) {
337337 bracePos = curPos;
338338 }
339339
340340 // See if we are next to a brace
341341 if (bracePos != INVALID_POSITION) {
342- int otherPos = m_sciInput->Call (SCI_BRACEMATCH, bracePos, 0 );
342+ intptr_t otherPos = m_sciInput->Call (SCI_BRACEMATCH, bracePos, 0 );
343343 if (otherPos != INVALID_POSITION) {
344344 m_sciInput->Call (SCI_BRACEHIGHLIGHT, bracePos, otherPos);
345345 }
@@ -354,15 +354,15 @@ void LuaConsole::braceMatch() {
354354
355355void LuaConsole::showAutoCompletion () {
356356 std::string partialWord;
357- int curPos = m_sciInput->Call (SCI_GETCURRENTPOS);
358- int prevCh = m_sciInput->Call (SCI_GETCHARAT, curPos - 1 );
357+ intptr_t curPos = m_sciInput->Call (SCI_GETCURRENTPOS);
358+ int prevCh = static_cast < int >( m_sciInput->Call (SCI_GETCHARAT, curPos - 1 ) );
359359
360360 // The cursor could be at the end of a partial word e.g. editor.Sty|
361361 if (isalpha (prevCh) || prevCh == ' _' ) {
362362 partialWord = getWordAt (m_sciInput, curPos - 1 );
363363
364364 // Back up past the partial word
365- prevCh = m_sciInput->Call (SCI_GETCHARAT, curPos - 1 - partialWord.size ());
365+ prevCh = static_cast < int >( m_sciInput->Call (SCI_GETCHARAT, curPos - 1 - partialWord.size () ));
366366 curPos = curPos - static_cast <int >(partialWord.size ());
367367 }
368368
0 commit comments