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/VSResource/main.cpp | |
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/VSResource/main.cpp')
-rw-r--r-- | Tests/VSResource/main.cpp | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/Tests/VSResource/main.cpp b/Tests/VSResource/main.cpp index f8372b7..b2b5ac9 100644 --- a/Tests/VSResource/main.cpp +++ b/Tests/VSResource/main.cpp @@ -5,7 +5,7 @@ extern int lib(); struct x { - const char *txt; + const char* txt; }; int main(int argc, char** argv) @@ -24,35 +24,31 @@ int main(int argc, char** argv) test.txt = "*exactly* test.txt"; fprintf(stdout, "CMAKE_RCDEFINE_NO_QUOTED_STRINGS defined\n"); fprintf(stdout, "CMAKE_RCDEFINE is %s, and is *not* a string constant\n", - CMAKE_RCDEFINE); + CMAKE_RCDEFINE); #else // Expect CMAKE_RCDEFINE to be a string: fprintf(stdout, "CMAKE_RCDEFINE='%s', and is a string constant\n", - CMAKE_RCDEFINE); + CMAKE_RCDEFINE); #endif HRSRC hello = ::FindResource(NULL, MAKEINTRESOURCE(1025), "TEXTFILE"); - if(hello) - { + if (hello) { fprintf(stdout, "FindResource worked\n"); HGLOBAL hgbl = ::LoadResource(NULL, hello); - int datasize = (int) ::SizeofResource(NULL, hello); - if(hgbl && datasize>0) - { + int datasize = (int)::SizeofResource(NULL, hello); + if (hgbl && datasize > 0) { fprintf(stdout, "LoadResource worked\n"); fprintf(stdout, "SizeofResource returned datasize='%d'\n", datasize); - void *data = ::LockResource(hgbl); - if (data) - { + void* data = ::LockResource(hgbl); + if (data) { fprintf(stdout, "LockResource worked\n"); - char *str = (char *) malloc(datasize+4); - if (str) - { + char* str = (char*)malloc(datasize + 4); + if (str) { memcpy(str, data, datasize); str[datasize] = 'E'; - str[datasize+1] = 'O'; - str[datasize+2] = 'R'; - str[datasize+3] = 0; + str[datasize + 1] = 'O'; + str[datasize + 2] = 'R'; + str[datasize + 3] = 0; fprintf(stdout, "str='%s'\n", str); free(str); @@ -62,21 +58,18 @@ int main(int argc, char** argv) fprintf(stdout, "LoadString skipped\n"); #else char buf[256]; - if (::LoadString(NULL, 1026, buf, sizeof(buf)) > 0) - { + if (::LoadString(NULL, 1026, buf, sizeof(buf)) > 0) { fprintf(stdout, "LoadString worked\n"); fprintf(stdout, "buf='%s'\n", buf); - } - else - { + } else { fprintf(stdout, "LoadString failed\n"); ret = 1; - } -#endif } +#endif } } } + } return ret + lib(); } |