From 0ae9877766a5bf262ec776d0876cedba659ff9b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20M=C3=BCller?= <27155134+arm-in@users.noreply.github.com> Date: Mon, 11 Jul 2022 02:10:05 +0530 Subject: [PATCH] Typos found by running "codespell" (#4260) --- cmake/compileroptions.cmake | 4 ++-- lib/programmemory.cpp | 4 ++-- lib/symboldatabase.h | 2 +- lib/valueflow.cpp | 6 +++--- tools/test_reduce.py | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmake/compileroptions.cmake b/cmake/compileroptions.cmake index f5d4281ee..6236e8261 100644 --- a/cmake/compileroptions.cmake +++ b/cmake/compileroptions.cmake @@ -147,7 +147,7 @@ if (MSVC) # C/C++ - Language add_compile_options(/Zc:rvalueCast) # Enforce type conversion rules - add_compile_options(/std:c++14) # C++ Langage Standard - ISO C++14 Standard + add_compile_options(/std:c++14) # C++ Language Standard - ISO C++14 Standard # C/C++ - Browse Information # Enable Browse Information - No @@ -184,7 +184,7 @@ if (MSVC) # Linker - System # Stack Reserve Size - 8000000 # Stack Commit Size - 8000000 - add_link_options(/LARGEADDRESSAWARE) # Enbale Large Addresses - Yes + add_link_options(/LARGEADDRESSAWARE) # Enable Large Addresses - Yes # Linker - Optimization add_link_options(/OPT:REF) # References - Yes diff --git a/lib/programmemory.cpp b/lib/programmemory.cpp index 55974f635..902bf3e9f 100644 --- a/lib/programmemory.cpp +++ b/lib/programmemory.cpp @@ -588,7 +588,7 @@ static ValueFlow::Value evaluate(const std::string& op, const ValueFlow::Value& // Only add, subtract, and compare for non-integers if (!compareOp && !contains({"+", "-"}, op) && !lhs.isIntValue() && !rhs.isIntValue()) return ValueFlow::Value::unknown(); - // Both cant be iterators for non-compare + // Both can't be iterators for non-compare if (!compareOp && lhs.isIteratorValue() && rhs.isIteratorValue()) return ValueFlow::Value::unknown(); // Symbolic values must be in the same ring @@ -1332,7 +1332,7 @@ static ValueFlow::Value executeImpl(const Token* expr, ProgramMemory& pm, const } } } - // Check if functon modifies argument + // Check if function modifies argument visitAstNodes(expr->astOperand2(), [&](const Token* child) { if (child->exprId() > 0 && pm.hasValue(child->exprId())) { ValueFlow::Value& v = pm.at(child->exprId()); diff --git a/lib/symboldatabase.h b/lib/symboldatabase.h index ec089f5df..793066a58 100644 --- a/lib/symboldatabase.h +++ b/lib/symboldatabase.h @@ -1362,7 +1362,7 @@ public: SymbolDatabase(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger); ~SymbolDatabase(); - /** @brief Information about all namespaces/classes/structrues */ + /** @brief Information about all namespaces/classes/structures */ std::list scopeList; /** @brief Fast access to function scopes */ diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index edc31e553..529bbdcb6 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -2436,10 +2436,10 @@ struct ValueFlowAnalyzer : Analyzer { Action read = Action::Read; const ValueFlow::Value* value = getValue(tok); if (value) { - // Moving a moved value wont change the moved value + // Moving a moved value won't change the moved value if (value->isMovedValue() && isMoveOrForward(tok) != ValueFlow::Value::MoveKind::NonMovedVariable) return read; - // Inserting elements to container wont change the lifetime + // Inserting elements to container won't change the lifetime if (astIsContainer(tok) && value->isLifetimeValue() && contains({Library::Container::Action::PUSH, Library::Container::Action::INSERT, @@ -6526,7 +6526,7 @@ static void valueFlowForLoopSimplify(Token* const bodyStart, ErrorLogger* errorLogger, const Settings* settings) { - // TODO: Refactor this to use arbitary expressions + // TODO: Refactor this to use arbitrary expressions assert(expr->varId() > 0); const Token * const bodyEnd = bodyStart->link(); diff --git a/tools/test_reduce.py b/tools/test_reduce.py index c58a6a2d4..6ea01d28d 100644 --- a/tools/test_reduce.py +++ b/tools/test_reduce.py @@ -74,7 +74,7 @@ def test_combinelines_chunk(): reduce = ReduceTestFail() - # need to have at least 11 lines ending with comma to enter chunked mode and twice as much for second interation + # need to have at least 11 lines ending with comma to enter chunked mode and twice as much for second iteration filedata = [ 'int i,\n', 'j,\n', @@ -106,7 +106,7 @@ def test_combinelines_chunk(): def test_combinelines_chunk_2(): - """'filedata' is not changed by the funtion since the data is assigned to a local variable""" + """'filedata' is not changed by the function since the data is assigned to a local variable""" reduce = ReduceTest()