changeset 1809:41ab83bec62f

Date: Wed, 10 May 2006 17:43:21 -0700 From: Eric Wing Subject: Re: Updated tarball Attached are additional cleanups to SDLMain.m for the files in src/ main/macosx. It looks like somebody already cleaned up most of the issues. There is one about the class interfaces being empty which didn't look easy to fix in a meaningful way so I left them.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 11 May 2006 03:08:39 +0000
parents 3e5029051a6d
children 4c270c3a88ed
files src/main/macosx/SDLMain.m
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/macosx/SDLMain.m	Wed May 10 15:21:14 2006 +0000
+++ b/src/main/macosx/SDLMain.m	Thu May 11 03:08:39 2006 +0000
@@ -252,19 +252,24 @@
  */
 - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
 {
+    const char *temparg;
+    size_t arglen;
+    char *arg;
+    char **newargv;
+
     if (!gFinderLaunch)  /* MacOS is passing command line args. */
         return FALSE;
 
     if (gCalledAppMainline)  /* app has started, ignore this document. */
         return FALSE;
 
-    const char *temparg = [filename UTF8String];
-    size_t arglen = SDL_strlen(temparg) + 1;
-    char *arg = (char *) SDL_malloc(arglen);
+    temparg = [filename UTF8String];
+    arglen = SDL_strlen(temparg) + 1;
+    arg = (char *) SDL_malloc(arglen);
     if (arg == NULL)
         return FALSE;
 
-    char **newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2));
+    newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2));
     if (newargv == NULL)
     {
         SDL_free(arg);
@@ -376,3 +381,4 @@
 #endif
     return 0;
 }
+