From 5a05631c84f091f742489ce84a3eaa9e7463a087 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20M=C3=BCller?= <27155134+arm-in@users.noreply.github.com> Date: Thu, 13 Jan 2022 17:24:26 +0100 Subject: [PATCH] Typos found by running "codespell" (#3702) --- lib/astutils.cpp | 2 +- lib/astutils.h | 2 +- lib/reverseanalyzer.cpp | 2 +- lib/valueflow.cpp | 2 +- test/testtokenize.cpp | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/astutils.cpp b/lib/astutils.cpp index b5da9227a..c33b5c6b0 100644 --- a/lib/astutils.cpp +++ b/lib/astutils.cpp @@ -746,7 +746,7 @@ bool precedes(const Token * tok1, const Token * tok2) } /// If tok1 comes after tok2 -bool succedes(const Token* tok1, const Token* tok2) +bool succeeds(const Token* tok1, const Token* tok2) { if (tok1 == tok2) return false; diff --git a/lib/astutils.h b/lib/astutils.h index 2a13a7386..4c390850a 100644 --- a/lib/astutils.h +++ b/lib/astutils.h @@ -151,7 +151,7 @@ bool extractForLoopValues(const Token *forToken, long long * const lastValue); bool precedes(const Token * tok1, const Token * tok2); -bool succedes(const Token* tok1, const Token* tok2); +bool succeeds(const Token* tok1, const Token* tok2); bool exprDependsOnThis(const Token* expr, bool onVar = true, nonneg int depth = 0); diff --git a/lib/reverseanalyzer.cpp b/lib/reverseanalyzer.cpp index 87e7f0355..7adfc7712 100644 --- a/lib/reverseanalyzer.cpp +++ b/lib/reverseanalyzer.cpp @@ -161,7 +161,7 @@ struct ReverseTraversal { if (start == end) return; std::size_t i = start->index(); - for (Token* tok = start->previous(); succedes(tok, end); tok = tok->previous()) { + for (Token* tok = start->previous(); succeeds(tok, end); tok = tok->previous()) { if (tok->index() >= i) throw InternalError(tok, "Cyclic reverse analysis."); i = tok->index(); diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index d1b76d118..436fac095 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -6786,7 +6786,7 @@ static void valueFlowUninit(TokenList* tokenlist, SymbolDatabase* /*symbolDataba for (const Variable& memVar : scope->varlist) { if (!memVar.isPublic()) continue; - // Skip array since we cant track partial initialization from nested subexpressions + // Skip array since we can't track partial initialization from nested subexpressions if (memVar.isArray()) continue; if (!needsInitialization(&memVar, tokenlist->isCPP())) { diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 7308d292c..fc929a033 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -2648,7 +2648,7 @@ private: } void simplifyStdType() { // #4947, #4950, #4951 - // usigned long long + // unsigned long long { const char code[] = "long long unsigned int x;"; const char expected[] = "unsigned long long x ;"; @@ -2710,7 +2710,7 @@ private: const char expected[] = "signed long long x ;"; ASSERT_EQUALS(expected, tokenizeAndStringify(code)); } - // usigned short + // unsigned short { const char code[] = "short unsigned int x;"; const char expected[] = "unsigned short x ;";