From 5c5a62e8d40aa236cbe0b50034bcfb242a34cb84 Mon Sep 17 00:00:00 2001 From: rfm Date: Thu, 30 Nov 2023 08:16:02 +0000 Subject: [PATCH] Avoid conflict of ivar name with systemcall name --- Source/GSAvahiRunLoopIntegration.h | 2 +- Source/GSAvahiRunLoopIntegration.m | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Source/GSAvahiRunLoopIntegration.h b/Source/GSAvahiRunLoopIntegration.h index 4f95fec1b..78ae83258 100644 --- a/Source/GSAvahiRunLoopIntegration.h +++ b/Source/GSAvahiRunLoopIntegration.h @@ -43,7 +43,7 @@ { NSRunLoop *runLoop; NSString *mode; - AvahiPoll *poll; + AvahiPoll *ap; NSMutableArray *children; NSLock *lock; } diff --git a/Source/GSAvahiRunLoopIntegration.m b/Source/GSAvahiRunLoopIntegration.m index 0ad34ae9f..2f041cc87 100644 --- a/Source/GSAvahiRunLoopIntegration.m +++ b/Source/GSAvahiRunLoopIntegration.m @@ -398,16 +398,16 @@ GSAvahiTimeoutFree(AvahiTimeout* timeout) } 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); @@ -434,7 +434,7 @@ GSAvahiTimeoutFree(AvahiTimeout* timeout) - (const AvahiPoll*) avahiPoll { - return (const AvahiPoll*)poll; + return (const AvahiPoll*)ap; } - (GSAvahiTimer*) avahiTimerWithCallback: (AvahiTimeoutCallback)callback @@ -539,7 +539,7 @@ GSAvahiTimeoutFree(AvahiTimeout* timeout) * 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) @@ -547,8 +547,8 @@ GSAvahiTimeoutFree(AvahiTimeout* timeout) [child setContext: nil]; } END_FOR_IN(children) - free(poll); - poll = NULL; + free(ap); + ap = NULL; [children release]; [mode release]; [lock release];