Commit 877d8909 authored by Sam Lantinga's avatar Sam Lantinga

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.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401769
parent f557a45f
...@@ -252,19 +252,24 @@ static void CustomApplicationMain (int argc, char **argv) ...@@ -252,19 +252,24 @@ static void CustomApplicationMain (int argc, char **argv)
*/ */
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename - (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. */ if (!gFinderLaunch) /* MacOS is passing command line args. */
return FALSE; return FALSE;
if (gCalledAppMainline) /* app has started, ignore this document. */ if (gCalledAppMainline) /* app has started, ignore this document. */
return FALSE; return FALSE;
const char *temparg = [filename UTF8String]; temparg = [filename UTF8String];
size_t arglen = SDL_strlen(temparg) + 1; arglen = SDL_strlen(temparg) + 1;
char *arg = (char *) SDL_malloc(arglen); arg = (char *) SDL_malloc(arglen);
if (arg == NULL) if (arg == NULL)
return FALSE; return FALSE;
char **newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2)); newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2));
if (newargv == NULL) if (newargv == NULL)
{ {
SDL_free(arg); SDL_free(arg);
...@@ -376,3 +381,4 @@ int main (int argc, char **argv) ...@@ -376,3 +381,4 @@ int main (int argc, char **argv)
#endif #endif
return 0; return 0;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment