Commit d9fd2f54 authored by Kitware Robot's avatar Kitware Robot Committed by Brad King

Revise C++ coding style using clang-format

Run the `Utilities/Scripts/clang-format.bash` script to update
all our C++ code to a new style defined by `.clang-format`.
Use `clang-format` version 3.8.

* 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.
parent 82df6dea

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

#ifdef __cplusplus #ifdef __cplusplus
# error "A C++ compiler has been selected for C." #error "A C++ compiler has been selected for C."
#endif #endif
#ifdef __CLASSIC_C__ #ifdef __CLASSIC_C__
# define const #define const
#endif #endif
#include "CMakeCompilerABI.h" #include "CMakeCompilerABI.h"
#ifdef __CLASSIC_C__ #ifdef __CLASSIC_C__
int main(argc, argv) int argc; char *argv[]; int main(argc, argv) int argc;
char* argv[];
#else #else
int main(int argc, char *argv[]) int main(int argc, char* argv[])
#endif #endif
{ {
int require = 0; int require = 0;
......
#ifndef __cplusplus #ifndef __cplusplus
# error "A C compiler has been selected for C++." #error "A C compiler has been selected for C++."
#endif #endif
#include "CMakeCompilerABI.h" #include "CMakeCompilerABI.h"
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
int require = 0; int require = 0;
......
/* Size of a pointer-to-data in bytes. */ /* Size of a pointer-to-data in bytes. */
#define SIZEOF_DPTR (sizeof(void*)) #define SIZEOF_DPTR (sizeof(void*))
const char info_sizeof_dptr[] = { const char info_sizeof_dptr[] = {
'I', 'N', 'F', 'O', ':', 's', 'i', 'z', 'e', 'o', 'f', '_', 'd', 'p', 't', 'r', '[', 'I', 'N', 'F', 'O', ':', 's', 'i', 'z', 'e', 'o', 'f', '_', 'd', 'p', 't',
('0' + ((SIZEOF_DPTR / 10)%10)), 'r', '[', ('0' + ((SIZEOF_DPTR / 10) % 10)), ('0' + (SIZEOF_DPTR % 10)), ']',
('0' + (SIZEOF_DPTR % 10)), '\0'
']','\0'
/* clang-format needs this comment to break after the opening brace */ /* clang-format needs this comment to break after the opening brace */
}; };
/* Application Binary Interface. */ /* Application Binary Interface. */
#if defined(__sgi) && defined(_ABIO32) #if defined(__sgi) && defined(_ABIO32)
# define ABI_ID "ELF O32" #define ABI_ID "ELF O32"
#elif defined(__sgi) && defined(_ABIN32) #elif defined(__sgi) && defined(_ABIN32)
# define ABI_ID "ELF N32" #define ABI_ID "ELF N32"
#elif defined(__sgi) && defined(_ABI64) #elif defined(__sgi) && defined(_ABI64)
# define ABI_ID "ELF 64" #define ABI_ID "ELF 64"
/* Check for (some) ARM ABIs. /* Check for (some) ARM ABIs.
* See e.g. http://wiki.debian.org/ArmEabiPort for some information on this. */ * See e.g. http://wiki.debian.org/ArmEabiPort for some information on this. */
#elif defined(__GNU__) && defined(__ELF__) && defined(__ARM_EABI__) #elif defined(__GNU__) && defined(__ELF__) && defined(__ARM_EABI__)
# define ABI_ID "ELF ARMEABI" #define ABI_ID "ELF ARMEABI"
#elif defined(__GNU__) && defined(__ELF__) && defined(__ARMEB__) #elif defined(__GNU__) && defined(__ELF__) && defined(__ARMEB__)
# define ABI_ID "ELF ARM" #define ABI_ID "ELF ARM"
#elif defined(__GNU__) && defined(__ELF__) && defined(__ARMEL__) #elif defined(__GNU__) && defined(__ELF__) && defined(__ARMEL__)
# define ABI_ID "ELF ARM" #define ABI_ID "ELF ARM"
#elif defined(__ELF__) #elif defined(__ELF__)
# define ABI_ID "ELF" #define ABI_ID "ELF"
#endif #endif
#if defined(ABI_ID) #if defined(ABI_ID)
......
...@@ -6,11 +6,13 @@ void* runner(void*); ...@@ -6,11 +6,13 @@ void* runner(void*);
int res = 0; int res = 0;
#ifdef __CLASSIC_C__ #ifdef __CLASSIC_C__
int main(){ int main()
{
int ac; int ac;
char*av[]; char* av[];
#else #else
int main(int ac, char*av[]){ int main(int ac, char* av[])
{
#endif #endif
pthread_t tid[2]; pthread_t tid[2];
pthread_create(&tid[0], 0, runner, (void*)1); pthread_create(&tid[0], 0, runner, (void*)1);
...@@ -22,17 +24,18 @@ int main(int ac, char*av[]){ ...@@ -22,17 +24,18 @@ int main(int ac, char*av[]){
pthread_join(tid[0], 0); pthread_join(tid[0], 0);
pthread_join(tid[1], 0); pthread_join(tid[1], 0);
if(ac > 1000){return *av[0];} if (ac > 1000) {
return *av[0];
}
return res; return res;
} }
void* runner(void* args) void* runner(void* args)
{ {
int cc; int cc;
for ( cc = 0; cc < 10; cc ++ ) for (cc = 0; cc < 10; cc++) {
{
printf("%p CC: %d\n", args, cc); printf("%p CC: %d\n", args, cc);
} }
res ++; res++;
return 0; return 0;
} }
...@@ -3,24 +3,26 @@ ...@@ -3,24 +3,26 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
#endif #endif
char CHECK_FUNCTION_EXISTS(); char
CHECK_FUNCTION_EXISTS();
#ifdef __CLASSIC_C__ #ifdef __CLASSIC_C__
int main(){ int main()
{
int ac; int ac;
char*av[]; char* av[];
#else #else
int main(int ac, char*av[]){ int main(int ac, char* av[])
{
#endif #endif
CHECK_FUNCTION_EXISTS(); CHECK_FUNCTION_EXISTS();
if(ac > 1000) if (ac > 1000) {
{
return *av[0]; return *av[0];
} }
return 0; return 0;
} }
#else /* CHECK_FUNCTION_EXISTS */ #else /* CHECK_FUNCTION_EXISTS */
# error "CHECK_FUNCTION_EXISTS has to specify the function" #error "CHECK_FUNCTION_EXISTS has to specify the function"
#endif /* CHECK_FUNCTION_EXISTS */ #endif /* CHECK_FUNCTION_EXISTS */
...@@ -3,18 +3,22 @@ ...@@ -3,18 +3,22 @@
extern int CHECK_VARIABLE_EXISTS; extern int CHECK_VARIABLE_EXISTS;
#ifdef __CLASSIC_C__ #ifdef __CLASSIC_C__
int main(){ int main()
{
int ac; int ac;
char*av[]; char* av[];
#else #else
int main(int ac, char*av[]){ int main(int ac, char* av[])
{
#endif #endif
if(ac > 1000){return *av[0];} if (ac > 1000) {
return *av[0];
}
return CHECK_VARIABLE_EXISTS; return CHECK_VARIABLE_EXISTS;
} }
#else /* CHECK_VARIABLE_EXISTS */ #else /* CHECK_VARIABLE_EXISTS */
# error "CHECK_VARIABLE_EXISTS has to specify the variable" #error "CHECK_VARIABLE_EXISTS has to specify the variable"
#endif /* CHECK_VARIABLE_EXISTS */ #endif /* CHECK_VARIABLE_EXISTS */
void my_module_(void) {} void my_module_(void)
{
}
void mymodule_(void) {} void mymodule_(void)
{
}
#include <iostream> #include <iostream>
int main(int,char *[]) int main(int, char* [])