astyle formatting

This commit is contained in:
Daniel Marjamäki 2011-02-11 19:31:37 +01:00
parent c7821675dd
commit 227a6100f7
4 changed files with 15 additions and 8 deletions

View File

@ -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% ("))

View File

@ -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;
}

View File

@ -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;

View File

@ -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";