Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-03-27 19:32:56 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-03-27 20:12:12 +0300
commit6f43e1dfef3e5632976529a6f678292b15bd5a0c (patch)
tree19f6ce84b7c5236e9d61b0964266bd3682d07475 /source/creator
parent59b578e320313958be69400f34fe3d0dd2ae865c (diff)
Cleanup: win32 mixed declare/statements in main()
Make it a more clear where declarations end (ifdef's all over made it a bit confusing).
Diffstat (limited to 'source/creator')
-rw-r--r--source/creator/creator.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/source/creator/creator.c b/source/creator/creator.c
index b2b650419d6..5b4f828842e 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -1559,13 +1559,13 @@ char **environ = NULL;
* or exit when running in background mode.
*/
int main(
- int argc,
+ int argc,
#ifdef WIN32
const char **UNUSED(argv_c)
#else
const char **argv
#endif
- )
+ )
{
bContext *C;
SYS_SystemHandle syshandle;
@@ -1575,6 +1575,14 @@ int main(
#endif
#ifdef WIN32
+ char **argv;
+ int argv_num;
+#endif
+
+ /* --- end declarations --- */
+
+
+#ifdef WIN32
/* FMA3 support in the 2013 CRT is broken on Vista and Windows 7 RTM (fixed in SP1). Just disable it. */
# if defined(_MSC_VER) && _MSC_VER >= 1800 && defined(_M_X64)
_set_FMA3_enable(0);
@@ -1584,16 +1592,15 @@ int main(
/* NOTE: cannot use guardedalloc malloc here, as it's not yet initialized
* (it depends on the args passed in, which is what we're getting here!)
*/
- wchar_t **argv_16 = CommandLineToArgvW(GetCommandLineW(), &argc);
- char **argv = malloc(argc * sizeof(char *));
- int argci = 0;
-
- for (argci = 0; argci < argc; argci++) {
- argv[argci] = alloc_utf_8_from_16(argv_16[argci], 0);
+ {
+ wchar_t **argv_16 = CommandLineToArgvW(GetCommandLineW(), &argc);
+ argv = malloc(argc * sizeof(char *));
+ for (argv_num = 0; argv_num < argc; argv_num++) {
+ argv[argv_num] = alloc_utf_8_from_16(argv_16[argv_num], 0);
+ }
+ LocalFree(argv_16);
}
-
- LocalFree(argv_16);
-#endif
+#endif /* WIN32 */
/* NOTE: Special exception for guarded allocator type switch:
* we need to perform switch from lock-free to fully
@@ -1661,7 +1668,7 @@ int main(
setCallbacks();
#if defined(__APPLE__) && !defined(WITH_PYTHON_MODULE)
-/* patch to ignore argument finder gives us (pid?) */
+ /* patch to ignore argument finder gives us (pid?) */
if (argc == 2 && STREQLEN(argv[1], "-psn_", 5)) {
extern int GHOST_HACK_getFirstFile(char buf[]);
static char firstfilebuf[512];
@@ -1819,8 +1826,8 @@ int main(
#endif
#ifdef WIN32
- while (argci) {
- free(argv[--argci]);
+ while (argv_num) {
+ free(argv[--argv_num]);
}
free(argv);
argv = NULL;