diff options
author | Kitware Robot <kwrobot@kitware.com> | 2016-05-16 14:34:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-05-16 20:05:19 (GMT) |
commit | d9fd2f5402eeaa345691313658e02b51038f570b (patch) | |
tree | dca71b9a7e267f4c6300da3eb770415381726785 /Tests/SystemInformation | |
parent | 82df6deaafb36cbbfd450202bb20b320f637751a (diff) | |
download | CMake-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 'Tests/SystemInformation')
-rw-r--r-- | Tests/SystemInformation/DumpInformation.cxx | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/Tests/SystemInformation/DumpInformation.cxx b/Tests/SystemInformation/DumpInformation.cxx index acafa87..e0cc0ce 100644 --- a/Tests/SystemInformation/DumpInformation.cxx +++ b/Tests/SystemInformation/DumpInformation.cxx @@ -4,77 +4,77 @@ void cmDumpInformationPrintFile(const char* name, FILE* fout) { - fprintf(fout, - "Avoid ctest truncation of output: CTEST_FULL_OUTPUT\n"); - fprintf(fout, - "================================================================\n"); + fprintf(fout, "Avoid ctest truncation of output: CTEST_FULL_OUTPUT\n"); + fprintf( + fout, + "================================================================\n"); struct stat fs; - if(stat(name, &fs) != 0) - { + if (stat(name, &fs) != 0) { fprintf(fout, "The file \"%s\" does not exist.\n", name); fflush(fout); return; - } + } FILE* fin = fopen(name, "r"); - if(fin) - { - fprintf(fout, - "Contents of \"%s\":\n" - "----------------------------------------------------------------\n", - name); + if (fin) { + fprintf( + fout, + "Contents of \"%s\":\n" + "----------------------------------------------------------------\n", + name); const int bufferSize = 4096; char buffer[bufferSize]; int n; - while((n = fread(buffer, 1, bufferSize, fin)) > 0) - { - for(char* c = buffer; c < buffer+n; ++c) - { - switch(*c) - { - case '<': fprintf(fout, "<"); break; - case '>': fprintf(fout, ">"); break; - case '&': fprintf(fout, "&"); break; - default: putc(*c, fout); break; - } + while ((n = fread(buffer, 1, bufferSize, fin)) > 0) { + for (char* c = buffer; c < buffer + n; ++c) { + switch (*c) { + case '<': + fprintf(fout, "<"); + break; + case '>': + fprintf(fout, ">"); + break; + case '&': + fprintf(fout, "&"); + break; + default: + putc(*c, fout); + break; } - fflush(fout); } - fclose(fin); + fflush(fout); } - else - { + fclose(fin); + } else { fprintf(fout, "Error opening \"%s\" for reading.\n", name); fflush(fout); - } + } } -int main(int,char *[]) +int main(int, char* []) { - const char* files[] = - { - DumpInformation_BINARY_DIR "/SystemInformation.out", - DumpInformation_BINARY_DIR "/AllVariables.txt", - DumpInformation_BINARY_DIR "/AllCommands.txt", - DumpInformation_BINARY_DIR "/AllMacros.txt", - DumpInformation_BINARY_DIR "/OtherProperties.txt", - DumpInformation_BINARY_DIR "/../../Source/cmConfigure.h", - DumpInformation_BINARY_DIR "/../../CMakeCache.txt", - DumpInformation_BINARY_DIR "/../../CMakeFiles/CMakeOutput.log", - DumpInformation_BINARY_DIR "/../../CMakeFiles/CMakeError.log", - DumpInformation_BINARY_DIR "/../../Bootstrap.cmk/cmake_bootstrap.log", - DumpInformation_BINARY_DIR "/../../Source/cmsys/Configure.hxx", - DumpInformation_BINARY_DIR "/../../Source/cmsys/Configure.h", - DumpInformation_BINARY_DIR "/CMakeFiles/CMakeOutput.log", - DumpInformation_BINARY_DIR "/CMakeFiles/CMakeError.log", - 0 - }; + const char* files[] = { + DumpInformation_BINARY_DIR "/SystemInformation.out", + DumpInformation_BINARY_DIR "/AllVariables.txt", + DumpInformation_BINARY_DIR "/AllCommands.txt", + DumpInformation_BINARY_DIR "/AllMacros.txt", + DumpInformation_BINARY_DIR "/OtherProperties.txt", + DumpInformation_BINARY_DIR "/../../Source/cmConfigure.h", + DumpInformation_BINARY_DIR "/../../CMakeCache.txt", + DumpInformation_BINARY_DIR "/../../CMakeFiles/CMakeOutput.log", + DumpInformation_BINARY_DIR "/../../CMakeFiles/CMakeError.log", + DumpInformation_BINARY_DIR "/../../Bootstrap.cmk/cmake_bootstrap.log", + DumpInformation_BINARY_DIR "/../../Source/cmsys/Configure.hxx", + DumpInformation_BINARY_DIR "/../../Source/cmsys/Configure.h", + DumpInformation_BINARY_DIR "/CMakeFiles/CMakeOutput.log", + DumpInformation_BINARY_DIR "/CMakeFiles/CMakeError.log", + 0 + }; const char** f; - for(f = files; *f; ++f) - { + for (f = files; *f; ++f) { cmDumpInformationPrintFile(*f, stdout); - } + } return 0; } |