summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang-tools-extra/clangd/FuzzyMatch.cpp4
-rw-r--r--clang-tools-extra/clangd/FuzzyMatch.h6
2 files changed, 5 insertions, 5 deletions
diff --git a/clang-tools-extra/clangd/FuzzyMatch.cpp b/clang-tools-extra/clangd/FuzzyMatch.cpp
index b010d420b26..cf680280e79 100644
--- a/clang-tools-extra/clangd/FuzzyMatch.cpp
+++ b/clang-tools-extra/clangd/FuzzyMatch.cpp
@@ -115,7 +115,7 @@ Optional<float> FuzzyMatcher::match(StringRef Word) {
// It's not obvious how to segment digits, we treat them as lowercase letters.
// As we don't decode UTF-8, we treat bytes over 127 as lowercase too.
// This means we require exact (case-sensitive) match.
-enum FuzzyMatcher::CharType : char {
+enum FuzzyMatcher::CharType : unsigned char {
Empty = 0, // Before-the-start and after-the-end (and control chars).
Lower = 1, // Lowercase letters, digits, and non-ASCII bytes.
Upper = 2, // Uppercase letters.
@@ -144,7 +144,7 @@ constexpr static uint8_t CharTypes[] = {
// e.g. XMLHttpRequest_Async
// +--+---+------ +----
// ^Head ^Tail ^Separator
-enum FuzzyMatcher::CharRole : char {
+enum FuzzyMatcher::CharRole : unsigned char {
Unknown = 0, // Stray control characters or impossible states.
Tail = 1, // Part of a word segment, but not the first character.
Head = 2, // The first character of a word segment.
diff --git a/clang-tools-extra/clangd/FuzzyMatch.h b/clang-tools-extra/clangd/FuzzyMatch.h
index 879419ed8be..283ce0ca600 100644
--- a/clang-tools-extra/clangd/FuzzyMatch.h
+++ b/clang-tools-extra/clangd/FuzzyMatch.h
@@ -43,9 +43,9 @@ public:
private:
// We truncate the pattern and the word to bound the cost of matching.
constexpr static int MaxPat = 63, MaxWord = 127;
- enum CharRole : char; // For segmentation.
- enum CharType : char; // For segmentation.
- enum Action { Miss = 0, Match = 1 };
+ enum CharRole : unsigned char; // For segmentation.
+ enum CharType : unsigned char; // For segmentation.
+ enum Action : unsigned char { Miss = 0, Match = 1 };
bool init(llvm::StringRef Word);
void buildGraph();
OpenPOWER on IntegriCloud