From 227a6100f7a5e8cda4fa18aceb720b88a6bb82ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 11 Feb 2011 19:31:37 +0100 Subject: [PATCH] astyle formatting --- lib/checkclass.cpp | 2 +- lib/preprocessor.cpp | 17 ++++++++++++----- lib/preprocessor.h | 2 +- tools/dmake.cpp | 2 +- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index 0d71e4ad0..ddbef4288 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -644,7 +644,7 @@ void CheckClass::privateFunctions() while (ftok->str() != "{") ftok = ftok->next(); const Token *etok = ftok->link(); - + for (; ftok != etok; ftok = ftok->next()) { if (Token::Match(ftok, "%var% (")) diff --git a/lib/preprocessor.cpp b/lib/preprocessor.cpp index 638e07b29..091da7ea0 100644 --- a/lib/preprocessor.cpp +++ b/lib/preprocessor.cpp @@ -208,7 +208,8 @@ std::string Preprocessor::preprocessCleanupDirectives(const std::string &process // Preprocessor if (!line.empty() && line[0] == '#') { - enum { + enum + { ESC_NONE, ESC_SINGLE, ESC_DOUBLE @@ -221,7 +222,7 @@ std::string Preprocessor::preprocessCleanupDirectives(const std::string &process // need space.. #if( => #if ( bool needSpace = true; - while(i != line.end()) + while (i != line.end()) { // disable esc-mode if (escapeStatus != ESC_NONE) @@ -234,7 +235,9 @@ std::string Preprocessor::preprocessCleanupDirectives(const std::string &process { escapeStatus = ESC_NONE; } - } else { + } + else + { // enable esc-mode if (escapeStatus == ESC_NONE && *i == '"') escapeStatus = ESC_DOUBLE; @@ -264,7 +267,9 @@ std::string Preprocessor::preprocessCleanupDirectives(const std::string &process if (escapeStatus != ESC_NONE && prev == '\\' && *i == '\\') { prev = ' '; - } else { + } + else + { prev = *i; } i++; @@ -273,7 +278,9 @@ std::string Preprocessor::preprocessCleanupDirectives(const std::string &process { // unmatched quotes.. compiler should probably complain about this.. } - } else { + } + else + { // Do not mess with regular code.. code << line; } diff --git a/lib/preprocessor.h b/lib/preprocessor.h index a6829efea..82f5da2bd 100644 --- a/lib/preprocessor.h +++ b/lib/preprocessor.h @@ -152,7 +152,7 @@ protected: static std::string removeParantheses(const std::string &str); /** - * clean up #-preprocessor lines (only) + * clean up #-preprocessor lines (only) * @param processedFile The data to be processed */ std::string preprocessCleanupDirectives(const std::string &processedFile) const; diff --git a/tools/dmake.cpp b/tools/dmake.cpp index 08da9124c..ea7cdcb34 100644 --- a/tools/dmake.cpp +++ b/tools/dmake.cpp @@ -251,7 +251,7 @@ int main(int argc, char **argv) makeConditionalVariable(fout, "INCLUDE_FOR_LIB", "-Ilib"); makeConditionalVariable(fout, "INCLUDE_FOR_CLI", "-Ilib -Iexternals -Iexternals/tinyxml"); makeConditionalVariable(fout, "INCLUDE_FOR_TEST", "-Ilib -Icli -Iexternals -Iexternals/tinyxml"); - + fout << "BIN=$(DESTDIR)$(PREFIX)/bin\n\n"; fout << "# For 'make man': sudo apt-get install xsltproc docbook-xsl docbook-xml on Linux\n"; fout << "DB2MAN=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl\n";