From 451123beea2056a16514f703b0230c776717083e Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Tue, 13 Jun 2017 15:46:32 +0200 Subject: [PATCH] Clang: Clean up keyword highlighting Change-Id: I8c2737718282d047e487b8ed82a40dc256d39ce5 Reviewed-by: Ivan Donchevskii Reviewed-by: Nikolai Kosjar --- .../ipcsource/highlightingmark.cpp | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/tools/clangbackend/ipcsource/highlightingmark.cpp b/src/tools/clangbackend/ipcsource/highlightingmark.cpp index e1574b5ed66..6dcf82c6623 100644 --- a/src/tools/clangbackend/ipcsource/highlightingmark.cpp +++ b/src/tools/clangbackend/ipcsource/highlightingmark.cpp @@ -393,20 +393,19 @@ static HighlightingType highlightingTypeForKeyword(CXTranslationUnit cxTranslati } const ClangString spelling = clang_getTokenSpelling(cxTranslationUnit, *cxToken); - const char *c = spelling.cString(); - if (std::strcmp(c, "bool") == 0 - || std::strcmp(c, "char") == 0 - || std::strcmp(c, "char16_t") == 0 - || std::strcmp(c, "char32_t") == 0 - || std::strcmp(c, "double") == 0 - || std::strcmp(c, "float") == 0 - || std::strcmp(c, "int") == 0 - || std::strcmp(c, "long") == 0 - || std::strcmp(c, "short") == 0 - || std::strcmp(c, "signed") == 0 - || std::strcmp(c, "unsigned") == 0 - || std::strcmp(c, "void") == 0 - || std::strcmp(c, "wchar_t") == 0) { + if (spelling == "bool" + || spelling == "char" + || spelling == "char16_t" + || spelling == "char32_t" + || spelling == "double" + || spelling == "float" + || spelling == "int" + || spelling == "long" + || spelling == "short" + || spelling == "signed" + || spelling == "unsigned" + || spelling == "void" + || spelling == "wchar_t") { return HighlightingType::PrimitiveType; }