Differences From Artifact [2ce5c50064]:
- File src/OFApplication.m — part of check-in [4df6ab6bca] at 2017-05-13 16:56:44 on branch trunk — Fix compilation with GCC (user: js, size: 11812) [annotate] [blame] [check-ins using]
To Artifact [e40754826f]:
- File
src/OFApplication.m
— part of check-in
[6b77a5dd8b]
at
2017-05-21 21:28:57
on branch trunk
— Prefix private methods with of_ instead of OF_
This matches Apple's style. (user: js, size: 11812) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
64 65 66 67 68 69 70 | #ifdef HAVE_SIGACTION # ifndef SA_RESTART # define SA_RESTART 0 # endif #endif @interface OFApplication () | | | | | | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | #ifdef HAVE_SIGACTION # ifndef SA_RESTART # define SA_RESTART 0 # endif #endif @interface OFApplication () - (instancetype)of_init OF_METHOD_FAMILY(init); - (void)of_setArgumentCount: (int *)argc andArgumentValues: (char **[])argv; #ifdef OF_WINDOWS - (void)of_setArgumentCount: (int)argc andWideArgumentValues: (wchar_t *[])argv; #endif - (void)of_run; @end static OFApplication *app = nil; static void atexitHandler(void) { |
︙ | ︙ | |||
127 128 129 130 131 132 133 | "application delegate!\n Most likely, you wanted to " "subclass OFObject instead or specified\n the wrong class " "with OF_APPLICATION_DELEGATE().\n", class_getName(cls), class_getName(cls)); exit(1); } | | | | | | 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | "application delegate!\n Most likely, you wanted to " "subclass OFObject instead or specified\n the wrong class " "with OF_APPLICATION_DELEGATE().\n", class_getName(cls), class_getName(cls)); exit(1); } app = [[OFApplication alloc] of_init]; [app of_setArgumentCount: argc andArgumentValues: argv]; #ifdef OF_WINDOWS __wgetmainargs(&wargc, &wargv, &wenvp, _CRT_glob, &si); [app of_setArgumentCount: wargc andWideArgumentValues: wargv]; #endif delegate = [[cls alloc] init]; [app setDelegate: delegate]; [app of_run]; [delegate release]; return 0; } @implementation OFApplication |
︙ | ︙ | |||
202 203 204 205 206 207 208 | #endif - init { OF_INVALID_INIT_METHOD } | | | 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | #endif - init { OF_INVALID_INIT_METHOD } - of_init { self = [super init]; @try { void *pool; OFMutableDictionary *environment; #if defined(OF_MACOS) |
︙ | ︙ | |||
361 362 363 364 365 366 367 | { [_arguments release]; [_environment release]; [super dealloc]; } | | | 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 | { [_arguments release]; [_environment release]; [super dealloc]; } - (void)of_setArgumentCount: (int *)argc andArgumentValues: (char ***)argv { #ifndef OF_WINDOWS void *pool = objc_autoreleasePoolPush(); OFMutableArray *arguments; of_string_encoding_t encoding; |
︙ | ︙ | |||
401 402 403 404 405 406 407 | #else _argc = argc; _argv = argv; #endif } #ifdef OF_WINDOWS | | | 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 | #else _argc = argc; _argv = argv; #endif } #ifdef OF_WINDOWS - (void)of_setArgumentCount: (int)argc andWideArgumentValues: (wchar_t **)argv { void *pool = objc_autoreleasePoolPush(); OFMutableArray *arguments; if (argc > 0) { _programName = [[OFString alloc] initWithUTF16String: argv[0]]; |
︙ | ︙ | |||
481 482 483 484 485 486 487 | #ifdef SIGUSR2 REGISTER_SIGNAL(SIGUSR2) #endif #undef REGISTER_SIGNAL } | | | | | | 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 | #ifdef SIGUSR2 REGISTER_SIGNAL(SIGUSR2) #endif #undef REGISTER_SIGNAL } - (void)of_run { void *pool = objc_autoreleasePoolPush(); OFRunLoop *runLoop; #ifdef OF_HAVE_THREADS [OFThread of_createMainThread]; runLoop = [OFRunLoop currentRunLoop]; #else runLoop = [[[OFRunLoop alloc] init] autorelease]; #endif [OFRunLoop of_setMainRunLoop: runLoop]; objc_autoreleasePoolPop(pool); /* * Note: runLoop is still valid after the release of the pool, as * of_setMainRunLoop: retained it. However, we only have a weak * reference to it now, whereas we had a strong reference before. */ pool = objc_autoreleasePoolPush(); [_delegate applicationDidFinishLaunching]; objc_autoreleasePoolPop(pool); |
︙ | ︙ |