Skip to content

Commit

Permalink
Avoid conflict of ivar name with systemcall name
Browse files Browse the repository at this point in the history
  • Loading branch information
rfm committed Nov 30, 2023
1 parent 2473c74 commit 5c5a62e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Source/GSAvahiRunLoopIntegration.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
{
NSRunLoop *runLoop;
NSString *mode;
AvahiPoll *poll;
AvahiPoll *ap;
NSMutableArray *children;
NSLock *lock;
}
Expand Down
28 changes: 14 additions & 14 deletions Source/GSAvahiRunLoopIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -398,16 +398,16 @@ - (id) initWithRunLoop: (NSRunLoop*)rl
}
lock = [[NSLock alloc] init];
[lock setName: @"GSAvahiRunLoopContextLock"];
poll = malloc(sizeof(AvahiPoll));
NSAssert(poll, @"Could not allocate avahi polling structure.");
poll->userdata = (void*)self; //userInfo
poll->watch_new = GSAvahiWatchNew; //create a new GSAvahiWatcher
poll->watch_update = GSAvahiWatchUpdate; //update the watcher
poll->watch_get_events = GSAvahiWatchGetEvents; //retrieve events
poll->watch_free = GSAvahiWatchFree; //remove watcher from context
poll->timeout_new = GSAvahiTimeoutNew; //create a new GSAvahiTimer
poll->timeout_update = GSAvahiTimeoutUpdate; //update the timer
poll->timeout_free = GSAvahiTimeoutFree; //remove the timer from context
ap = malloc(sizeof(AvahiPoll));
NSAssert(ap, @"Could not allocate avahi polling structure.");
ap->userdata = (void*)self; //userInfo
ap->watch_new = GSAvahiWatchNew; //create a new GSAvahiWatcher
ap->watch_update = GSAvahiWatchUpdate; //update the watcher
ap->watch_get_events = GSAvahiWatchGetEvents; //retrieve events
ap->watch_free = GSAvahiWatchFree; //remove watcher from context
ap->timeout_new = GSAvahiTimeoutNew; //create a new GSAvahiTimer
ap->timeout_update = GSAvahiTimeoutUpdate; //update the timer
ap->timeout_free = GSAvahiTimeoutFree; //remove the timer from context
//Runloops don't need to be retained;
runLoop = rl;
ASSIGNCOPY(mode,aMode);
Expand All @@ -434,7 +434,7 @@ - (NSString*) mode

- (const AvahiPoll*) avahiPoll
{
return (const AvahiPoll*)poll;
return (const AvahiPoll*)ap;
}

- (GSAvahiTimer*) avahiTimerWithCallback: (AvahiTimeoutCallback)callback
Expand Down Expand Up @@ -539,16 +539,16 @@ - (void) dealloc
* try to create additional watchers and timers on the runloop, so we should
* clean it up properly:
*/
poll->userdata = (void*)NULL;
ap->userdata = (void*)NULL;
[self removeFromRunLoop: runLoop
forMode: mode];
FOR_IN(GSAvahiWatcher*, child, children)
{
[child setContext: nil];
}
END_FOR_IN(children)
free(poll);
poll = NULL;
free(ap);
ap = NULL;
[children release];
[mode release];
[lock release];
Expand Down

0 comments on commit 5c5a62e

Please sign in to comment.