From 588aad93ae53b59f8eca7d854ec6fb99a87f507f Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Mon, 8 Apr 2019 11:51:43 -0400 Subject: Revise C++ coding style using clang-format-6.0 Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit. --- src/Detect.cxx | 4 ++-- src/Output.cxx | 2 ++ src/RunClang.cxx | 2 +- src/Utils.cxx | 2 +- src/castxml.cxx | 4 ++-- .../castxml1.any.Typedef-to-Enumeration-anonymous.xml.txt | 2 +- test/expect/castxml1.c++11.Class-template-bases.xml.txt | 14 +++++++------- test/expect/castxml1.c++14.Class-template-bases.xml.txt | 14 +++++++------- test/expect/castxml1.c++17.Class-template-bases.xml.txt | 14 +++++++------- test/expect/castxml1.c++98.Class-template-bases.xml.txt | 14 +++++++------- .../gccxml.any.Typedef-to-Enumeration-anonymous.xml.txt | 2 +- test/expect/gccxml.c++11.Class-template-bases.xml.txt | 14 +++++++------- test/expect/gccxml.c++14.Class-template-bases.xml.txt | 14 +++++++------- test/expect/gccxml.c++17.Class-template-bases.xml.txt | 14 +++++++------- test/expect/gccxml.c++98.Class-template-bases.xml.txt | 14 +++++++------- test/input/Class-base-offset.cxx | 5 ++++- test/input/Class-bases.cxx | 7 ++++--- test/input/Class-template-bases.cxx | 4 +++- test/input/Typedef-to-Enumeration-anonymous.cxx | 4 +++- 19 files changed, 80 insertions(+), 70 deletions(-) diff --git a/src/Detect.cxx b/src/Detect.cxx index 21bfef2..2ef5ae8 100644 --- a/src/Detect.cxx +++ b/src/Detect.cxx @@ -40,8 +40,8 @@ static bool failedCC(const char* id, std::vector const& args, { std::cerr << "error: '--castxml-cc-" << id << "' compiler command failed:\n\n"; - for (std::vector::const_iterator i = args.begin(), - e = args.end(); + for (std::vector::const_iterator i = args.begin(), + e = args.end(); i != e; ++i) { std::cerr << " '" << *i << "'"; } diff --git a/src/Output.cxx b/src/Output.cxx index 9047921..2c4c25e 100644 --- a/src/Output.cxx +++ b/src/Output.cxx @@ -65,6 +65,7 @@ protected: private: typedef void (DumpQual::*bool_type)() const; void bool_true() const {} + public: bool IsConst; bool IsVolatile; @@ -113,6 +114,7 @@ protected: private: typedef void (DumpId::*bool_type)() const; void bool_true() const {} + public: unsigned int Id; DumpQual Qual; diff --git a/src/RunClang.cxx b/src/RunClang.cxx index edf18a5..cf1e674 100644 --- a/src/RunClang.cxx +++ b/src/RunClang.cxx @@ -53,7 +53,7 @@ #if LLVM_VERSION_MAJOR > 3 || \ LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 9 -#define CASTXML_OWNS_OSTREAM +# define CASTXML_OWNS_OSTREAM #endif class ASTConsumer : public clang::ASTConsumer diff --git a/src/Utils.cxx b/src/Utils.cxx index a7b5245..7846b0b 100644 --- a/src/Utils.cxx +++ b/src/Utils.cxx @@ -230,7 +230,7 @@ std::string stringReplace(std::string str, std::string const& in, } #if defined(_WIN32) -#include +# include #endif void suppressInteractiveErrors() diff --git a/src/castxml.cxx b/src/castxml.cxx index 4989857..c15804a 100644 --- a/src/castxml.cxx +++ b/src/castxml.cxx @@ -29,7 +29,7 @@ #include "llvm/Support/raw_ostream.h" #if LLVM_VERSION_MAJOR >= 7 -#include "llvm/Support/InitLLVM.h" +# include "llvm/Support/InitLLVM.h" #endif #include @@ -41,7 +41,7 @@ #if LLVM_VERSION_MAJOR > 3 || \ LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7 -#include "llvm/Support/StringSaver.h" +# include "llvm/Support/StringSaver.h" #else class StringSaver : public llvm::cl::StringSaver { diff --git a/test/expect/castxml1.any.Typedef-to-Enumeration-anonymous.xml.txt b/test/expect/castxml1.any.Typedef-to-Enumeration-anonymous.xml.txt index 9a316e2..53b887f 100644 --- a/test/expect/castxml1.any.Typedef-to-Enumeration-anonymous.xml.txt +++ b/test/expect/castxml1.any.Typedef-to-Enumeration-anonymous.xml.txt @@ -1,6 +1,6 @@ ^<\?xml version="1.0"\?> ]*> - + diff --git a/test/expect/castxml1.c++11.Class-template-bases.xml.txt b/test/expect/castxml1.c++11.Class-template-bases.xml.txt index 72b4cac..da4642f 100644 --- a/test/expect/castxml1.c++11.Class-template-bases.xml.txt +++ b/test/expect/castxml1.c++11.Class-template-bases.xml.txt @@ -1,17 +1,17 @@ ^<\?xml version="1.0"\?> ]*> - + - - - + + + - - + + - + diff --git a/test/expect/castxml1.c++14.Class-template-bases.xml.txt b/test/expect/castxml1.c++14.Class-template-bases.xml.txt index 72b4cac..da4642f 100644 --- a/test/expect/castxml1.c++14.Class-template-bases.xml.txt +++ b/test/expect/castxml1.c++14.Class-template-bases.xml.txt @@ -1,17 +1,17 @@ ^<\?xml version="1.0"\?> ]*> - + - - - + + + - - + + - + diff --git a/test/expect/castxml1.c++17.Class-template-bases.xml.txt b/test/expect/castxml1.c++17.Class-template-bases.xml.txt index 72b4cac..da4642f 100644 --- a/test/expect/castxml1.c++17.Class-template-bases.xml.txt +++ b/test/expect/castxml1.c++17.Class-template-bases.xml.txt @@ -1,17 +1,17 @@ ^<\?xml version="1.0"\?> ]*> - + - - - + + + - - + + - + diff --git a/test/expect/castxml1.c++98.Class-template-bases.xml.txt b/test/expect/castxml1.c++98.Class-template-bases.xml.txt index f1a527c..a4c7d2f 100644 --- a/test/expect/castxml1.c++98.Class-template-bases.xml.txt +++ b/test/expect/castxml1.c++98.Class-template-bases.xml.txt @@ -1,17 +1,17 @@ ^<\?xml version="1.0"\?> ]*> - + - - - + + + - - + + - + diff --git a/test/expect/gccxml.any.Typedef-to-Enumeration-anonymous.xml.txt b/test/expect/gccxml.any.Typedef-to-Enumeration-anonymous.xml.txt index 2a382b2..df57362 100644 --- a/test/expect/gccxml.any.Typedef-to-Enumeration-anonymous.xml.txt +++ b/test/expect/gccxml.any.Typedef-to-Enumeration-anonymous.xml.txt @@ -1,6 +1,6 @@ ^<\?xml version="1.0"\?> ]*> - + diff --git a/test/expect/gccxml.c++11.Class-template-bases.xml.txt b/test/expect/gccxml.c++11.Class-template-bases.xml.txt index e09f577..73162cd 100644 --- a/test/expect/gccxml.c++11.Class-template-bases.xml.txt +++ b/test/expect/gccxml.c++11.Class-template-bases.xml.txt @@ -1,17 +1,17 @@ ^<\?xml version="1.0"\?> ]*> - + - - - + + + - - + + - + diff --git a/test/expect/gccxml.c++14.Class-template-bases.xml.txt b/test/expect/gccxml.c++14.Class-template-bases.xml.txt index e09f577..73162cd 100644 --- a/test/expect/gccxml.c++14.Class-template-bases.xml.txt +++ b/test/expect/gccxml.c++14.Class-template-bases.xml.txt @@ -1,17 +1,17 @@ ^<\?xml version="1.0"\?> ]*> - + - - - + + + - - + + - + diff --git a/test/expect/gccxml.c++17.Class-template-bases.xml.txt b/test/expect/gccxml.c++17.Class-template-bases.xml.txt index e09f577..73162cd 100644 --- a/test/expect/gccxml.c++17.Class-template-bases.xml.txt +++ b/test/expect/gccxml.c++17.Class-template-bases.xml.txt @@ -1,17 +1,17 @@ ^<\?xml version="1.0"\?> ]*> - + - - - + + + - - + + - + diff --git a/test/expect/gccxml.c++98.Class-template-bases.xml.txt b/test/expect/gccxml.c++98.Class-template-bases.xml.txt index aefed78..28f3eb8 100644 --- a/test/expect/gccxml.c++98.Class-template-bases.xml.txt +++ b/test/expect/gccxml.c++98.Class-template-bases.xml.txt @@ -1,17 +1,17 @@ ^<\?xml version="1.0"\?> ]*> - + - - - + + + - - + + - + diff --git a/test/input/Class-base-offset.cxx b/test/input/Class-base-offset.cxx index 255130d..13f547d 100644 --- a/test/input/Class-base-offset.cxx +++ b/test/input/Class-base-offset.cxx @@ -10,6 +10,9 @@ class base_3 { char b3; }; -class start : public base_1, public base_2, public base_3 +class start + : public base_1 + , public base_2 + , public base_3 { }; diff --git a/test/input/Class-bases.cxx b/test/input/Class-bases.cxx index b38bd8a..3ce6ab3 100644 --- a/test/input/Class-bases.cxx +++ b/test/input/Class-bases.cxx @@ -7,8 +7,9 @@ class base_private class base_protected { }; -class start : public base_public, - private base_private, - virtual protected base_protected +class start + : public base_public + , private base_private + , virtual protected base_protected { }; diff --git a/test/input/Class-template-bases.cxx b/test/input/Class-template-bases.cxx index b446021..d10ad59 100644 --- a/test/input/Class-template-bases.cxx +++ b/test/input/Class-template-bases.cxx @@ -6,7 +6,9 @@ class dependent_base { }; template -class start : public non_dependent_base, public dependent_base +class start + : public non_dependent_base + , public dependent_base { }; template class start; // instantiation diff --git a/test/input/Typedef-to-Enumeration-anonymous.cxx b/test/input/Typedef-to-Enumeration-anonymous.cxx index efcbc45..a31bca3 100644 --- a/test/input/Typedef-to-Enumeration-anonymous.cxx +++ b/test/input/Typedef-to-Enumeration-anonymous.cxx @@ -1 +1,3 @@ -typedef enum {} start; +typedef enum +{ +} start; -- cgit v0.12