diff options
author | nyamatongwe <unknown> | 2003-08-21 13:46:16 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2003-08-21 13:46:16 +0000 |
commit | 1d0250090472bfe01376fcf5bc4b52db4e8d296f (patch) | |
tree | 25342fc30012b5dd734f0c7485ec3002c10011e5 /src | |
parent | 76125caf39729e00673d95bfde9bfa2627262e76 (diff) | |
download | scintilla-mirror-1d0250090472bfe01376fcf5bc4b52db4e8d296f.tar.gz |
Wrote function for upper casing strings as strupr was not available on Linux.
Diffstat (limited to 'src')
-rw-r--r-- | src/LexCLW.cxx | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/LexCLW.cxx b/src/LexCLW.cxx index cfcf52e35..e5240776c 100644 --- a/src/LexCLW.cxx +++ b/src/LexCLW.cxx @@ -20,6 +20,20 @@ #include "Scintilla.h" #include "SciLexer.h" +static char MakeUpperCase(char ch) { + if (ch < 'a' || ch > 'z') + return ch; + else + return static_cast<char>(ch - 'a' + 'A'); +} + +static void MakeUpperCaseString(char *s) { + while (*s) { + *s = MakeUpperCase(*s); + s++; + } +} + // Is a label start character inline bool IsALabelStart(const int iChar) { return(isalpha(iChar) || iChar == '_'); @@ -142,7 +156,7 @@ static void ColouriseClwDoc(unsigned int uiStartPos, int iLength, int iInitStyle scDoc.GetCurrent(cLabel,sizeof(cLabel)); // If case insensitive, convert string to UPPERCASE to match passed keywords. if (!bCaseSensitive) { - strupr(cLabel); + MakeUpperCaseString(cLabel); } // If label string is in the Clarion reserved keyword list if (wlReservedWords.InList(cLabel)){ @@ -170,7 +184,7 @@ static void ColouriseClwDoc(unsigned int uiStartPos, int iLength, int iInitStyle scDoc.GetCurrent(cEquate,sizeof(cEquate)); // If case insensitive, convert string to UPPERCASE to match passed keywords. if (!bCaseSensitive) { - strupr(cEquate); + MakeUpperCaseString(cEquate); } // If statement string is in the equate list if (wlStandardEquates.InList(cEquate)) { @@ -185,7 +199,7 @@ static void ColouriseClwDoc(unsigned int uiStartPos, int iLength, int iInitStyle scDoc.GetCurrent(cStatement,sizeof(cStatement)); // If case insensitive, convert string to UPPERCASE to match passed keywords. if (!bCaseSensitive) { - strupr(cStatement); + MakeUpperCaseString(cStatement); } // If statement string is in the Clarion keyword list if (wlClarionKeywords.InList(cStatement)) { |