aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2012-07-02 15:36:58 +1000
committernyamatongwe <devnull@localhost>2012-07-02 15:36:58 +1000
commit6b9b5417ab7876c2320d6268fb8fff9e3127f3cf (patch)
tree20bc02995478327bb91890c9d238ad5771e5b725
parentfd7091be8a473a8e791861ac47eb46b6ece1b635 (diff)
downloadscintilla-mirror-6b9b5417ab7876c2320d6268fb8fff9e3127f3cf.tar.gz
Make IsLowerCase and IsUpperCase not depend on non-portable isascii, take
an int argument to match similar calls, and move to header for wider use.
-rw-r--r--lexlib/CharacterSet.h8
-rw-r--r--src/Document.cxx8
2 files changed, 8 insertions, 8 deletions
diff --git a/lexlib/CharacterSet.h b/lexlib/CharacterSet.h
index 23b5d68ea..a4234b5cc 100644
--- a/lexlib/CharacterSet.h
+++ b/lexlib/CharacterSet.h
@@ -93,6 +93,14 @@ inline bool IsASCII(int ch) {
return (ch >= 0) && (ch < 0x80);
}
+inline bool IsLowerCase(int ch) {
+ return (ch >= 'a') && (ch <= 'z');
+}
+
+inline bool IsUpperCase(int ch) {
+ return (ch >= 'A') && (ch <= 'Z');
+}
+
inline bool IsAlphaNumeric(int ch) {
return
((ch >= '0') && (ch <= '9')) ||
diff --git a/src/Document.cxx b/src/Document.cxx
index 72c931b95..00ae1dbb8 100644
--- a/src/Document.cxx
+++ b/src/Document.cxx
@@ -48,14 +48,6 @@ static inline bool IsADigit(char ch) {
return isascii(ch) && isdigit(ch);
}
-static inline bool IsLowerCase(char ch) {
- return isascii(ch) && islower(ch);
-}
-
-static inline bool IsUpperCase(char ch) {
- return isascii(ch) && isupper(ch);
-}
-
void LexInterface::Colourise(int start, int end) {
if (pdoc && instance && !performingStyle) {
// Protect against reentrance, which may occur, for example, when