From 3d8ac3d0a171889fb87c5b64a3a2237951fa5301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 30 Jul 2014 17:53:41 +0200 Subject: [PATCH] astyle formatting [ci skip] --- tools/reduce.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/reduce.cpp b/tools/reduce.cpp index 6e8fbc2d8..994177dbe 100644 --- a/tools/reduce.cpp +++ b/tools/reduce.cpp @@ -114,7 +114,8 @@ static void printstr(const std::vector &filedata, int i1, int i2) } #endif -static char getEndChar(const std::string &line) { +static char getEndChar(const std::string &line) +{ std::size_t pos = line.find_last_not_of(" \t"); return (pos == std::string::npos) ? '\0' : line[pos]; } @@ -179,7 +180,7 @@ static std::vector readfile(const std::string &filename) filedata.push_back(line); } - + // put declarations in a single line.. for (unsigned int linenr = 0U; linenr+1U < filedata.size(); ++linenr) { // Does this look like start of a function declaration? @@ -192,7 +193,7 @@ static std::vector readfile(const std::string &filename) // Where does function declaration end? unsigned int linenr2 = linenr + 1U; - while (linenr2 < filedata.size() && + while (linenr2 < filedata.size() && getEndChar(filedata[linenr2]) == ',' && filedata[linenr2].find("(") == std::string::npos && filedata[linenr2].find(")") == std::string::npos) @@ -212,7 +213,7 @@ static std::vector readfile(const std::string &filename) filedata[linenr] = code; } } - + return filedata; }