diff --git a/src/tools/clangbackend/source/tokenprocessor.h b/src/tools/clangbackend/source/tokenprocessor.h index 48cd9478a88..cfa7057d2c2 100644 --- a/src/tools/clangbackend/source/tokenprocessor.h +++ b/src/tools/clangbackend/source/tokenprocessor.h @@ -37,8 +37,6 @@ namespace ClangBackEnd { -using uint = unsigned int; - template class TokenProcessor { @@ -54,7 +52,7 @@ public: TokenProcessor(CXTranslationUnit cxTranslationUnit, const SourceRange &range) : cxTranslationUnit(cxTranslationUnit) { - uint cxTokensCount = 0; + unsigned cxTokensCount = 0; clang_tokenize(cxTranslationUnit, range, &cxTokens, &cxTokensCount); cxCursors.resize(cxTokensCount); clang_annotateTokens(cxTranslationUnit, cxTokens, cxTokensCount, cxCursors.data()); @@ -72,7 +70,7 @@ public: { return cxTokens == nullptr; } - uint size() const + size_t size() const { return cxCursors.size(); } diff --git a/src/tools/clangbackend/source/tokenprocessoriterator.h b/src/tools/clangbackend/source/tokenprocessoriterator.h index b12a28ded51..63f9a17847f 100644 --- a/src/tools/clangbackend/source/tokenprocessoriterator.h +++ b/src/tools/clangbackend/source/tokenprocessoriterator.h @@ -34,8 +34,6 @@ namespace ClangBackEnd { -using uint = unsigned int; - class DiagnosticSet; class Diagnostic; diff --git a/tests/unit/unittest/clientserverinprocess-test.cpp b/tests/unit/unittest/clientserverinprocess-test.cpp index 86d03b8e100..1b0743c558d 100644 --- a/tests/unit/unittest/clientserverinprocess-test.cpp +++ b/tests/unit/unittest/clientserverinprocess-test.cpp @@ -227,7 +227,9 @@ TEST_F(ClientServerInProcess, UpdateVisibleTranslationUnitsMessage) TEST_F(ClientServerInProcess, SendDocumentAnnotationsChangedMessage) { - ClangBackEnd::TokenInfoContainer tokenInfo(1, 1, 1, {ClangBackEnd::HighlightingType::Keyword, {}}); + ClangBackEnd::HighlightingTypes types; + types.mainHighlightingType = ClangBackEnd::HighlightingType::Keyword; + ClangBackEnd::TokenInfoContainer tokenInfo(1, 1, 1, types); ClangBackEnd::DiagnosticContainer diagnostic(Utf8StringLiteral("don't do that"), Utf8StringLiteral("warning"), {Utf8StringLiteral("-Wpadded"), Utf8StringLiteral("-Wno-padded")}, diff --git a/tests/unit/unittest/highlightingresultreporter-test.cpp b/tests/unit/unittest/highlightingresultreporter-test.cpp index e83a51ca23d..906b334d166 100644 --- a/tests/unit/unittest/highlightingresultreporter-test.cpp +++ b/tests/unit/unittest/highlightingresultreporter-test.cpp @@ -82,7 +82,9 @@ QVector generateTokenInfos(uint count) for (uint i = 0; i < count; ++i) { const uint line = i + 1; - container.append(TokenInfoContainer(line, 1, 1, {HighlightingType::Type, {}})); + ClangBackEnd::HighlightingTypes types; + types.mainHighlightingType = ClangBackEnd::HighlightingType::Type; + container.append(TokenInfoContainer(line, 1, 1, types)); } return container; @@ -155,10 +157,12 @@ TEST_F(HighlightingResultReporter, ReportSingleChunkAndRest) TEST_F(HighlightingResultReporter, ReportCompleteLines) { + ClangBackEnd::HighlightingTypes types; + types.mainHighlightingType = ClangBackEnd::HighlightingType::Type; QVector tokenInfos { - TokenInfoContainer(1, 1, 1, {HighlightingType::Type, {}}), - TokenInfoContainer(1, 2, 1, {HighlightingType::Type, {}}), - TokenInfoContainer(2, 1, 1, {HighlightingType::Type, {}}), + TokenInfoContainer(1, 1, 1, types), + TokenInfoContainer(1, 2, 1, types), + TokenInfoContainer(2, 1, 1, types), }; auto reporter = new ClangCodeModel::HighlightingResultReporter(tokenInfos); reporter->setChunkSize(1); diff --git a/tests/unit/unittest/readandwritemessageblock-test.cpp b/tests/unit/unittest/readandwritemessageblock-test.cpp index 35c09bf0653..dcb9867e43b 100644 --- a/tests/unit/unittest/readandwritemessageblock-test.cpp +++ b/tests/unit/unittest/readandwritemessageblock-test.cpp @@ -232,7 +232,9 @@ TEST_F(ReadAndWriteMessageBlock, CompareDocumentAnnotationsChangedMessage) {}, {}); - ClangBackEnd::TokenInfoContainer tokenInfo(1, 1, 1, {ClangBackEnd::HighlightingType::Keyword, {}}); + ClangBackEnd::HighlightingTypes types; + types.mainHighlightingType = ClangBackEnd::HighlightingType::Keyword; + ClangBackEnd::TokenInfoContainer tokenInfo(1, 1, 1, types); CompareMessage(ClangBackEnd::DocumentAnnotationsChangedMessage(fileContainer, {diagnostic},