diff options
author | Sven Weidauer <sven@5sw.de> | 2017-06-05 10:47:34 +0200 |
---|---|---|
committer | Sven Weidauer <sven@5sw.de> | 2017-06-05 10:51:19 +0200 |
commit | 3ee40a10b123c36be3e29602767840a7a71aaafa (patch) | |
tree | 64123d0bf6a6cf5a5a4c1fd8349756db68e09483 /frontends/cocoa/schedule.m | |
parent | ce4e059ea67cee7f35b4b810a4387f343fa74650 (diff) | |
download | netsurf-3ee40a10b123c36be3e29602767840a7a71aaafa.tar.gz netsurf-3ee40a10b123c36be3e29602767840a7a71aaafa.tar.bz2 |
Fix up cocoa frontend.
- Convert to ARC
- Fix crash due to endless responder chain recursion
- Update makefile to find openssl installed via home-brew
- Fix most compiler warnings
Diffstat (limited to 'frontends/cocoa/schedule.m')
-rw-r--r-- | frontends/cocoa/schedule.m | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/frontends/cocoa/schedule.m b/frontends/cocoa/schedule.m index f0896bd9d..65ca7f15d 100644 --- a/frontends/cocoa/schedule.m +++ b/frontends/cocoa/schedule.m @@ -27,14 +27,14 @@ void *userData; } -- initWithCallback: (void (*)(void *))cb userData: (void *)ud; +- (instancetype)initWithCallback: (void (*)(void *))cb userData: (void *)ud; - (void) schedule: (NSTimeInterval) ti; @end @implementation ScheduledCallback -- initWithCallback: (void (*)(void *))cb userData: (void *)ud; +- (instancetype)initWithCallback: (void (*)(void *))cb userData: (void *)ud { callback = cb; userData = ud; @@ -44,7 +44,7 @@ static NSMutableSet *timerSet = nil; -- (void) schedule: (NSTimeInterval) ti; +- (void) schedule: (NSTimeInterval) ti { if (nil == timerSet) { timerSet = [[NSMutableSet alloc] init]; @@ -54,7 +54,7 @@ static NSMutableSet *timerSet = nil; [timerSet addObject: self]; } -- (void) timerFired; +- (void) timerFired { if ([timerSet containsObject: self]) { [timerSet removeObject: self]; @@ -69,7 +69,7 @@ static NSMutableSet *timerSet = nil; return ((ScheduledCallback *)object)->callback == callback && ((ScheduledCallback *)object)->userData == userData; } -- (NSUInteger) hash; +- (NSUInteger) hash { return (NSUInteger)callback + (NSUInteger)userData; } @@ -84,7 +84,6 @@ nserror cocoa_schedule(int t, void (*callback)(void *p), void *p) if (t >= 0) { [cb schedule: (NSTimeInterval)t / 1000]; } - [cb release]; return NSERROR_OK; } |