summaryrefslogtreecommitdiffstats
path: root/Tests/VSResource/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/VSResource/main.cpp')
-rw-r--r--Tests/VSResource/main.cpp41
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();
}