1 // Scintilla source code edit control
2 /** @file CharacterSet.cxx
3 ** Simple case functions for ASCII.
4 ** Lexer infrastructure.
6 // Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
7 // The License.txt file describes the conditions under which this software may be distributed.
12 #include "CharacterSet.h"
14 using namespace Scintilla
;
18 int CompareCaseInsensitive(const char *a
, const char *b
) {
21 const char upperA
= static_cast<char>(MakeUpperCase(*a
));
22 const char upperB
= static_cast<char>(MakeUpperCase(*b
));
24 return upperA
- upperB
;
29 // Either *a or *b is nul
33 int CompareNCaseInsensitive(const char *a
, const char *b
, size_t len
) {
34 while (*a
&& *b
&& len
) {
36 const char upperA
= static_cast<char>(MakeUpperCase(*a
));
37 const char upperB
= static_cast<char>(MakeUpperCase(*b
));
39 return upperA
- upperB
;
48 // Either *a or *b is nul