summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorKitware Robot <kwrobot@kitware.com>2016-05-16 14:34:04 (GMT)
committerBrad King <brad.king@kitware.com>2016-05-16 20:05:19 (GMT)
commitd9fd2f5402eeaa345691313658e02b51038f570b (patch)
treedca71b9a7e267f4c6300da3eb770415381726785 /Modules
parent82df6deaafb36cbbfd450202bb20b320f637751a (diff)
downloadCMake-d9fd2f5402eeaa345691313658e02b51038f570b.zip
CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.gz
CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.bz2
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.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeCCompilerABI.c11
-rw-r--r--Modules/CMakeCXXCompilerABI.cpp4
-rw-r--r--Modules/CMakeCompilerABI.h24
-rw-r--r--Modules/CheckForPthreads.c19
-rw-r--r--Modules/CheckFunctionExists.c20
-rw-r--r--Modules/CheckVariableExists.c16
-rw-r--r--Modules/FortranCInterface/my_module_.c4
-rw-r--r--Modules/FortranCInterface/mymodule_.c4
-rw-r--r--Modules/TestForANSIStreamHeaders.cxx2
-rw-r--r--Modules/TestForAnsiForScope.cxx5
-rw-r--r--Modules/TestForSSTREAM.cxx7
-rw-r--r--Modules/TestForSTDNamespace.cxx2
12 files changed, 63 insertions, 55 deletions
diff --git a/Modules/CMakeCCompilerABI.c b/Modules/CMakeCCompilerABI.c
index d36219e..55f9a9b 100644
--- a/Modules/CMakeCCompilerABI.c
+++ b/Modules/CMakeCCompilerABI.c
@@ -1,19 +1,18 @@
#ifdef __cplusplus
-# error "A C++ compiler has been selected for C."
+#error "A C++ compiler has been selected for C."
#endif
#ifdef __CLASSIC_C__
-# define const
+#define const
#endif
-
#include "CMakeCompilerABI.h"
-
#ifdef __CLASSIC_C__
-int main(argc, argv) int argc; char *argv[];
+int main(argc, argv) int argc;
+char* argv[];
#else
-int main(int argc, char *argv[])
+int main(int argc, char* argv[])
#endif
{
int require = 0;
diff --git a/Modules/CMakeCXXCompilerABI.cpp b/Modules/CMakeCXXCompilerABI.cpp
index c7ce194..2dee883 100644
--- a/Modules/CMakeCXXCompilerABI.cpp
+++ b/Modules/CMakeCXXCompilerABI.cpp
@@ -1,11 +1,9 @@
#ifndef __cplusplus
-# error "A C compiler has been selected for C++."
+#error "A C compiler has been selected for C++."
#endif
-
#include "CMakeCompilerABI.h"
-
int main(int argc, char* argv[])
{
int require = 0;
diff --git a/Modules/CMakeCompilerABI.h b/Modules/CMakeCompilerABI.h
index 95bd791..f2714b4 100644
--- a/Modules/CMakeCompilerABI.h
+++ b/Modules/CMakeCompilerABI.h
@@ -1,34 +1,32 @@
/* Size of a pointer-to-data in bytes. */
#define SIZEOF_DPTR (sizeof(void*))
-const char info_sizeof_dptr[] = {
- 'I', 'N', 'F', 'O', ':', 's', 'i', 'z', 'e', 'o', 'f', '_', 'd', 'p', 't', 'r', '[',
- ('0' + ((SIZEOF_DPTR / 10)%10)),
- ('0' + (SIZEOF_DPTR % 10)),
- ']','\0'
+const char info_sizeof_dptr[] = {
+ 'I', 'N', 'F', 'O', ':', 's', 'i', 'z', 'e', 'o', 'f', '_', 'd', 'p', 't',
+ 'r', '[', ('0' + ((SIZEOF_DPTR / 10) % 10)), ('0' + (SIZEOF_DPTR % 10)), ']',
+ '\0'
/* clang-format needs this comment to break after the opening brace */
};
-
/* Application Binary Interface. */
#if defined(__sgi) && defined(_ABIO32)
-# define ABI_ID "ELF O32"
+#define ABI_ID "ELF O32"
#elif defined(__sgi) && defined(_ABIN32)
-# define ABI_ID "ELF N32"
+#define ABI_ID "ELF N32"
#elif defined(__sgi) && defined(_ABI64)
-# define ABI_ID "ELF 64"
+#define ABI_ID "ELF 64"
/* Check for (some) ARM ABIs.
* See e.g. http://wiki.debian.org/ArmEabiPort for some information on this. */
#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__)
-# define ABI_ID "ELF ARM"
+#define ABI_ID "ELF ARM"
#elif defined(__GNU__) && defined(__ELF__) && defined(__ARMEL__)
-# define ABI_ID "ELF ARM"
+#define ABI_ID "ELF ARM"
#elif defined(__ELF__)
-# define ABI_ID "ELF"
+#define ABI_ID "ELF"
#endif
#if defined(ABI_ID)
diff --git a/Modules/CheckForPthreads.c b/Modules/CheckForPthreads.c
index 9629a66..6fc6f26 100644
--- a/Modules/CheckForPthreads.c
+++ b/Modules/CheckForPthreads.c
@@ -6,11 +6,13 @@ void* runner(void*);
int res = 0;
#ifdef __CLASSIC_C__
-int main(){
+int main()
+{
int ac;
- char*av[];
+ char* av[];
#else
-int main(int ac, char*av[]){
+int main(int ac, char* av[])
+{
#endif
pthread_t tid[2];
pthread_create(&tid[0], 0, runner, (void*)1);
@@ -22,17 +24,18 @@ int main(int ac, char*av[]){
pthread_join(tid[0], 0);
pthread_join(tid[1], 0);
- if(ac > 1000){return *av[0];}
+ if (ac > 1000) {
+ return *av[0];
+ }
return res;
}
void* runner(void* args)
{
int cc;
- for ( cc = 0; cc < 10; cc ++ )
- {
+ for (cc = 0; cc < 10; cc++) {
printf("%p CC: %d\n", args, cc);
- }
- res ++;
+ }
+ res++;
return 0;
}
diff --git a/Modules/CheckFunctionExists.c b/Modules/CheckFunctionExists.c
index fd29618..2304000 100644
--- a/Modules/CheckFunctionExists.c
+++ b/Modules/CheckFunctionExists.c
@@ -3,24 +3,26 @@
#ifdef __cplusplus
extern "C"
#endif
-char CHECK_FUNCTION_EXISTS();
+ char
+ CHECK_FUNCTION_EXISTS();
#ifdef __CLASSIC_C__
-int main(){
+int main()
+{
int ac;
- char*av[];
+ char* av[];
#else
-int main(int ac, char*av[]){
+int main(int ac, char* av[])
+{
#endif
CHECK_FUNCTION_EXISTS();
- if(ac > 1000)
- {
+ if (ac > 1000) {
return *av[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 */
diff --git a/Modules/CheckVariableExists.c b/Modules/CheckVariableExists.c
index 752f6e4..6e94877 100644
--- a/Modules/CheckVariableExists.c
+++ b/Modules/CheckVariableExists.c
@@ -3,18 +3,22 @@
extern int CHECK_VARIABLE_EXISTS;
#ifdef __CLASSIC_C__
-int main(){
+int main()
+{
int ac;
- char*av[];
+ char* av[];
#else
-int main(int ac, char*av[]){
+int main(int ac, char* av[])
+{
#endif
- if(ac > 1000){return *av[0];}
+ if (ac > 1000) {
+ return *av[0];
+ }
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 */
diff --git a/Modules/FortranCInterface/my_module_.c b/Modules/FortranCInterface/my_module_.c
index 6510ae9..6fa89d1 100644
--- a/Modules/FortranCInterface/my_module_.c
+++ b/Modules/FortranCInterface/my_module_.c
@@ -1 +1,3 @@
-void my_module_(void) {}
+void my_module_(void)
+{
+}
diff --git a/Modules/FortranCInterface/mymodule_.c b/Modules/FortranCInterface/mymodule_.c
index 5270605..444953b 100644
--- a/Modules/FortranCInterface/mymodule_.c
+++ b/Modules/FortranCInterface/mymodule_.c
@@ -1 +1,3 @@
-void mymodule_(void) {}
+void mymodule_(void)
+{
+}
diff --git a/Modules/TestForANSIStreamHeaders.cxx b/Modules/TestForANSIStreamHeaders.cxx
index cfb7686..d314d58 100644
--- a/Modules/TestForANSIStreamHeaders.cxx
+++ b/Modules/TestForANSIStreamHeaders.cxx
@@ -1,6 +1,6 @@
#include <iostream>
-int main(int,char *[])
+int main(int, char* [])
{
return 0;
}
diff --git a/Modules/TestForAnsiForScope.cxx b/Modules/TestForAnsiForScope.cxx
index e8807ab..4bc2c67 100644
--- a/Modules/TestForAnsiForScope.cxx
+++ b/Modules/TestForAnsiForScope.cxx
@@ -1,7 +1,8 @@
-int main(int, char*[])
+int main(int, char* [])
{
int i;
- for(int i=0; i < 1; ++i);
+ for (int i = 0; i < 1; ++i)
+ ;
(void)i;
return 0;
}
diff --git a/Modules/TestForSSTREAM.cxx b/Modules/TestForSSTREAM.cxx
index 1c939da..83a75e4 100644
--- a/Modules/TestForSSTREAM.cxx
+++ b/Modules/TestForSSTREAM.cxx
@@ -1,11 +1,10 @@
#include <sstream>
-int main(int, char*[])
+int main(int, char* [])
{
std::ostringstream os;
os << "12345";
- if(os.str().size() == 5)
- {
+ if (os.str().size() == 5) {
return 0;
- }
+ }
return -1;
}
diff --git a/Modules/TestForSTDNamespace.cxx b/Modules/TestForSTDNamespace.cxx
index b537d44..62951ff 100644
--- a/Modules/TestForSTDNamespace.cxx
+++ b/Modules/TestForSTDNamespace.cxx
@@ -1,5 +1,5 @@
#include <list>
-int main(int, char*[])
+int main(int, char* [])
{
std::list<int>();
return 0;