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.
This commit is contained in:
Kitware Robot
2018-06-01 09:53:41 -04:00
committed by Brad King
parent 12fed3edb1
commit d7204e649e
445 changed files with 3734 additions and 3181 deletions

View File

@@ -17,7 +17,7 @@ extern "C" {
#include <stdio.h>
#include <sys/stat.h>
#if !defined(S_ISDIR)
#define S_ISDIR(mode) ((mode)&_S_IFDIR)
# define S_ISDIR(mode) ((mode)&_S_IFDIR)
#endif
#ifdef COMPLEX_TEST_LINK_STATIC
@@ -45,23 +45,23 @@ void cmPassed(const char* Message, const char* m2 = "")
}
#ifndef COMPLEX_DEFINED_PRE
#error "COMPLEX_DEFINED_PRE not defined!"
# error "COMPLEX_DEFINED_PRE not defined!"
#endif
#ifdef COMPLEX_DEFINED
#error "COMPLEX_DEFINED is defined but it should not!"
# error "COMPLEX_DEFINED is defined but it should not!"
#endif
#ifndef COMPLEX_DEFINED_POST
#error "COMPLEX_DEFINED_POST not defined!"
# error "COMPLEX_DEFINED_POST not defined!"
#endif
#ifndef CMAKE_IS_REALLY_FUN
#error This is a problem. Looks like ADD_DEFINITIONS and REMOVE_DEFINITIONS does not work
# error This is a problem. Looks like ADD_DEFINITIONS and REMOVE_DEFINITIONS does not work
#endif
#if defined(NDEBUG) && !defined(CMAKE_IS_FUN_IN_RELEASE_MODE)
#error Per-configuration directory-level definition not inherited.
# error Per-configuration directory-level definition not inherited.
#endif
// ======================================================================
@@ -200,8 +200,8 @@ int main()
cmFailed(msg);
}
// ----------------------------------------------------------------------
// Test ADD_DEFINITIONS
// ----------------------------------------------------------------------
// Test ADD_DEFINITIONS
#ifndef CMAKE_IS_FUN
cmFailed("CMake is not fun, so it is broken and should be fixed.");
@@ -240,8 +240,8 @@ int main()
cmPassed("CMake found the listfile stack properly");
#endif
// ----------------------------------------------------------------------
// Test SET, VARIABLE_REQUIRES
// ----------------------------------------------------------------------
// Test SET, VARIABLE_REQUIRES
#ifdef SHOULD_NOT_BE_DEFINED
cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED is defined.");
@@ -297,8 +297,8 @@ int main()
}
#endif
// ----------------------------------------------------------------------
// Test various IF/ELSE combinations
// ----------------------------------------------------------------------
// Test various IF/ELSE combinations
#ifdef SHOULD_NOT_BE_DEFINED_NOT
cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_NOT is defined.");
@@ -740,8 +740,8 @@ int main()
cmPassed("SHOULD_BE_DEFINED_STRGREATER_EQUAL3 is defined.");
#endif
// ----------------------------------------------------------------------
// Test FOREACH
// ----------------------------------------------------------------------
// Test FOREACH
#ifndef FOREACH_VAR1
cmFailed("the FOREACH, SET or CONFIGURE_FILE command is broken, "
@@ -791,8 +791,8 @@ int main()
cmPassed("WHILE command is working");
}
// ----------------------------------------------------------------------
// Test LOAD_CACHE
// ----------------------------------------------------------------------
// Test LOAD_CACHE
#ifndef CACHE_TEST_VAR1
cmFailed("the LOAD_CACHE or CONFIGURE_FILE command is broken, "
@@ -901,8 +901,8 @@ int main()
TestAndRemoveFile("Executable/Temp/complex-required.txt");
// ----------------------------------------------------------------------
// Test FIND_LIBRARY
// ----------------------------------------------------------------------
// Test FIND_LIBRARY
#ifndef FIND_DUMMY_LIB
cmFailed("the CONFIGURE_FILE command is broken, "
@@ -917,8 +917,8 @@ int main()
}
#endif
// ----------------------------------------------------------------------
// Test SET_SOURCE_FILES_PROPERTIES
// ----------------------------------------------------------------------
// Test SET_SOURCE_FILES_PROPERTIES
#ifndef FILE_HAS_EXTRA_COMPILE_FLAGS
cmFailed("SET_SOURCE_FILES_PROPERTIES failed at setting "
@@ -929,9 +929,9 @@ int main()
#endif
#if 0 // Disable until implemented everywhere.
#ifndef FILE_DEFINE_STRING
# ifndef FILE_DEFINE_STRING
cmFailed("SET_SOURCE_FILES_PROPERTIES failed at setting FILE_DEFINE_STRING flag");
#else
# else
if(strcmp(FILE_DEFINE_STRING, "hello") != 0)
{
cmFailed("SET_SOURCE_FILES_PROPERTIES failed at setting FILE_DEFINE_STRING flag correctly");
@@ -940,7 +940,7 @@ int main()
{
cmPassed("SET_SOURCE_FILES_PROPERTIES succeeded in setting FILE_DEFINE_STRING flag");
}
#endif
# endif
#endif
#ifndef FILE_HAS_ABSTRACT
@@ -973,10 +973,10 @@ int main()
// ----------------------------------------------------------------------
// Test registry (win32)
#if defined(_WIN32) && !defined(__CYGWIN__)
#ifndef REGISTRY_TEST_PATH
# ifndef REGISTRY_TEST_PATH
cmFailed("the CONFIGURE_FILE command is broken, REGISTRY_TEST_PATH is not "
"defined.");
#else
# else
std::cout << "REGISTRY_TEST_PATH == " << REGISTRY_TEST_PATH << "\n";
if (stricmp(REGISTRY_TEST_PATH, BINARY_DIR "/registry_dir") != 0) {
cmFailed("the 'read registry value' function or CONFIGURE_FILE command is "
@@ -985,7 +985,7 @@ int main()
} else {
cmPassed("REGISTRY_TEST_PATH == ", REGISTRY_TEST_PATH);
}
#endif
# endif
#endif // defined(_WIN32) && !defined(__CYGWIN__)
if (strcmp(CMAKE_MINIMUM_REQUIRED_VERSION, "2.4") == 0) {

View File

@@ -1,5 +1,5 @@
#if 0
#include "cmMissingHeader.h"
# include "cmMissingHeader.h"
#endif
int main(int, char**)

View File

@@ -6,5 +6,5 @@ int main()
}
#if 1
#error "This target should not be compiled by ALL."
# error "This target should not be compiled by ALL."
#endif