From 522f4c18c85f8bf7b7d2ee3ca4c0e836efca9198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 23 Aug 2009 17:17:57 +0200 Subject: [PATCH] astyle formatting --- src/checkmemoryleak.cpp | 4 +-- src/token.h | 75 ++++++++++++++++++++++++++++++++--------- 2 files changed, 62 insertions(+), 17 deletions(-) diff --git a/src/checkmemoryleak.cpp b/src/checkmemoryleak.cpp index 2a7d0b49d..203560c8e 100644 --- a/src/checkmemoryleak.cpp +++ b/src/checkmemoryleak.cpp @@ -475,8 +475,8 @@ static int countParameters(const Token *tok) const char * CheckMemoryLeakInFunction::call_func(const Token *tok, std::list callstack, const unsigned int varid, AllocType &alloctype, AllocType &dealloctype, bool &all, unsigned int sz) { if (bsearch(tok->str().c_str(), call_func_white_list, - sizeof(call_func_white_list) / sizeof(call_func_white_list[0]), - sizeof(call_func_white_list[0]), call_func_white_list_compare)) + sizeof(call_func_white_list) / sizeof(call_func_white_list[0]), + sizeof(call_func_white_list[0]), call_func_white_list_compare)) return 0; if (getAllocationType(tok, varid) != No || getReallocationType(tok, varid) != No || getDeallocationType(tok, varid) != No) diff --git a/src/token.h b/src/token.h index 181f7dcd4..a40831d69 100644 --- a/src/token.h +++ b/src/token.h @@ -117,9 +117,18 @@ public: */ static bool Match(const Token *tok, const char pattern[], unsigned int varid = 0); - bool isName() const { return _isName; } - bool isNumber() const { return _isNumber; } - bool isBoolean() const { return _isBoolean; } + bool isName() const + { + return _isName; + } + bool isNumber() const + { + return _isNumber; + } + bool isBoolean() const + { + return _isBoolean; + } bool isStandardType() const; static const Token *findmatch(const Token *tok, const char pattern[], unsigned int varId = 0); @@ -139,13 +148,28 @@ public: */ static int multiCompare(const char *haystack, const char *needle); - unsigned int linenr() const { return _linenr; } - void linenr(unsigned int linenr) { _linenr = linenr; } + unsigned int linenr() const + { + return _linenr; + } + void linenr(unsigned int linenr) + { + _linenr = linenr; + } - unsigned int fileIndex() const { return _fileIndex; } - void fileIndex(unsigned int fileIndex) { _fileIndex = fileIndex; } + unsigned int fileIndex() const + { + return _fileIndex; + } + void fileIndex(unsigned int fileIndex) + { + _fileIndex = fileIndex; + } - Token *next() const { return _next; } + Token *next() const + { + return _next; + } /** @@ -164,11 +188,20 @@ public: */ void insertToken(const char str[]); - Token *previous() const { return _previous; } + Token *previous() const + { + return _previous; + } - unsigned int varId() const { return _varId; } - void varId(unsigned int id) { _varId = id; } + unsigned int varId() const + { + return _varId; + } + void varId(unsigned int id) + { + _varId = id; + } /** * For debugging purposes, prints token and all tokens @@ -202,7 +235,10 @@ public: * @param link The token where this token should link * to. */ - void link(Token *link) { _link = link; } + void link(Token *link) + { + _link = link; + } /** * Return token where this token links to. @@ -211,7 +247,10 @@ public: * * @return The token where this token links to. */ - Token *link() const { return _link; } + Token *link() const + { + return _link; + } /** * Links two elements against each other. @@ -219,8 +258,14 @@ public: static void createMutualLinks(Token *begin, Token *end); private: - void next(Token *next) { _next = next; } - void previous(Token *previous) { _previous = previous; } + void next(Token *next) + { + _next = next; + } + void previous(Token *previous) + { + _previous = previous; + } /** * Works almost like strcmp() except returns only 0 or 1 and