diff options
author | Brad King <brad.king@kitware.com> | 2016-05-17 13:33:02 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-05-17 13:33:02 (GMT) |
commit | 7d2a0aa76c25d92f1e2a03778f5666bdd7e56b92 (patch) | |
tree | 2bdcf15abfef8e197173b5a135fe6b8391e43316 /Tests/VSResource/main.cpp | |
parent | 930ac45cbafca79eec9ae68e07c547b5c81b8c2c (diff) | |
parent | d9fd2f5402eeaa345691313658e02b51038f570b (diff) | |
download | CMake-7d2a0aa76c25d92f1e2a03778f5666bdd7e56b92.zip CMake-7d2a0aa76c25d92f1e2a03778f5666bdd7e56b92.tar.gz CMake-7d2a0aa76c25d92f1e2a03778f5666bdd7e56b92.tar.bz2 |
Merge topic 'clang-format-source'
d9fd2f54 Revise C++ coding style using clang-format
82df6dea Empty commit at end of history preceding clang-format style transition
6a13f43f CONTRIBUTING: Add a section on coding style
bf451d9f Add a script to run clang-format on the entire source tree
1e90d78f Configure clang-format for CMake source tree
da60adc3 Tell Git to use a distinct conflict marker size in `.rst` files
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(); } |