diff --git a/addons/misra.py b/addons/misra.py index b78c02302..d57f690a9 100755 --- a/addons/misra.py +++ b/addons/misra.py @@ -524,7 +524,7 @@ def generateTable(): def remove_file_prefix(file_path, prefix): """ Remove a file path prefix from a give path. leftover - directory seperators at the beginning of a file + directory separators at the beginning of a file after the removal are also stripped. Example: @@ -537,7 +537,7 @@ def remove_file_prefix(file_path, prefix): result = None if file_path.startswith(prefix): result = file_path[len(prefix):] - # Remove any leftover directory seperators at the + # Remove any leftover directory separators at the # beginning result = result.lstrip('\\/') else: @@ -565,7 +565,7 @@ class MisraChecker: # Dictionary of dictionaries for rules to suppress # Dict1 is keyed by rule number in the hundreds format of # Major * 100 + minor. ie Rule 5.2 = (5*100) + 2 - # Dict 2 is keyed by filename. An entry of None means suppress globaly. + # Dict 2 is keyed by filename. An entry of None means suppress globally. # Each file name entry contails a list of tuples of (lineNumber, symbolName) # or an item of None which indicates suppress rule for the entire file. # The line and symbol name tuple may have None as either of its elements but @@ -1882,7 +1882,7 @@ class MisraChecker: def setFilePrefix(self, prefix): """ Set the file prefix to ignnore from files when matching - supression files + suppression files """ self.filePrefix = prefix @@ -2179,7 +2179,7 @@ else: print('Not expected: ' + actual) exitCode = 1 - # Exisitng behavior of verify mode is to exit + # Existing behavior of verify mode is to exit # on the first un-expected output. # TODO: Is this required? or can it be moved to after # all input files have been processed diff --git a/addons/namingng.py b/addons/namingng.py index 3b89ac673..2fc605657 100755 --- a/addons/namingng.py +++ b/addons/namingng.py @@ -19,7 +19,7 @@ # "uint32_t": "ui32"} # } # -# RE_VARNAME, RE_PRIVATE_MEMBER_VARIABE and RE_FUNCTIONNAME are regular expressions to cover hte basic names +# RE_VARNAME, RE_PRIVATE_MEMBER_VARIABE and RE_FUNCTIONNAME are regular expressions to cover the basic names # In var_prefixes and function_prefixes there are the variable-type/prefix pairs import cppcheckdata diff --git a/cfg/zlib.cfg b/cfg/zlib.cfg index 33a33c13b..ad46f9c6f 100644 --- a/cfg/zlib.cfg +++ b/cfg/zlib.cfg @@ -1,6 +1,6 @@ - + diff --git a/cmake/options.cmake b/cmake/options.cmake index 53f06a66e..3c96ca811 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -23,7 +23,7 @@ option(ANALYZE_DATAFLOW "Clang dynamic analyzer: general dynamic dataflow an option(WARNINGS_ARE_ERRORS "Treat warnings as errors" OFF) option(WARNINGS_ANSI_ISO "Issue all the mandatory diagnostics Listed in C standard" ON) -set(USE_MATCHCOMPILER "Auto" CACHE STRING "Usage of match compliler") +set(USE_MATCHCOMPILER "Auto" CACHE STRING "Usage of match compiler") set_property(CACHE USE_MATCHCOMPILER PROPERTY STRINGS Auto Off On Verify) if (USE_MATCHCOMPILER STREQUAL "Auto") if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug") diff --git a/doxyfile b/doxyfile index eeb023e3c..3efe6a43a 100644 --- a/doxyfile +++ b/doxyfile @@ -840,7 +840,7 @@ USE_HTAGS = NO VERBATIM_HEADERS = YES # If CLANG_ASSISTED_PARSING is set to YES, then doxygen will use the clang parser -# for more acurate parsing at the cost of reduced performance. This can be +# for more accurate parsing at the cost of reduced performance. This can be # particularly helpful with template rich C++ code for which doxygen's built-in # parser lacks the necessary type information. @@ -929,7 +929,7 @@ HTML_STYLESHEET = # user-defined cascading style sheet that is included after the standard # style sheets created by doxygen. Using this option one can overrule # certain style aspects. This is preferred over using HTML_STYLESHEET -# since it does not replace the standard style sheet and is therefor more +# since it does not replace the standard style sheet and is therefore more # robust against future updates. Doxygen will copy the style sheet file to # the output directory. diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 1702c53cc..6b4386231 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -1971,7 +1971,7 @@ static bool valueFlowForward(Token * const startToken, Token *lambdaEndToken = const_cast(findLambdaEndToken(tok2)); if (isVariableChanged(lambdaEndToken->link(), lambdaEndToken, varid, var->isGlobal(), settings, tokenlist->isCPP())) return false; - // Dont skip lambdas for lifetime values + // Don't skip lambdas for lifetime values if (!std::all_of(values.begin(), values.end(), std::mem_fn(&ValueFlow::Value::isLifetimeValue))) { tok2 = lambdaEndToken; continue; @@ -2682,7 +2682,7 @@ struct LifetimeStore { value.tokvalue = var->nameToken(); value.errorPath = errorPath; value.lifetimeKind = type; - // Dont add the value a second time + // Don't add the value a second time if (std::find(tok->values().begin(), tok->values().end(), value) != tok->values().end()) return; setTokenValue(tok, value, tokenlist->getSettings()); @@ -2714,7 +2714,7 @@ struct LifetimeStore { value.tokvalue = var->nameToken(); value.errorPath = errorPath; value.lifetimeKind = type; - // Dont add the value a second time + // Don't add the value a second time if (std::find(tok->values().begin(), tok->values().end(), value) != tok->values().end()) continue; setTokenValue(tok, value, tokenlist->getSettings()); @@ -4190,7 +4190,7 @@ static void valueFlowSubFunction(TokenList *tokenlist, const Settings *settings) // passing value(s) to function std::list argvalues(getFunctionArgumentValues(argtok)); - // Dont forward lifetime values + // Don't forward lifetime values argvalues.remove_if(std::mem_fn(&ValueFlow::Value::isLifetimeValue)); if (argvalues.empty()) diff --git a/test/testautovariables.cpp b/test/testautovariables.cpp index 3b165b04c..6a8732955 100644 --- a/test/testautovariables.cpp +++ b/test/testautovariables.cpp @@ -1571,14 +1571,14 @@ private: "}\n"); ASSERT_EQUALS("", errout.str()); - // Dont decay std::array + // Don't decay std::array check("std::array f() {\n" " std::array x;\n" " return x;\n" "}\n"); ASSERT_EQUALS("", errout.str()); - // Make sure we dont hang + // Make sure we don't hang check("struct A;\n" "void f() {\n" " using T = A[3];\n" @@ -1586,7 +1586,7 @@ private: "}\n"); ASSERT_EQUALS("", errout.str()); - // Make sure we dont hang + // Make sure we don't hang check("struct A;\n" "void f() {\n" " using T = A[3];\n" @@ -1594,7 +1594,7 @@ private: "}\n"); ASSERT_EQUALS("", errout.str()); - // Make sure we dont hang + // Make sure we don't hang check("struct A;\n" "void f() {\n" " using T = A[3];\n" @@ -1602,7 +1602,7 @@ private: "}\n"); ASSERT_EQUALS("", errout.str()); - // Make sure we dont hang + // Make sure we don't hang check("struct A;\n" "void f() {\n" " using T = A[3];\n" diff --git a/test/testcondition.cpp b/test/testcondition.cpp index e7c66862c..7456701ce 100644 --- a/test/testcondition.cpp +++ b/test/testcondition.cpp @@ -2158,7 +2158,7 @@ private: " X(do);\n" " if (x > 100) {}\n" "}"); - // TODO: we should probably throw unknownMacro InternalError. Complain that the macro X must be defined. We cant check the code well without the definition. + // TODO: we should probably throw unknownMacro InternalError. Complain that the macro X must be defined. We can't check the code well without the definition. TODO_ASSERT_EQUALS("[test.cpp:2] -> [test.cpp:4]: (style) Condition 'x>100' is always false\n", "", errout.str()); check("void f(const int *i) {\n" diff --git a/test/testconstructors.cpp b/test/testconstructors.cpp index d8fe11ea5..165d1b553 100644 --- a/test/testconstructors.cpp +++ b/test/testconstructors.cpp @@ -3484,12 +3484,12 @@ private: } void templateConstructor() { // ticket #7942 - check("template struct Containter {\n" - " Containter();\n" + check("template struct Container {\n" + " Container();\n" " T* mElements;\n" "};\n" - "template Containter::Containter() : mElements(nullptr) {}\n" - "Containter intContainer;"); + "template Container::Container() : mElements(nullptr) {}\n" + "Container intContainer;"); ASSERT_EQUALS("", errout.str()); } diff --git a/test/testgarbage.cpp b/test/testgarbage.cpp index 8441e5331..be2e05c20 100644 --- a/test/testgarbage.cpp +++ b/test/testgarbage.cpp @@ -824,7 +824,7 @@ private: void garbageCode98() { // #6838 ASSERT_THROW(checkCode("for (cocon To::ta@Taaaaaforconst oken aaaaaaaaaaaa5Dl()\n" - "const unsiged in;\n" + "const unsigned in;\n" "fon *tok = f);.s(Token i = d-)L;"), InternalError); } diff --git a/test/testsimplifytemplate.cpp b/test/testsimplifytemplate.cpp index 28f079513..7cd85f947 100644 --- a/test/testsimplifytemplate.cpp +++ b/test/testsimplifytemplate.cpp @@ -1313,34 +1313,34 @@ private: } void template67() { // ticket #8122 - const char code[] = "template struct Containter {\n" - " Containter();\n" - " Containter(const Containter &);\n" - " Containter & operator = (const Containter &);\n" - " ~Containter();\n" + const char code[] = "template struct Container {\n" + " Container();\n" + " Container(const Container &);\n" + " Container & operator = (const Container &);\n" + " ~Container();\n" " T* mElements;\n" - " const Containter * c;\n" + " const Container * c;\n" "};\n" - "template Containter::Containter() : mElements(nullptr), c(nullptr) {}\n" - "template Containter::Containter(const Containter & x) { nElements = x.nElements; c = x.c; }\n" - "template Containter & Containter::operator = (const Containter & x) { mElements = x.mElements; c = x.c; return *this; }\n" - "template Containter::~Containter() {}\n" - "Containter intContainer;"; + "template Container::Container() : mElements(nullptr), c(nullptr) {}\n" + "template Container::Container(const Container & x) { nElements = x.nElements; c = x.c; }\n" + "template Container & Container::operator = (const Container & x) { mElements = x.mElements; c = x.c; return *this; }\n" + "template Container::~Container() {}\n" + "Container intContainer;"; - const char expected[] = "struct Containter ; " - "Containter intContainer ; " - "struct Containter { " - "Containter ( ) ; " - "Containter ( const Containter & ) ; " - "Containter & operator= ( const Containter & ) ; " - "~ Containter ( ) ; " + const char expected[] = "struct Container ; " + "Container intContainer ; " + "struct Container { " + "Container ( ) ; " + "Container ( const Container & ) ; " + "Container & operator= ( const Container & ) ; " + "~ Container ( ) ; " "int * mElements ; " - "const Containter * c ; " + "const Container * c ; " "} ; " - "Containter :: Containter ( ) : mElements ( nullptr ) , c ( nullptr ) { } " - "Containter :: Containter ( const Containter & x ) { nElements = x . nElements ; c = x . c ; } " - "Containter & Containter :: operator= ( const Containter & x ) { mElements = x . mElements ; c = x . c ; return * this ; } " - "Containter :: ~ Containter ( ) { }"; + "Container :: Container ( ) : mElements ( nullptr ) , c ( nullptr ) { } " + "Container :: Container ( const Container & x ) { nElements = x . nElements ; c = x . c ; } " + "Container & Container :: operator= ( const Container & x ) { mElements = x . mElements ; c = x . c ; return * this ; } " + "Container :: ~ Container ( ) { }"; ASSERT_EQUALS(expected, tok(code)); } diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 4a286ed05..db671b0f9 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -822,36 +822,36 @@ private: void tokenize34() { // #8031 { - const char code[] = "struct Containter {\n" - " Containter();\n" + const char code[] = "struct Container {\n" + " Container();\n" " int* mElements;\n" "};\n" - "Containter::Containter() : mElements(nullptr) {}\n" - "Containter intContainer;"; - const char exp [] = "1: struct Containter {\n" - "2: Containter ( ) ;\n" + "Container::Container() : mElements(nullptr) {}\n" + "Container intContainer;"; + const char exp [] = "1: struct Container {\n" + "2: Container ( ) ;\n" "3: int * mElements@1 ;\n" "4: } ;\n" - "5: Containter :: Containter ( ) : mElements@1 ( nullptr ) { }\n" - "6: Containter intContainer@2 ;\n"; + "5: Container :: Container ( ) : mElements@1 ( nullptr ) { }\n" + "6: Container intContainer@2 ;\n"; ASSERT_EQUALS(exp, tokenizeDebugListing(code, /*simplify=*/true)); } { - const char code[] = "template struct Containter {\n" - " Containter();\n" + const char code[] = "template struct Container {\n" + " Container();\n" " int* mElements;\n" "};\n" - "template Containter::Containter() : mElements(nullptr) {}\n" - "Containter intContainer;"; - const char exp [] = "1: struct Containter ;\n" + "template Container::Container() : mElements(nullptr) {}\n" + "Container intContainer;"; + const char exp [] = "1: struct Container ;\n" "2:\n" "|\n" "5:\n" - "6: Containter intContainer@1 ; struct Containter {\n" - "2: Containter ( ) ;\n" + "6: Container intContainer@1 ; struct Container {\n" + "2: Container ( ) ;\n" "3: int * mElements@2 ;\n" "4: } ;\n" - "5: Containter :: Containter ( ) : mElements@2 ( nullptr ) { }\n"; + "5: Container :: Container ( ) : mElements@2 ( nullptr ) { }\n"; ASSERT_EQUALS(exp, tokenizeDebugListing(code, /*simplify=*/true)); } } diff --git a/tools/matchcompiler.py b/tools/matchcompiler.py index 68850b2ce..a14398b5b 100755 --- a/tools/matchcompiler.py +++ b/tools/matchcompiler.py @@ -659,7 +659,7 @@ def main(): parser.add_argument('--line', action='store_true', default=False, help='add line directive to input files into build files') parser.add_argument('file', nargs='*', - help='file to complile') + help='file to compile') args = parser.parse_args() lib_dir = args.read_dir build_dir = args.write_dir