From 4f2520bef323aeccd19f6c7316028812d086d787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 14 Jul 2009 08:17:12 +0200 Subject: [PATCH] doxygen: made the todos visible in the doxygen output --- src/checkclass.cpp | 15 +++++++-------- src/checkmemoryleak.cpp | 7 +++---- src/checkmemoryleak.h | 2 +- src/checkunusedfunctions.cpp | 3 ++- src/preprocessor.cpp | 12 +++++++----- src/token.cpp | 1 - src/tokenize.cpp | 6 +++--- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/checkclass.cpp b/src/checkclass.cpp index ee40d27a2..6562f3051 100644 --- a/src/checkclass.cpp +++ b/src/checkclass.cpp @@ -273,7 +273,7 @@ void CheckClass::constructors() className[1] = 0; const Token *classNameToken = tok1->tokAt(1); - // TODO: handling of private constructors should be improved. + /** @todo handling of private constructors should be improved */ bool hasPrivateConstructor = false; { int indentlevel = 0; @@ -312,8 +312,8 @@ void CheckClass::constructors() if (hasPrivateConstructor) { - // TODO: Handle private constructors. - // Right now to avoid false positives I just bail out + /** @todo Handle private constructors. Right now to avoid + * false positives we just bail out */ tok1 = Token::findmatch(tok1->next(), pattern_class); continue; } @@ -439,9 +439,9 @@ void CheckClass::privateFunctions() // Locate some class for (const Token *tok1 = Token::findmatch(_tokenizer->tokens(), "class %var% {"); tok1; tok1 = Token::findmatch(tok1->next(), "class %var% {")) { - // If the class implementation is incomplete there may be false positives about unused private functions. - // Therefore I only check classes that are declared in the source file. - // Todo: check classes that are declared in header file too. make sure the whole implementation is seen. + /** @todo check that the whole class implementation is seen */ + // until the todo above is fixed we only check classes that are + // declared in the source file if (tok1->fileIndex() != 0) continue; @@ -456,7 +456,7 @@ void CheckClass::privateFunctions() { if (Token::Match(tok, "friend %var%")) { - // Todo: Handle friend classes + /** @todo Handle friend classes */ FuncList.clear(); break; } @@ -588,7 +588,6 @@ void CheckClass::noMemset() if (!Token::Match(tok, "memset|memcpy|memmove")) continue; - // Todo: Handle memcpy and memmove const char *type = NULL; if (Token::Match(tok, "memset ( %var% , %num% , sizeof ( %type% ) )")) type = tok->strAt(8); diff --git a/src/checkmemoryleak.cpp b/src/checkmemoryleak.cpp index 5feb156d6..e8484cede 100644 --- a/src/checkmemoryleak.cpp +++ b/src/checkmemoryleak.cpp @@ -532,7 +532,7 @@ const char * CheckMemoryLeakInFunction::call_func(const Token *tok, std::listnext(); const char *ret = 0; - // TODO : "goto" isn't handled well + /** @todo handle "goto" */ if (Token::findmatch(func_, "dealloc")) ret = "dealloc"; else if (Token::findmatch(func_, "use")) @@ -1119,7 +1119,6 @@ void CheckMemoryLeakInFunction::simplifycode(Token *tok, bool &all) done = false; } - // TODO Make this more generic. Delete "if ; else use ; use" else if (Token::Match(tok2, "; if ; else assign|use ; assign|use") || Token::Match(tok2, "; if assign|use ; else ; assign|use")) { @@ -1274,7 +1273,7 @@ void CheckMemoryLeakInFunction::simplifycode(Token *tok, bool &all) } // Reduce "do { alloc ; } " => "alloc ;" - // TODO: If the loop can be executed twice reduce to "loop alloc ;" instead + /** @todo If the loop "do { alloc ; }" can be executed twice, reduce it to "loop alloc ;" */ if (Token::simpleMatch(tok2->next(), "do { alloc ; }")) { Token::eraseTokens(tok2, tok2->tokAt(3)); @@ -1552,7 +1551,7 @@ void CheckMemoryLeakInFunction::checkScope(const Token *Tok1, const char varname return; } - // TODO : handle "goto" + /** @todo handle "goto" */ if (Token::findmatch(tok, "goto")) { Tokenizer::deleteTokens(tok); diff --git a/src/checkmemoryleak.h b/src/checkmemoryleak.h index ee6374bd3..3fe0f9811 100644 --- a/src/checkmemoryleak.h +++ b/src/checkmemoryleak.h @@ -233,7 +233,7 @@ public: void check() { - // TODO + /** @todo implement this */ } private: diff --git a/src/checkunusedfunctions.cpp b/src/checkunusedfunctions.cpp index 16fe2f26f..73396581f 100644 --- a/src/checkunusedfunctions.cpp +++ b/src/checkunusedfunctions.cpp @@ -172,7 +172,8 @@ void CheckUnusedFunctions::check() } else if (! func.usedOtherFile) { - /* TODO - add error message "function is only used in it can be static" + /** @todo add error message "function is only used in it can be static" */ + /* std::ostringstream errmsg; errmsg << "The function '" << it->first << "' is only used in the file it was declared in so it should have local linkage."; _errorLogger->reportErr( errmsg.str() ); diff --git a/src/preprocessor.cpp b/src/preprocessor.cpp index 3b98a7121..b36e8d5bc 100644 --- a/src/preprocessor.cpp +++ b/src/preprocessor.cpp @@ -75,10 +75,12 @@ void Preprocessor::writeError(const std::string &fileName, const std::string &co // UTF / extended ASCII => The output from the preprocessor should only be standard ASCII if (ch < 0) { - // TODO: Remove characters that are redundant - - // TODO: Convert characters that are needed to standard ASCII - + /** + * @todo handle utf better: + * - remove characters that are redundant + * - convert needed characters to standard ASCII + */ + // Not sure how to handle this character. Bailing out. if (ch < 0) continue; @@ -703,7 +705,7 @@ bool Preprocessor::match_cfg_def(std::string cfg, std::string def) std::string::size_type pos1 = pos + 8; const std::string par(def.substr(pos1, pos2 - pos1)); - // TODO: better checking if parameter is defined + /** @todo better checking if parameter is defined */ const bool isdefined(cfg.find(par) != std::string::npos); def.erase(pos, pos2 + 1 - pos); diff --git a/src/token.cpp b/src/token.cpp index 1902080bc..f7dea2b28 100644 --- a/src/token.cpp +++ b/src/token.cpp @@ -271,7 +271,6 @@ bool Token::Match(const Token *tok, const char pattern[], unsigned int varid) ++p; // Extract token from pattern.. - // TODO: Refactor this so there can't be buffer overflows char str[500]; char *s = str; while (*p && *p != ' ') diff --git a/src/tokenize.cpp b/src/tokenize.cpp index 8fecff96d..d1dfe0f71 100644 --- a/src/tokenize.cpp +++ b/src/tokenize.cpp @@ -1247,8 +1247,8 @@ void Tokenizer::simplifyTokenList() } else if (Token::simpleMatch(tempToken->next(), "[")) { - // TODO: We need to find closing ], then check for - // dots and arrows "var[some[0]]->other" + /** @todo We need to find closing ], then check for + * dots and arrows "var[some[0]]->other" */ // But for now, just bail out break; @@ -2823,7 +2823,7 @@ void Tokenizer::fillFunctionList() } // If the _functionList functions with duplicate names, remove them - // TODO this will need some better handling + /** @todo handle when functions with the same name */ for (unsigned int func1 = 0; func1 < _functionList.size();) { bool hasDuplicates = false;