From 46a11183a5471183d626cf9189b346ad4d2a15bc Mon Sep 17 00:00:00 2001 From: vBm Date: Wed, 15 Dec 2010 18:45:53 +0100 Subject: [PATCH] Fixed some spelling mistakes --- AUTHORS | 1 + cli/cmdlineparser.h | 2 +- gui/applicationlist.h | 4 ++-- gui/checkstatistics.cpp | 2 +- gui/checkthread.h | 2 +- gui/filelist.h | 2 +- gui/mainwindow.cpp | 2 +- gui/resultsview.h | 2 +- gui/threadhandler.h | 2 +- gui/threadresult.h | 4 ++-- gui/translationhandler.cpp | 6 +++--- gui/xmlreport.cpp | 2 +- htmlreport/README.txt | 4 ++-- lib/checkbufferoverrun.cpp | 4 ++-- lib/checkclass.cpp | 2 +- lib/checkmemoryleak.cpp | 4 ++-- lib/checknullpointer.cpp | 8 +++---- lib/checkother.cpp | 6 +++--- lib/checkunusedfunctions.cpp | 2 +- lib/cppcheck.h | 2 +- lib/errorlogger.h | 4 ++-- lib/preprocessor.cpp | 20 ++++++++--------- lib/preprocessor.h | 6 +++--- lib/settings.h | 6 +++--- lib/symboldatabase.cpp | 6 +++--- lib/tokenize.cpp | 42 ++++++++++++++++++------------------ lib/tokenize.h | 8 +++---- man/cppcheck.1.xml | 2 +- man/manual.docbook | 2 +- readme.txt | 4 ++-- readme_64-bit_Windows.txt | 2 +- test/testclass.cpp | 18 ++++++++-------- test/testcppcheck.cpp | 2 +- test/testmathlib.cpp | 6 +++--- test/testpreprocessor.cpp | 2 +- test/testsimplifytokens.cpp | 8 +++---- test/testsuite.h | 2 +- test/testtokenize.cpp | 8 +++---- 38 files changed, 106 insertions(+), 105 deletions(-) diff --git a/AUTHORS b/AUTHORS index 6d706260c..d225bca0e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -12,6 +12,7 @@ Nicolas Le Cam Reijo Tomperi Robert Reif Slava Semushin +vBm Vesa Pikki Zachary Blair diff --git a/cli/cmdlineparser.h b/cli/cmdlineparser.h index 1c7946a4f..7a1b428d7 100644 --- a/cli/cmdlineparser.h +++ b/cli/cmdlineparser.h @@ -41,7 +41,7 @@ class CmdLineParser public: /** * The constructor. - * @param settings Settings instance that will be modified accoding to + * @param settings Settings instance that will be modified according to * options user has given. */ CmdLineParser(Settings *settings); diff --git a/gui/applicationlist.h b/gui/applicationlist.h index 800026a8f..44f539ebe 100644 --- a/gui/applicationlist.h +++ b/gui/applicationlist.h @@ -40,7 +40,7 @@ * (message) - Error message * (severity) - Error severity * -* Example opening a file with Kate and make Kate scroll to the corret line: +* Example opening a file with Kate and make Kate scroll to the correct line: * kate -l(line) (file) * */ @@ -91,7 +91,7 @@ public: int GetApplicationCount() const; /** - * @brief Get spesific application's name + * @brief Get specific application's name * * @param index Index of the application whose name to get * @return Name of the application diff --git a/gui/checkstatistics.cpp b/gui/checkstatistics.cpp index 04874b85c..4862de802 100644 --- a/gui/checkstatistics.cpp +++ b/gui/checkstatistics.cpp @@ -83,7 +83,7 @@ unsigned CheckStatistics::GetCount(ShowTypes type) const break; case SHOW_NONE: default: - qDebug() << "Unknown error type - returning zero statistices."; + qDebug() << "Unknown error type - returning zero statistics."; break; } return count; diff --git a/gui/checkthread.h b/gui/checkthread.h index d797577ce..24ed0bd03 100644 --- a/gui/checkthread.h +++ b/gui/checkthread.h @@ -71,7 +71,7 @@ protected: * Whole purpose of these states is to allow stopping of the checking. When * stopping we say for the thread (Stopping) that stop when current check * has been completed. Thread must be stopped cleanly, just terminating thread - * likely causes unpredictable side-effedts. + * likely causes unpredictable side-effects. */ enum State { diff --git a/gui/filelist.h b/gui/filelist.h index fc002b9af..b71589f6f 100644 --- a/gui/filelist.h +++ b/gui/filelist.h @@ -70,7 +70,7 @@ protected: /** * @brief Test if filename matches the filename extensions filtering. - * @param true if filename matches filterin. + * @param true if filename matches filtering. */ bool FilterMatches(const QFileInfo &inf); diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 41dd636e0..f62708447 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -315,7 +315,7 @@ void MainWindow::CheckDirectory() bool MainWindow::GetCheckProject() { - // We have succesfully loaded project earlier and use that project + // We have successfully loaded project earlier and use that project if (mProject) return true; diff --git a/gui/resultsview.h b/gui/resultsview.h index c247e828d..3b70b5420 100644 --- a/gui/resultsview.h +++ b/gui/resultsview.h @@ -212,7 +212,7 @@ protected: bool mErrorsFound; /** - * @brief Should we show a "No errors found dialog" everytime no errors were found? + * @brief Should we show a "No errors found dialog" every time no errors were found? */ bool mShowNoErrorsMessage; diff --git a/gui/threadhandler.h b/gui/threadhandler.h index e3a45728a..38a3c1da1 100644 --- a/gui/threadhandler.h +++ b/gui/threadhandler.h @@ -86,7 +86,7 @@ public: * @brief Start the threads to check the files * * @param settings Settings for checking - * @param recheck Should we reuse the files we checked earleir + * @param recheck Should we reuse the files we checked earlier */ void Check(const Settings &settings, bool recheck); diff --git a/gui/threadresult.h b/gui/threadresult.h index 978b3a118..27200efb5 100644 --- a/gui/threadresult.h +++ b/gui/threadresult.h @@ -75,8 +75,8 @@ public: public slots: /** - * @brief Slot threads use to signal this class that a spesific file is checked - * @param file File taht is checked + * @brief Slot threads use to signal this class that a specific file is checked + * @param file File that is checked */ void FileChecked(const QString &file); signals: diff --git a/gui/translationhandler.cpp b/gui/translationhandler.cpp index eac30938a..17493d4bc 100644 --- a/gui/translationhandler.cpp +++ b/gui/translationhandler.cpp @@ -49,7 +49,7 @@ TranslationHandler::TranslationHandler(QObject *parent) : << "cppcheck_ja" << "cppcheck_sr"; - //Load english as a fallback language + //Load English as a fallback language QTranslator *english = new QTranslator(); if (english->load("cppcheck_en")) { @@ -78,7 +78,7 @@ const QStringList TranslationHandler::GetFiles() const bool TranslationHandler::SetLanguage(const int index, QString &error) { - //If english is the language + //If English is the language if (index == 0) { //Just remove all extra translators @@ -147,7 +147,7 @@ int TranslationHandler::SuggestLanguage() const //And see if we can find it from our list of language files int index = mFiles.indexOf(file); - //If nothing found, return english + //If nothing found, return English if (index < 0) { return 0; diff --git a/gui/xmlreport.cpp b/gui/xmlreport.cpp index f5c416134..31b92dc23 100644 --- a/gui/xmlreport.cpp +++ b/gui/xmlreport.cpp @@ -89,7 +89,7 @@ void XmlReport::WriteError(const ErrorItem &error) /* Error example from the core program in xml - The callstack seems to be ignored here aswell, instead last item of the stack is used + The callstack seems to be ignored here as well, instead last item of the stack is used */ mXmlWriter->writeStartElement(ErrorElementName); diff --git a/htmlreport/README.txt b/htmlreport/README.txt index 8efd06df2..49cdc16d7 100644 --- a/htmlreport/README.txt +++ b/htmlreport/README.txt @@ -1,7 +1,7 @@ cppcheck-htmlreport -This is a little utility to generate a html report of a xml file produced by +This is a little utility to generate a html report of a XML file produced by cppcheck. -The utility is implemented in python and require the pygments module to be +The utility is implemented in Python and require the pygments module to be able to generate syntax highlighted source code. diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index 127b9bdaa..4f9bc3612 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -753,7 +753,7 @@ void CheckBufferOverrun::checkScope(const Token *tok, const std::vectortokAt(4), "%var% =|+=|-=") && MathLib::toLongNumber(max_counter_value) <= size) condition_out_of_bounds = false; - // Goto the end paranthesis of the for-statement: "for (x; y; z)" .. + // Goto the end parenthesis of the for-statement: "for (x; y; z)" .. tok2 = tok->next()->link(); if (!tok2 || !tok2->tokAt(5)) break; @@ -922,7 +922,7 @@ void CheckBufferOverrun::checkScope(const Token *tok, const ArrayInfo &arrayInfo if (Token::Match(tok2->tokAt(4), "%var% =|+=|-=") && MathLib::toLongNumber(max_counter_value) <= (int)arrayInfo.num[0]) condition_out_of_bounds = false; - // Goto the end paranthesis of the for-statement: "for (x; y; z)" .. + // Goto the end parenthesis of the for-statement: "for (x; y; z)" .. tok2 = tok->next()->link(); if (!tok2 || !tok2->tokAt(5)) break; diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index 3b111bb7a..de25e73d4 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -211,7 +211,7 @@ void CheckClass::privateFunctions() if (!info->isClassOrStruct()) continue; - // dont check derived classes + // don’t check derived classes if (!info->derivedFrom.empty()) continue; diff --git a/lib/checkmemoryleak.cpp b/lib/checkmemoryleak.cpp index 25d3f0cc7..e96f524bc 100644 --- a/lib/checkmemoryleak.cpp +++ b/lib/checkmemoryleak.cpp @@ -1403,7 +1403,7 @@ Token *CheckMemoryLeakInFunction::getcode(const Token *tok, std::liststr()) != noreturn.end()) @@ -2225,7 +2225,7 @@ const Token *CheckMemoryLeakInFunction::findleak(const Token *tokens) while (last->next()) last = last->next(); - // not a leak if exit is called before the end of the funcion + // not a leak if exit is called before the end of the function if (!Token::Match(last->tokAt(-2), "exit|callfunc ; }")) return last; } diff --git a/lib/checknullpointer.cpp b/lib/checknullpointer.cpp index a5cbee827..3d778312f 100644 --- a/lib/checknullpointer.cpp +++ b/lib/checknullpointer.cpp @@ -216,11 +216,11 @@ void CheckNullPointer::nullPointerLinkedList() if (!Token::simpleMatch(tok1->next()->link(), ") {")) continue; - // is there any dereferencing occuring in the for statement.. + // is there any dereferencing occurring in the for statement.. unsigned int parlevel2 = 1; for (const Token *tok2 = tok1->tokAt(2); tok2; tok2 = tok2->next()) { - // Parantheses.. + // Parentheses.. if (tok2->str() == "(") ++parlevel2; else if (tok2->str() == ")") @@ -230,7 +230,7 @@ void CheckNullPointer::nullPointerLinkedList() --parlevel2; } - // Dereferencing a variable inside the "for" parantheses.. + // Dereferencing a variable inside the "for" parentheses.. else if (Token::Match(tok2, "%var% . %var%")) { const unsigned int varid(tok2->varId()); @@ -532,7 +532,7 @@ void CheckNullPointer::nullPointer() nullPointerByCheckAndDeRef(); } -/** Derefencing null constant (simplified token list) */ +/** Dereferencing null constant (simplified token list) */ void CheckNullPointer::nullConstantDereference() { // this is kept at 0 for all scopes that are not executing diff --git a/lib/checkother.cpp b/lib/checkother.cpp index fd157965c..8aa8cc49a 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -1041,7 +1041,7 @@ static int doAssignment(Variables &variables, const Token *tok, bool dereference if (scope == var1->_scope) replace = true; - // not in same scope as decelaration + // not in same scope as declaration else { std::set::iterator assignment; @@ -1070,7 +1070,7 @@ static int doAssignment(Variables &variables, const Token *tok, bool dereference // assignment in this scope else { - // replace when only one other assingnment + // replace when only one other assignment if (var1->_assignments.size() == 1) replace = true; @@ -1107,7 +1107,7 @@ static int doAssignment(Variables &variables, const Token *tok, bool dereference { if (var1->_type == Variables::pointer && !dereference) { - // check if variable decelaration is in this scope + // check if variable declaration is in this scope if (var1->_scope == scope) variables.clearAliases(varid1); else diff --git a/lib/checkunusedfunctions.cpp b/lib/checkunusedfunctions.cpp index 0ad8cfaf0..1f0c01673 100644 --- a/lib/checkunusedfunctions.cpp +++ b/lib/checkunusedfunctions.cpp @@ -115,7 +115,7 @@ void CheckUnusedFunctions::parseTokens(const Tokenizer &tokenizer) else continue; - // funcname ( => Assert that the end paranthesis isn't followed by { + // funcname ( => Assert that the end parenthesis isn't followed by { if (Token::Match(funcname, "%var% (")) { int parlevel = 0; diff --git a/lib/cppcheck.h b/lib/cppcheck.h index d429ee9de..a5e8d3c20 100644 --- a/lib/cppcheck.h +++ b/lib/cppcheck.h @@ -116,7 +116,7 @@ public: /** * @brief Call all "getErrorMessages" in all registered Check classes. - * Also print out xml header and footer. + * Also print out XML header and footer. */ void getErrorMessages(); diff --git a/lib/errorlogger.h b/lib/errorlogger.h index a4c95479a..f0552d272 100644 --- a/lib/errorlogger.h +++ b/lib/errorlogger.h @@ -128,7 +128,7 @@ public: /** * Format the error message in XML format * @param verbose use verbose message - * @param ver xml version + * @param ver XML version */ std::string toXML(bool verbose, int ver) const; @@ -170,7 +170,7 @@ public: private: /** - * Replace all occurances of searchFor with replaceWith in the + * Replace all occurrences of searchFor with replaceWith in the * given source. * @param source The string to modify * @param searchFor What should be searched for diff --git a/lib/preprocessor.cpp b/lib/preprocessor.cpp index 270991e31..5a6469a6b 100644 --- a/lib/preprocessor.cpp +++ b/lib/preprocessor.cpp @@ -225,7 +225,7 @@ std::string Preprocessor::removeComments(const std::string &str, const std::stri { std::ostringstream errmsg; errmsg << "The code contains characters that are unhandled. " - << "Neither unicode nor extended ascii are supported. " + << "Neither unicode nor extended ASCII are supported. " << "(line=" << lineno << ", character code=" << std::hex << (int(ch) & 0xff) << ")"; writeError(filename, lineno, _errorLogger, "syntaxError", errmsg.str()); } @@ -1546,7 +1546,7 @@ void Preprocessor::handleIncludes(std::string &code, (headerType == SystemHeader && systemIncludes.find(tempFile) != systemIncludes.end())) { // We have processed this file already once, skip - // it this time to avoid ethernal loop. + // it this time to avoid eternal loop. fin.close(); continue; } @@ -1645,7 +1645,7 @@ static void skipstring(const std::string &line, std::string::size_type &pos) * @param pos in: Position to the '('. out: Position to the ')' * @param params out: The extracted parameters * @param numberOfNewlines out: number of newlines in the macro call - * @param endFound out: was the end paranthesis found? + * @param endFound out: was the end parenthesis found? */ static void getparams(const std::string &line, std::string::size_type &pos, @@ -1663,7 +1663,7 @@ static void getparams(const std::string &line, if (line[pos] != '(') return; - // parantheses level + // parentheses level int parlevel = 0; // current parameter data @@ -1672,7 +1672,7 @@ static void getparams(const std::string &line, // scan for parameters.. for (; pos < line.length(); ++pos) { - // increase paranthesis level + // increase parenthesis level if (line[pos] == '(') { ++parlevel; @@ -1680,7 +1680,7 @@ static void getparams(const std::string &line, continue; } - // decrease paranthesis level + // decrease parenthesis level else if (line[pos] == ')') { --parlevel; @@ -1759,7 +1759,7 @@ private: /** prefix that is used by cppcheck to separate macro parameters. Always "__cppcheck__" */ const std::string _prefix; - /** The macro has parantheses but no parameters.. "AAA()" */ + /** The macro has parentheses but no parameters.. "AAA()" */ bool _nopar; /** disabled assignment operator */ @@ -1892,7 +1892,7 @@ public: return _variadic; } - /** Check if this macro has parantheses but no parameters */ + /** Check if this macro has parentheses but no parameters */ bool nopar() const { return _nopar; @@ -2301,10 +2301,10 @@ std::string Preprocessor::expandMacros(const std::string &code, std::string file // number of newlines within macro use unsigned int numberOfNewlines = 0; - // if the macro has parantheses, get parameters + // if the macro has parentheses, get parameters if (macro->variadic() || macro->nopar() || macro->params().size()) { - // is the end paranthesis found? + // is the end parenthesis found? bool endFound = false; getparams(line,pos2,params,numberOfNewlines,endFound); diff --git a/lib/preprocessor.h b/lib/preprocessor.h index 0239ef8b0..e1d849cd7 100644 --- a/lib/preprocessor.h +++ b/lib/preprocessor.h @@ -74,7 +74,7 @@ public: * @param srcCodeStream The (file/string) stream to read from. * @param processedFile Give reference to empty string as a parameter, * function will fill processed file here. Use this also as a filedata parameter - * to getcode() if you recieved more than once configurations. + * to getcode() if you received more than once configurations. * @param resultConfigurations List of configurations. Pass these one by one * to getcode() with processedFile. * @param filename The name of the file to check e.g. "src/main.cpp" @@ -147,9 +147,9 @@ protected: std::string removeComments(const std::string &str, const std::string &filename, Settings *settings); /** - * Remove redundant parantheses from preprocessor commands. This should only be called from read(). + * Remove redundant parentheses from preprocessor commands. This should only be called from read(). * @param str Code processed by read(). - * @return code with reduced parantheses + * @return code with reduced parentheses */ static std::string removeParantheses(const std::string &str); diff --git a/lib/settings.h b/lib/settings.h index 042875d83..1c9aaefd1 100644 --- a/lib/settings.h +++ b/lib/settings.h @@ -84,10 +84,10 @@ public: /** @brief Force checking the files with "too many" configurations (--force). */ bool _force; - /** @brief write xml results (--xml) */ + /** @brief write XML results (--xml) */ bool _xml; - /** @brief xml version (--xmlver=..) */ + /** @brief XML version (--xmlver=..) */ int _xml_version; /** @brief How many processes/threads should do checking at the same @@ -174,7 +174,7 @@ public: /** @brief defines given by the user */ std::string userDefines; - /** @brief Experimentat 2 pass checking of files */ + /** @brief Experimental 2 pass checking of files */ bool test_2_pass; /** @brief --report-progress */ diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index bf92eb7e4..712cebcff 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -388,7 +388,7 @@ SymbolDatabase::SymbolDatabase(const Tokenizer *tokenizer, const Settings *setti if (func->type == SymbolDatabase::Func::Constructor) { // check for no arguments: func ( ) - /** @todo check for arguents with default values someday */ + /** @todo check for arguments with default values someday */ if (func->argDef->next() == func->argDef->link()) { hasDefaultConstructor = true; @@ -397,7 +397,7 @@ SymbolDatabase::SymbolDatabase(const Tokenizer *tokenizer, const Settings *setti } } - // User defined types with user defined defaut constructor doesn't need initialization. + // User defined types with user defined default constructor doesn't need initialization. // We assume the default constructor initializes everything. // Another check will figure out if the constructor actually initializes everything. if (hasDefaultConstructor) @@ -960,7 +960,7 @@ void SymbolDatabase::SpaceInfo::getVarList() } // Borland C++: Skip all variables in the __published section. - // These are automaticly initialized. + // These are automatically initialized. else if (tok->str() == "__published:") { for (; tok; tok = tok->next()) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 772738628..88e9d4582 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -250,12 +250,12 @@ void Tokenizer::createTokens(std::istream &code) std::string CurrentToken; // lineNumbers holds line numbers for files in fileIndexes - // every time an include file is complitely parsed, last item in the vector + // every time an include file is completely parsed, last item in the vector // is removed and lineno is set to point to that value. std::vector lineNumbers; // fileIndexes holds index for _files vector about currently parsed files - // every time an include file is complitely parsed, last item in the vector + // every time an include file is completely parsed, last item in the vector // is removed and FileIndex is set to point to that value. std::vector fileIndexes; @@ -1190,13 +1190,13 @@ void Tokenizer::simplifyTypedef() if (simplifyType) { - // There are 2 catagories of typedef substitutions: + // There are 2 categories of typedef substitutions: // 1. variable declarations that preserve the variable name like // global, local, and function parameters // 2. not variable declarations that have no name like derived // classes, casts, operators, and template parameters - // try to determine which catagory this substitution is + // try to determine which category this substitution is bool isDerived = false; bool inCast = false; bool inTemplate = false; @@ -2172,7 +2172,7 @@ bool Tokenizer::tokenize(std::istream &code, // Remove __builtin_expect, likely and unlikely simplifyBuiltinExpect(); - // colapse compound standard types into a single token + // collapse compound standard types into a single token // unsigned long long int => long _isUnsigned=true,_isLong=true simplifyStdType(); @@ -2204,7 +2204,7 @@ bool Tokenizer::tokenize(std::istream &code, simplifyVariableMultipleAssign(); - // Remove redundant parantheses + // Remove redundant parentheses simplifyRedundantParanthesis(); // Handle templates.. @@ -3329,7 +3329,7 @@ void Tokenizer::setVarId() // Found a class function.. if (Token::Match(tok2, funcpattern.c_str())) { - // Goto the end paranthesis.. + // Goto the end parenthesis.. tok2 = tok2->tokAt(3)->link(); if (!tok2) break; @@ -4049,7 +4049,7 @@ bool Tokenizer::simplifyTokenList() modified |= simplifyCalculations(); } - // Remove redundant parantheses in return.. + // Remove redundant parentheses in return.. for (Token *tok = _tokens; tok; tok = tok->next()) { while (Token::simpleMatch(tok, "return (")) @@ -5470,7 +5470,7 @@ void Tokenizer::simplifyIfAssign() if (isNot) tok->next()->deleteNext(); - // Delete paranthesis.. and remember how many there are with + // Delete parenthesis.. and remember how many there are with // their links. std::stack braces; while (tok->next()->str() == "(") @@ -6423,7 +6423,7 @@ bool Tokenizer::simplifyRedundantParanthesis() tok->link()->previous() == tok->next()->link()) { // We have "(( *something* ))", remove the inner - // paranthesis + // parenthesis tok->deleteNext(); tok->link()->tokAt(-2)->deleteNext(); ret = true; @@ -6433,7 +6433,7 @@ bool Tokenizer::simplifyRedundantParanthesis() tok->link()->previous() == tok->tokAt(2)->link()) { // We have "( func ( *something* ))", remove the outer - // paranthesis + // parenthesis tok->link()->deleteThis(); tok->deleteThis(); ret = true; @@ -6442,7 +6442,7 @@ bool Tokenizer::simplifyRedundantParanthesis() while (Token::Match(tok->previous(), "[;{] ( delete %var% ) ;")) { // We have "( delete var )", remove the outer - // paranthesis + // parenthesis tok->tokAt(3)->deleteThis(); tok->deleteThis(); ret = true; @@ -6451,7 +6451,7 @@ bool Tokenizer::simplifyRedundantParanthesis() while (Token::Match(tok->previous(), "[;{] ( delete [ ] %var% ) ;")) { // We have "( delete [] var )", remove the outer - // paranthesis + // parenthesis tok->tokAt(5)->deleteThis(); tok->deleteThis(); ret = true; @@ -6469,7 +6469,7 @@ bool Tokenizer::simplifyRedundantParanthesis() if (Token::Match(tok->previous(), "[(!*;{}] ( %var% )") && tok->next()->varId() != 0) { - // We have "( var )", remove the paranthesis + // We have "( var )", remove the parenthesis tok->deleteThis(); tok->deleteNext(); ret = true; @@ -6478,7 +6478,7 @@ bool Tokenizer::simplifyRedundantParanthesis() if (Token::Match(tok->previous(), "[(!] ( %var% . %var% )")) { - // We have "( var . var )", remove the paranthesis + // We have "( var . var )", remove the parenthesis tok->deleteThis(); tok = tok->tokAt(2); tok->deleteNext(); @@ -6539,11 +6539,11 @@ bool Tokenizer::simplifyCalculations() bool ret = false; for (Token *tok = _tokens; tok; tok = tok->next()) { - // Remove parantheses around variable.. - // keep parantheses here: dynamic_cast(p); - // keep parantheses here: A operator * (int); - // keep parantheses here: operator new [] (size_t); - // keep parantheses here: Functor()(a ... ) + // Remove parentheses around variable.. + // keep parentheses here: dynamic_cast(p); + // keep parentheses here: A operator * (int); + // keep parentheses here: operator new [] (size_t); + // keep parentheses here: Functor()(a ... ) if (Token::Match(tok->next(), "( %var% ) [;),+-*/><]]") && !tok->isName() && tok->str() != ">" && @@ -6601,7 +6601,7 @@ bool Tokenizer::simplifyCalculations() ret = true; } - // Remove parantheses around number.. + // Remove parentheses around number.. if (Token::Match(tok->tokAt(-2), "%any% ( %num% )") && !tok->tokAt(-2)->isName()) { tok = tok->previous(); diff --git a/lib/tokenize.h b/lib/tokenize.h index c7a46a0f6..7d8953fd2 100644 --- a/lib/tokenize.h +++ b/lib/tokenize.h @@ -175,7 +175,7 @@ public: Token * initVar(Token * tok); /** - * Colapse compound standard types into a single token. + * Collapse compound standard types into a single token. * unsigned long long int => long _isUnsigned=true,_isLong=true */ void simplifyStdType(); @@ -201,7 +201,7 @@ public: void simplifyIfAssign(); /** - * Simplify multiple assignmetns. + * Simplify multiple assignments. * Example: "a = b = c = 0;" => "a = 0; b = 0; c = 0;" */ void simplifyVariableMultipleAssign(); @@ -294,7 +294,7 @@ public: */ bool simplifyConditions(); - /** Remove reduntant code, e.g. if( false ) { int a; } should be + /** Remove redundant code, e.g. if( false ) { int a; } should be * removed, because it is never executed. * @return true if something is modified * false if nothing is done. @@ -322,7 +322,7 @@ public: void simplifyStructDecl(); /** - * Remove redundant paranthesis: + * Remove redundant parenthesis: * - "((x))" => "(x)" * - "(function())" => "function()" * - "(delete x)" => "delete x" diff --git a/man/cppcheck.1.xml b/man/cppcheck.1.xml index bd241f9db..ec4a810e0 100644 --- a/man/cppcheck.1.xml +++ b/man/cppcheck.1.xml @@ -294,7 +294,7 @@ files, this is not needed. - Write results in xml to error stream + Write results in XML to error stream diff --git a/man/manual.docbook b/man/manual.docbook index e89361aa1..125ac9acd 100644 --- a/man/manual.docbook +++ b/man/manual.docbook @@ -396,7 +396,7 @@ uninitvar some tweaking you can improve the checking.
- User defined allocation/deallocation functions + User-defined allocation/deallocation functions Cppcheck understands many common allocation and deallocation functions. But not all. diff --git a/readme.txt b/readme.txt index 17f5610e1..8f746cd4e 100644 --- a/readme.txt +++ b/readme.txt @@ -9,7 +9,7 @@ About Manual - A manual is available online: + A manual is available online: http://cppcheck.sf.net/manual.pdf Compiling @@ -26,7 +26,7 @@ Compiling qmake ===== - You can use the gui/gui.pro file to build the gui. + You can use the gui/gui.pro file to build the GUI. cd gui qmake make diff --git a/readme_64-bit_Windows.txt b/readme_64-bit_Windows.txt index 3d67bb351..96e2842c2 100644 --- a/readme_64-bit_Windows.txt +++ b/readme_64-bit_Windows.txt @@ -18,7 +18,7 @@ tools, libraries or headers so you cannot compile 64-bit binaries without Windows SDK. To compile 64-bit binaries you need to start VS Express to 64-bit environment. -(by default VS Express starts to 32-bit enviroment). To do this, open Windows +(by default VS Express starts to 32-bit environment). To do this, open Windows SDK Command Prompt and switch to 64-bit environment with command: > setenv /x64 /debug diff --git a/test/testclass.cpp b/test/testclass.cpp index 8bdf17d80..bcd3cdf0b 100644 --- a/test/testclass.cpp +++ b/test/testclass.cpp @@ -580,7 +580,7 @@ private: "}\n"); ASSERT_EQUALS("", errout.str()); - // this test needs an assignment test but doesnt have it + // this test needs an assignment test but doesn’t have it checkOpertorEqToSelf( "class A\n" "{\n" @@ -1816,7 +1816,7 @@ private: "}\n"); ASSERT_EQUALS("[test.cpp:11]: (warning) Member variable not initialized in the constructor 'Foo::mMember'\n", errout.str()); - // constructor in seperate namespace + // constructor in separate namespace checkUninitVar("namespace Output\n" "{\n" " class Foo\n" @@ -1835,7 +1835,7 @@ private: "}\n"); ASSERT_EQUALS("[test.cpp:13]: (warning) Member variable not initialized in the constructor 'Foo::mMember'\n", errout.str()); - // constructor in different seperate namespace + // constructor in different separate namespace checkUninitVar("namespace Output\n" "{\n" " class Foo\n" @@ -1854,7 +1854,7 @@ private: "}\n"); ASSERT_EQUALS("", errout.str()); - // constructor in different seperate namespace (won't compile) + // constructor in different separate namespace (won't compile) checkUninitVar("namespace Output\n" "{\n" " class Foo\n" @@ -1873,7 +1873,7 @@ private: "}\n"); ASSERT_EQUALS("", errout.str()); - // constructor in nested seperate namespace + // constructor in nested separate namespace checkUninitVar("namespace A\n" "{\n" " namespace Output\n" @@ -1895,7 +1895,7 @@ private: "}\n"); ASSERT_EQUALS("[test.cpp:15]: (warning) Member variable not initialized in the constructor 'Foo::mMember'\n", errout.str()); - // constructor in nested different seperate namespace + // constructor in nested different separate namespace checkUninitVar("namespace A\n" "{\n" " namespace Output\n" @@ -1917,7 +1917,7 @@ private: "}\n"); ASSERT_EQUALS("", errout.str()); - // constructor in nested different seperate namespace + // constructor in nested different separate namespace checkUninitVar("namespace A\n" "{\n" " namespace Output\n" @@ -2467,7 +2467,7 @@ private: ASSERT_EQUALS("[fred.h:6]: (warning) Member variable not initialized in the constructor 'Fred::i'\n", errout.str()); } - // Borland C++: No FP for published pointers - they are automaticly initialized + // Borland C++: No FP for published pointers - they are automatically initialized void uninitVarPublished() { checkUninitVar("class Fred\n" @@ -3264,7 +3264,7 @@ private: ASSERT_EQUALS("[test.cpp:7] -> [test.cpp:3]: (style) The function 'Fred::foo' can be const\n" "[test.cpp:7] -> [test.cpp:4]: (style) The function 'Fred::foo' can be const\n", errout.str()); - // check functions with different or missing paramater names + // check functions with different or missing parameter names checkConst("class Fred {\n" " std::string s;\n" " void foo1(int, int);\n" diff --git a/test/testcppcheck.cpp b/test/testcppcheck.cpp index 90d6488b6..e9918265d 100644 --- a/test/testcppcheck.cpp +++ b/test/testcppcheck.cpp @@ -189,7 +189,7 @@ private: { TiXmlDocument doc; doc.Parse(xmlData); - // parsing must be successfull + // parsing must be successful ASSERT_EQUALS(false, doc.Error()); // root element must be "results" TiXmlElement* root = doc.FirstChildElement(); diff --git a/test/testmathlib.cpp b/test/testmathlib.cpp index 03086c227..10125691f 100644 --- a/test/testmathlib.cpp +++ b/test/testmathlib.cpp @@ -197,19 +197,19 @@ private: ASSERT_EQUALS(false, MathLib::isInt("-1.E+1")); ASSERT_EQUALS(false, MathLib::isInt("+1.E-1")); ASSERT_EQUALS(false, MathLib::isInt(" 1.0E+1")); - // with whitspaces in front + // with whitespace in front ASSERT_EQUALS(false, MathLib::isInt(" 1.0E-1")); ASSERT_EQUALS(false, MathLib::isInt(" -1.0E+1")); ASSERT_EQUALS(false, MathLib::isInt(" +1.0E-1")); ASSERT_EQUALS(false, MathLib::isInt(" -1.E+1")); ASSERT_EQUALS(false, MathLib::isInt(" +1.E-1")); - // with whitspaces in front and end + // with whitespace in front and end ASSERT_EQUALS(false, MathLib::isInt(" 1.0E-1 ")); ASSERT_EQUALS(false, MathLib::isInt(" -1.0E+1 ")); ASSERT_EQUALS(false, MathLib::isInt(" +1.0E-1 ")); ASSERT_EQUALS(false, MathLib::isInt(" -1.E+1 ")); ASSERT_EQUALS(false, MathLib::isInt(" +1.E-1 ")); - // with whitspaces in front and end + // with whitespace in front and end ASSERT_EQUALS(false, MathLib::isInt("1.0E-1 ")); ASSERT_EQUALS(false, MathLib::isInt("-1.0E+1 ")); ASSERT_EQUALS(false, MathLib::isInt("+1.0E-1 ")); diff --git a/test/testpreprocessor.cpp b/test/testpreprocessor.cpp index 3a491c0f4..88a9e5360 100644 --- a/test/testpreprocessor.cpp +++ b/test/testpreprocessor.cpp @@ -2022,7 +2022,7 @@ private: Settings settings; Preprocessor preprocessor(&settings, this); preprocessor.read(istr, "test.cpp", 0); - ASSERT_EQUALS("[test.cpp:1]: (error) The code contains characters that are unhandled. Neither unicode nor extended ascii are supported. (line=1, character code=c8)\n", errout.str()); + ASSERT_EQUALS("[test.cpp:1]: (error) The code contains characters that are unhandled. Neither Unicode nor extended ASCII are supported. (line=1, character code=c8)\n", errout.str()); } void unicodeInComment() diff --git a/test/testsimplifytokens.cpp b/test/testsimplifytokens.cpp index e2b6e5f5b..1742c0011 100644 --- a/test/testsimplifytokens.cpp +++ b/test/testsimplifytokens.cpp @@ -51,7 +51,7 @@ private: TEST_CASE(double_plus); TEST_CASE(redundant_plus); TEST_CASE(parantheses1); - TEST_CASE(paranthesesVar); // Remove redundant parantheses around variable .. "( %var% )" + TEST_CASE(paranthesesVar); // Remove redundant parentheses around variable .. "( %var% )" TEST_CASE(declareVar); TEST_CASE(declareArray); @@ -607,7 +607,7 @@ private: void paranthesesVar() { - // remove parantheses.. + // remove parentheses.. ASSERT_EQUALS("= p ;", tok("= (p);")); ASSERT_EQUALS("if ( a < p ) { }", tok("if(a<(p)){}")); ASSERT_EQUALS("void f ( ) { int p ; if ( p == -1 ) { } }", tok("void f(){int p; if((p)==-1){}}")); @@ -622,7 +622,7 @@ private: ASSERT_EQUALS("void f ( ) { int * p ; * p = 1 ; }", tok("void f(){int *p; *(p) = 1;}")); ASSERT_EQUALS("void f ( ) { int p ; if ( p ) { } p = 1 ; }", tok("void f(){int p; if ( p ) { } (p) = 1;}")); - // keep parantheses.. + // keep parentheses.. ASSERT_EQUALS("= a ;", tok("= (char)a;")); ASSERT_EQUALS("cast < char * > ( p )", tok("cast(p)")); ASSERT_EQUALS("return ( a + b ) * c ;", tok("return (a+b)*c;")); @@ -2842,7 +2842,7 @@ private: ASSERT_EQUALS("\"\\\\x61\"", tok("\"\\\\x61\"")); // These tests can fail, if other characters are handled - // more correctly. But fow now all non null characters should + // more correctly. But for now all non null characters should // become 'a' ASSERT_EQUALS("\"a\"", tok("\"\\x62\"")); ASSERT_EQUALS("\"a\"", tok("\"\\177\"")); diff --git a/test/testsuite.h b/test/testsuite.h index 747255192..69fb777d0 100644 --- a/test/testsuite.h +++ b/test/testsuite.h @@ -51,7 +51,7 @@ protected: void assertEquals(const char *filename, int linenr, const std::string &expected, const std::string &actual, const std::string &msg = ""); // the vars expected and actual need to be of type double, in order to avoid overflow of unsigned int - // e.g: ASSERT_EQUALS(-100.0, MathLib::toDoubleNumber("-1.0E+2")); whould not work without this. + // e.g: ASSERT_EQUALS(-100.0, MathLib::toDoubleNumber("-1.0E+2")); would not work without this. void assertEquals(const char *filename, int linenr, double expected, double actual, const std::string &msg=""); void todoAssertEquals(const char *filename, int linenr, const std::string &expected, const std::string &actual); diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 02b03d515..2edf9dd71 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -145,7 +145,7 @@ private: TEST_CASE(varid14); TEST_CASE(varid15); TEST_CASE(varid16); - TEST_CASE(varid17); // ticket #1810 + TEST_CASE(varid17); // ticket #1810 TEST_CASE(varid18); TEST_CASE(varid19); TEST_CASE(varid20); @@ -154,8 +154,8 @@ private: TEST_CASE(varid23); TEST_CASE(varid24); TEST_CASE(varid25); - TEST_CASE(varid26); // ticket #1967 (list of function pointers) - TEST_CASE(varid27); // Ticket #2280 (same name for namespace and variable) + TEST_CASE(varid26); // ticket #1967 (list of function pointers) + TEST_CASE(varid27); // Ticket #2280 (same name for namespace and variable) TEST_CASE(varidFunctionCall1); TEST_CASE(varidFunctionCall2); TEST_CASE(varidStl); @@ -509,7 +509,7 @@ private: - // Dont remove "(int *)".. + // Don’t remove "(int *)".. void removeCast1() { const char code[] = "int *f(int *);";