Skip to content

Commit 74855c8

Browse files
Al LefantSiegeLord
authored andcommitted
make it work with clang 3.1
1 parent 02ad2c3 commit 74855c8

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

addons/native_dialog/osx_dialog.m

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,14 @@ int _al_show_native_message_box(ALLEGRO_DISPLAY *display,
169169
ALLEGRO_NATIVE_DIALOG *fd)
170170
{
171171
(void)display;
172-
@autoreleasepool {
172+
{
173+
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
173174
NSValue* fdValue = [NSValue valueWithPointer:fd];
174175

175176
[ALLEGAlertWrapper performSelectorOnMainThread: @selector(displayAlert:)
176177
withObject: fdValue
177178
waitUntilDone: YES];
179+
[pool release];
178180
}
179181
_al_osx_clear_mouse_state();
180182
return fd->mb_pressed_button;
@@ -353,7 +355,7 @@ @interface ALLEGTargetManager : NSObject {
353355
NSMutableArray * _items;
354356
}
355357
+(ALLEGTargetManager*) sharedManager;
356-
-(instancetype) init;
358+
-(id) init;
357359
-(void) dealloc;
358360
-(void) setMenu: (NSMenu*) menu forWindow:(NSWindow*) window;
359361
@end
@@ -372,7 +374,7 @@ @interface ALLEGMenuTarget : NSObject
372374
NSMenu* _menu;
373375
}
374376
-(NSMenu*) menu;
375-
-(instancetype) initWithMenu:(ALLEGRO_MENU*) amenu; // Designated initializer
377+
-(id) initWithMenu:(ALLEGRO_MENU*) amenu; // Designated initializer
376378
-(NSMenu*) menu;
377379
-(void) show;
378380
-(void) showPopup;
@@ -535,7 +537,7 @@ - (ALLEGRO_MENU_ITEM*) allegroItemforItem: (NSMenuItem*) mi
535537
}
536538
}
537539
// Create target with ALLEGRO_MENU bound to it.
538-
- (instancetype)initWithMenu:(ALLEGRO_MENU*) source_menu
540+
- (id)initWithMenu:(ALLEGRO_MENU*) source_menu
539541
{
540542
self = [super init];
541543
if (self) {
@@ -546,7 +548,7 @@ - (instancetype)initWithMenu:(ALLEGRO_MENU*) source_menu
546548
}
547549
return self;
548550
}
549-
-(instancetype) init
551+
-(id) init
550552
{
551553
/* This isn't a valid initializer */
552554
return nil;
@@ -657,7 +659,7 @@ +(ALLEGTargetManager*) sharedManager
657659
return _sharedmanager;
658660
}
659661
// Set up and register for notifications
660-
-(instancetype) init
662+
-(id) init
661663
{
662664
self = [super init];
663665
if (self) {
@@ -714,7 +716,7 @@ -(void) setMenu:(NSMenu *)menu forWindow:(NSWindow *)window
714716
{
715717
NSUInteger index = [self indexForWindow:window];
716718
if (menu) {
717-
NSDictionary* newentry = @{@"menu":menu, @"window":window};
719+
NSDictionary* newentry = [NSDictionary dictionaryWithObjectsAndKeys:menu, @"menu", window, @"window", nil];
718720
if (index == NSNotFound) {
719721
[self->_items addObject: newentry];
720722
}

src/macosx/osxgl.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ -(void) finishExitingFullScreenWindowMode
667667
/* set_current_display:
668668
* Set the current windowed display to be current.
669669
*/
670-
bool set_current_display(ALLEGRO_DISPLAY* d) {
670+
static bool set_current_display(ALLEGRO_DISPLAY* d) {
671671
ALLEGRO_DISPLAY_OSX_WIN* dpy = (ALLEGRO_DISPLAY_OSX_WIN*) d;
672672
if (dpy->ctx != nil) {
673673
[dpy->ctx makeCurrentContext];
@@ -2191,7 +2191,8 @@ static bool set_display_flag(ALLEGRO_DISPLAY *display, int flag, bool onoff)
21912191
if (!win)
21922192
return false;
21932193

2194-
@autoreleasepool {
2194+
{
2195+
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
21952196
switch (flag) {
21962197
case ALLEGRO_FRAMELESS: {
21972198
if (onoff)
@@ -2269,6 +2270,7 @@ static bool set_display_flag(ALLEGRO_DISPLAY *display, int flag, bool onoff)
22692270
return true;
22702271
}
22712272
}
2273+
[pool release];
22722274
}
22732275

22742276
return false;

0 commit comments

Comments
 (0)