From 6dab6621ba486f986ea9efce26defee30e913a3e Mon Sep 17 00:00:00 2001 From: Markus Heidelberg Date: Fri, 3 Jul 2015 00:25:38 +0200 Subject: [PATCH] Make Scintilla build properly with GCC/MinGW Fix GCC compile error: extra qualification 'WordList::' on member 'SetWordAt' [-fpermissive] Fix GCC compile error: a storage class can only be specified for objects and functions Fix GCC compile error with invalid usage of conditional operator Invoke the "afterthought" part of the for loop in the normal code at the end of the loop where proper conditions can be used. Error message: third operand to the conditional operator is of type 'void', but the second operand is neither a throw-expression nor of type 'void' closes #1656 closes #1655 --- scintilla/lexers/LexSearchResult.cxx | 2 +- scintilla/lexers/LexUser.cxx | 9 ++++++++- scintilla/lexlib/WordList.h | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/scintilla/lexers/LexSearchResult.cxx b/scintilla/lexers/LexSearchResult.cxx index db4dca70..cfb76608 100644 --- a/scintilla/lexers/LexSearchResult.cxx +++ b/scintilla/lexers/LexSearchResult.cxx @@ -40,7 +40,7 @@ #include "LexerModule.h" // The following definitions are a copy of the ones in FindReplaceDlg.h -static enum { searchHeaderLevel = SC_FOLDLEVELBASE + 1, fileHeaderLevel, resultLevel }; +enum { searchHeaderLevel = SC_FOLDLEVELBASE + 1, fileHeaderLevel, resultLevel }; static inline bool AtEOL(Accessor &styler, unsigned int i) { diff --git a/scintilla/lexers/LexUser.cxx b/scintilla/lexers/LexUser.cxx index 609cb0a2..297cac99 100644 --- a/scintilla/lexers/LexUser.cxx +++ b/scintilla/lexers/LexUser.cxx @@ -1654,7 +1654,7 @@ static void ColouriseUserDoc(unsigned int startPos, int length, int initStyle, W levelNext = levelCurrent; StyleContext sc(startPos, length, initStyle, styler); - for (; finished; dontMove?true:sc.Forward()) + for (; finished; ) { dontMove = false; checkEOL = EOL_DEFAULT_VALUE; @@ -1893,7 +1893,11 @@ static void ColouriseUserDoc(unsigned int startPos, int length, int initStyle, W { int length = iter->length(); if (length == 0) + { + if (!dontMove) + sc.Forward(); continue; + } lineContinuation = true; for (int i=0; i