1 // Scintilla source code edit control
2 /** @file CharacterType.cxx
3 ** Tests for character type and case-insensitive comparisons.
5 // Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
6 // The License.txt file describes the conditions under which this software may be distributed.
11 #include "CharacterType.h"
13 using namespace Scintilla::Internal
;
15 namespace Scintilla::Internal
{
17 int CompareCaseInsensitive(const char *a
, const char *b
) noexcept
{
20 const char upperA
= MakeUpperCase(*a
);
21 const char upperB
= MakeUpperCase(*b
);
23 return upperA
- upperB
;
28 // Either *a or *b is nul
32 int CompareNCaseInsensitive(const char *a
, const char *b
, size_t len
) noexcept
{
33 while (*a
&& *b
&& len
) {
35 const char upperA
= MakeUpperCase(*a
);
36 const char upperB
= MakeUpperCase(*b
);
38 return upperA
- upperB
;
47 // Either *a or *b is nul