Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed some typos #5562

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/cppcheckexecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ int CppCheckExecutor::executeCommand(std::string exe, std::vector<std::string> 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;
Expand Down
2 changes: 1 addition & 1 deletion cli/cppcheckexecutorsig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
# include <ucontext.h>
#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
Expand Down
2 changes: 1 addition & 1 deletion cmake/clang_tidy.cmake
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmake/compileroptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ if (MSVC)
# Linker - General
add_link_options($<$<CONFIG:Debug>:/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
Expand Down
4 changes: 2 additions & 2 deletions externals/simplecpp/simplecpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ''
Expand Down
2 changes: 1 addition & 1 deletion gui/codeeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 `(?<!\)` to ignore `\"` sequience in the c-string.
// We use negative lookbehind assertion `(?<!\)` to ignore `\"` sequence in the c-string.
rule.pattern = QRegularExpression("\".*?(?<!\\\\)\"");
rule.format = mQuotationFormat;
rule.ruleRole = RuleRole::Quote;
Expand Down
2 changes: 1 addition & 1 deletion lib/checkers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace checkers {
{"CheckBoost::checkBoostForeachModification",""},
{"CheckNullPointer::nullPointer",""},
{"CheckNullPointer::nullConstantDereference",""},
{"CheckNullPointer::aithmetic",""},
{"CheckNullPointer::arithmetic",""},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These literals should probably be put into a separate header so they are not duplicated in the code.

{"CheckNullPointer::analyseWholeProgram","unusedfunctions"},
{"CheckBufferOverrun::arrayIndex",""},
{"CheckBufferOverrun::pointerArithmetic","portability"},
Expand Down
2 changes: 1 addition & 1 deletion lib/checknullpointer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ void CheckNullPointer::nullPointerError(const Token *tok, const std::string &var

void CheckNullPointer::arithmetic()
{
logChecker("CheckNullPointer::aithmetic");
logChecker("CheckNullPointer::arithmetic");
const SymbolDatabase *symbolDatabase = mTokenizer->getSymbolDatabase();
for (const Scope * scope : symbolDatabase->functionScopes) {
for (const Token* tok = scope->bodyStart->next(); tok != scope->bodyEnd; tok = tok->next()) {
Expand Down
2 changes: 1 addition & 1 deletion lib/checkstl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/symboldatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion lib/templatesimplifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
2 changes: 1 addition & 1 deletion lib/token.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/valueflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3299,7 +3299,7 @@ struct SubExpressionAnalyzer : ExpressionAnalyzer {
partialReads->emplace_back(tok, v);
}

// No reanalysis for subexression
// No reanalysis for subexpression
ValuePtr<Analyzer> reanalyze(Token* /*tok*/, const std::string& /*msg*/) const override {
return {};
}
Expand Down
2 changes: 1 addition & 1 deletion releasenotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 <template>` and `--template-format <template>` has been removed. Please use `--template=` and `--template-format=` instead.
- "--showtime=summary" will now show a single summary at the end instead of showing it after each file when using the thread execution (default on Windows)
- added "--showtime=none" to disable any previously specified showtime report. "--showtime=" without parameter is no longer valid.
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if (BUILD_TESTS)
target_link_libraries(testrunner cppcheck-core)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# $ is used in dinit() dessignated initialization helper
# $ is used in dinit() designated initialization helper
target_compile_options_safe(testrunner -Wno-dollar-in-identifier-extension)
endif()

Expand Down
4 changes: 2 additions & 2 deletions test/testimportproject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ class TestImportProject : public TestFixture {
TEST_CASE(importCompileCommands2); // #8563, #9567
TEST_CASE(importCompileCommands3); // check with existing trailing / in directory
TEST_CASE(importCompileCommands4); // only accept certain file types
TEST_CASE(importCompileCommands5); // Windows/CMake/Ninja generated comile_commands.json
TEST_CASE(importCompileCommands6); // Windows/CMake/Ninja generated comile_commands.json with spaces
TEST_CASE(importCompileCommands5); // Windows/CMake/Ninja generated compile_commands.json
TEST_CASE(importCompileCommands6); // Windows/CMake/Ninja generated compile_commands.json with spaces
TEST_CASE(importCompileCommands7); // linux: "/home/danielm/cppcheck 2"
TEST_CASE(importCompileCommands8); // Windows: "C:\Users\danielm\cppcheck"
TEST_CASE(importCompileCommands9);
Expand Down
2 changes: 1 addition & 1 deletion test/testnullpointer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ class TestNullPointer : public TestFixture {

// Dereferencing a struct and then checking if it is null
// This is checked by this function:
// CheckOther::nullPointerStructByDeRefAndChec
// CheckOther::nullPointerStructByDeRefAndCheck
void structDerefAndCheck() {
// extracttests.start: struct ABC { int a; int b; int x; };

Expand Down
Loading