From 85907f5841f60b4017204d569daa18fccfddebe7 Mon Sep 17 00:00:00 2001 From: firewave Date: Mon, 16 Oct 2023 06:38:32 +0200 Subject: [PATCH] fixed some typos --- cli/cppcheckexecutor.cpp | 2 +- cli/cppcheckexecutorsig.cpp | 2 +- cmake/clang_tidy.cmake | 2 +- cmake/compileroptions.cmake | 2 +- externals/simplecpp/simplecpp.cpp | 4 ++-- gui/codeeditor.cpp | 2 +- lib/checkers.cpp | 2 +- lib/checknullpointer.cpp | 2 +- lib/checkstl.cpp | 2 +- lib/config.h | 2 +- lib/symboldatabase.cpp | 2 +- lib/templatesimplifier.cpp | 2 +- lib/token.h | 2 +- lib/valueflow.cpp | 2 +- releasenotes.txt | 2 +- test/CMakeLists.txt | 2 +- test/testimportproject.cpp | 4 ++-- test/testnullpointer.cpp | 2 +- 18 files changed, 20 insertions(+), 20 deletions(-) diff --git a/cli/cppcheckexecutor.cpp b/cli/cppcheckexecutor.cpp index 70dd37cdc1c..10e6c74245c 100644 --- a/cli/cppcheckexecutor.cpp +++ b/cli/cppcheckexecutor.cpp @@ -624,7 +624,7 @@ int CppCheckExecutor::executeCommand(std::string exe, std::vector a #else const int res = pclose(p); #endif - if (res == -1) { // error occured + if (res == -1) { // error occurred // TODO: how to provide to caller? //const int err = errno; //std::cout << "pclose() errno " << std::to_string(err) << std::endl; diff --git a/cli/cppcheckexecutorsig.cpp b/cli/cppcheckexecutorsig.cpp index 4490a292eae..d1bf5821281 100644 --- a/cli/cppcheckexecutorsig.cpp +++ b/cli/cppcheckexecutorsig.cpp @@ -49,7 +49,7 @@ # include #endif -// TODO: __USE_DYNAMIC_STACK_SIZE is depedent on the features.h include and not a built-in compiler define, so it might be problematic to depedent on it +// TODO: __USE_DYNAMIC_STACK_SIZE is dependent on the features.h include and not a built-in compiler define, so it might be problematic to depend on it #ifdef __USE_DYNAMIC_STACK_SIZE static const size_t MYSTACKSIZE = 16*1024+32768; // wild guess about a reasonable buffer #else diff --git a/cmake/clang_tidy.cmake b/cmake/clang_tidy.cmake index 679c14cdb1b..996fe064a07 100644 --- a/cmake/clang_tidy.cmake +++ b/cmake/clang_tidy.cmake @@ -1,5 +1,5 @@ if (NOT CMAKE_DISABLE_PRECOMPILE_HEADERS) - # clang-tidy and clang need to have the same version when precompiled headers are beign used + # clang-tidy and clang need to have the same version when precompiled headers are being used if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") string(REGEX MATCHALL "[0-9]+" _clang_ver_parts "${CMAKE_CXX_COMPILER_VERSION}") LIST(GET _clang_ver_parts 0 _clang_major) diff --git a/cmake/compileroptions.cmake b/cmake/compileroptions.cmake index 38df5d106dd..2a535201759 100644 --- a/cmake/compileroptions.cmake +++ b/cmake/compileroptions.cmake @@ -187,7 +187,7 @@ if (MSVC) # Linker - General add_link_options($<$:/INCREMENTAL>) # Enable Incremental Linking - Yes - add_link_options(/NOLOGO) # SUppress Startup Banner - Yes + add_link_options(/NOLOGO) # Suppress Startup Banner - Yes # Ignore Import Library - Yes # Linker - Debugging diff --git a/externals/simplecpp/simplecpp.cpp b/externals/simplecpp/simplecpp.cpp index 804583396fc..e84703d5c54 100755 --- a/externals/simplecpp/simplecpp.cpp +++ b/externals/simplecpp/simplecpp.cpp @@ -79,13 +79,13 @@ static bool isOct(const std::string &s) return s.size()>1 && (s[0]=='0') && (s[1] >= '0') && (s[1] < '8'); } -// TODO: added an undercore since this conflicts with a function of the same name in utils.h from Cppcheck source when building Cppcheck with MSBuild +// TODO: added an underscore since this conflicts with a function of the same name in utils.h from Cppcheck source when building Cppcheck with MSBuild static bool isStringLiteral_(const std::string &s) { return s.size() > 1 && (s[0]=='\"') && (*s.rbegin()=='\"'); } -// TODO: added an undercore since this conflicts with a function of the same name in utils.h from Cppcheck source when building Cppcheck with MSBuild +// TODO: added an underscore since this conflicts with a function of the same name in utils.h from Cppcheck source when building Cppcheck with MSBuild static bool isCharLiteral_(const std::string &s) { // char literal patterns can include 'a', '\t', '\000', '\xff', 'abcd', and maybe '' diff --git a/gui/codeeditor.cpp b/gui/codeeditor.cpp index ec7d79d4664..2a195565df6 100644 --- a/gui/codeeditor.cpp +++ b/gui/codeeditor.cpp @@ -152,7 +152,7 @@ Highlighter::Highlighter(QTextDocument *parent, mQuotationFormat.setForeground(mWidgetStyle->quoteColor); mQuotationFormat.setFontWeight(mWidgetStyle->quoteWeight); // We use lazy `*?` instead greed `*` quantifier to find the real end of the c-string. - // We use negative lookbehind assertion `(?getSymbolDatabase(); for (const Scope * scope : symbolDatabase->functionScopes) { for (const Token* tok = scope->bodyStart->next(); tok != scope->bodyEnd; tok = tok->next()) { diff --git a/lib/checkstl.cpp b/lib/checkstl.cpp index 093cf69d56b..e310ee99c05 100644 --- a/lib/checkstl.cpp +++ b/lib/checkstl.cpp @@ -1512,7 +1512,7 @@ void CheckStl::if_find() for (int j = 0; j < container->type_templateArgNo; j++) tok2 = tok2->nextTemplateArgument(); - container = mSettings->library.detectContainer(tok2); // innner container + container = mSettings->library.detectContainer(tok2); // inner container } else container = nullptr; } diff --git a/lib/config.h b/lib/config.h index 3f98796bee7..3ecff1c1000 100644 --- a/lib/config.h +++ b/lib/config.h @@ -159,7 +159,7 @@ static const std::string emptyString; #define USE_WINDOWS_SEH #endif -// TODO: __GLIBC__ is depedent on the features.h include and not a built-in compiler define, so it might be problematic to depedent on it +// TODO: __GLIBC__ is dependent on the features.h include and not a built-in compiler define, so it might be problematic to depend on it #if !defined(NO_UNIX_BACKTRACE_SUPPORT) && defined(__GNUC__) && defined(__GLIBC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__NetBSD__) && !defined(__SVR4) && !defined(__QNX__) #define USE_UNIX_BACKTRACE_SUPPORT #endif diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 3101a23062a..22b1e22204e 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -2832,7 +2832,7 @@ bool Function::argsMatch(const Scope *scope, const Token *first, const Token *se else if (openParen == 1 && second->str() == ")" && first->str() != ")") break; - // ckeck for type * x == type x[] + // check for type * x == type x[] else if (Token::Match(first->next(), "* %name%| ,|)|=") && Token::Match(second->next(), "%name%| [ ] ,|)")) { do { diff --git a/lib/templatesimplifier.cpp b/lib/templatesimplifier.cpp index b4c822defe3..b18db08c905 100644 --- a/lib/templatesimplifier.cpp +++ b/lib/templatesimplifier.cpp @@ -876,7 +876,7 @@ void TemplateSimplifier::getTemplateInstantiations() size_t match = 0; size_t argMatch = 0; for (size_t i = 0; i < declarationParams.size(); ++i) { - // fixme: only type deducton from literals is supported + // fixme: only type deduction from literals is supported const bool isArgLiteral = Token::Match(instantiationArgs[i], "%num%|%str%|%char%|%bool% ,|)"); if (isArgLiteral && Token::Match(declarationParams[i], "const| %type% &| %name%| ,|)")) { match++; diff --git a/lib/token.h b/lib/token.h index a56a6112937..56bdba58f9a 100644 --- a/lib/token.h +++ b/lib/token.h @@ -1324,7 +1324,7 @@ class CPPCHECKLIB Token { fIsAttributeUsed = (1ULL << 14), // __attribute__((used)) fIsAttributePacked = (1ULL << 15), // __attribute__((packed)) fIsAttributeExport = (1ULL << 16), // __attribute__((__visibility__("default"))), __declspec(dllexport) - fIsAttributeMaybeUnused = (1ULL << 17), // [[maybe_unsed]] + fIsAttributeMaybeUnused = (1ULL << 17), // [[maybe_unused]] fIsAttributeNodiscard = (1ULL << 18), // __attribute__ ((warn_unused_result)), [[nodiscard]] fIsControlFlowKeyword = (1ULL << 19), // if/switch/while/... fIsOperatorKeyword = (1ULL << 20), // operator=, etc diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 9fa3ec3c57a..f0a7f4801a8 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -3299,7 +3299,7 @@ struct SubExpressionAnalyzer : ExpressionAnalyzer { partialReads->emplace_back(tok, v); } - // No reanalysis for subexression + // No reanalysis for subexpression ValuePtr reanalyze(Token* /*tok*/, const std::string& /*msg*/) const override { return {}; } diff --git a/releasenotes.txt b/releasenotes.txt index 089c188ac2f..5a1631f0102 100644 --- a/releasenotes.txt +++ b/releasenotes.txt @@ -16,7 +16,7 @@ Deprecations: - "--showtime=top5" has been deprecated and will be removed in Cppcheck 2.14. Please use --showtime=top5_file or --showtime=top5_summary instead. Other: -- Windows builds now default to the `native` platform instead of `win32A` or `win64`. Please specify it explicitly if you depedent on it. +- Windows builds now default to the `native` platform instead of `win32A` or `win64`. Please specify it explicitly if you depend on it. - The undocumented and deprecated command-line options `--template