Skip to content

Commit d0e3fad

Browse files
committed
• Finally got around to find/replacing all of the NO_ARC macros, which were needed to work in macOS 10.5, with !__has_feature(objc_arc), has been available since 10.7 or so.
1 parent ca54cf1 commit d0e3fad

10 files changed

+37
-37
lines changed

Diff for: SSYAlertSounder.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ - (void)dealloc {
2626
AudioServicesDisposeSystemSoundID((unsigned int)[soundId longValue]) ;
2727
}
2828

29-
#if NO_ARC
29+
#if !__has_feature(objc_arc)
3030
[m_soundIds release] ;
3131

3232
[super dealloc] ;
@@ -107,7 +107,7 @@ - (NSArray*)availableSoundsSorted {
107107

108108
NSArray* answer = [names copy] ;
109109

110-
#if NO_ARC
110+
#if !__has_feature(objc_arc)
111111
[paths release] ;
112112
[names release] ;
113113
[answer autorelease] ;
@@ -162,4 +162,4 @@ - (void)playAlertSoundNamed:(NSString*)name {
162162
}
163163
}
164164

165-
@end
165+
@end

Diff for: SSYInterappClient.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ + (BOOL)sendHeaderByte:(char)txHeaderByte
7272
aggrRxData = (__bridge NSData*)cfData ;
7373
// As always, we are careful not to CFRelease(NULL) ;
7474
CFRelease(remotePort) ;
75-
#if NO_ARC
75+
#if !__has_feature(objc_arc)
7676
[aggrTxData release] ;
7777
#endif
7878

@@ -98,7 +98,7 @@ + (BOOL)sendHeaderByte:(char)txHeaderByte
9898
}
9999
}
100100

101-
#if NO_ARC
101+
#if !__has_feature(objc_arc)
102102
[aggrRxData release] ;
103103
#endif
104104
}
@@ -141,7 +141,7 @@ + (BOOL)sendHeaderByte:(char)txHeaderByte
141141
txHeaderString = [[NSString alloc] initWithBytes:&txHeaderByte
142142
length:1
143143
encoding:NSUTF8StringEncoding] ;
144-
#if NO_ARC
144+
#if !__has_feature(objc_arc)
145145
[txHeaderString autorelease] ;
146146
#endif
147147
}

Diff for: SSYInterappServer.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ CFDataRef SSYInterappServerCallBackCreateData(
105105
else {
106106
outputData = NULL ;
107107
}
108-
#if NO_ARC
108+
#if !__has_feature(objc_arc)
109109
[responseData release] ;
110110
#endif
111111
}
@@ -143,7 +143,7 @@ - (void)dealloc {
143143
m_port = NULL ;
144144
}
145145

146-
#if NO_ARC
146+
#if !__has_feature(objc_arc)
147147
[super dealloc] ;
148148
#endif
149149
}
@@ -240,7 +240,7 @@ - (id)initWithPortName:(NSString*)portName
240240

241241
if (errorCode != 0) {
242242
// See http://lists.apple.com/archives/Objc-language/2008/Sep/msg00133.html ...
243-
#if NO_ARC
243+
#if !__has_feature(objc_arc)
244244
[super dealloc] ;
245245
#endif
246246
self = nil ;
@@ -317,7 +317,7 @@ + (SSYInterappServer*)leaseServerWithPortName:(NSString*)portName
317317
// Internal Error 713-0192 here, but it was not providing any
318318
// useful information not already in the error.
319319
}
320-
#if NO_ARC
320+
#if !__has_feature(objc_arc)
321321
[server release] ;
322322
#endif
323323
}

Diff for: SSYKeychain.m

+5-5
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ + (NSString*)passwordForServost:(NSString*)servostName
5151
}
5252
}
5353

54-
#if NO_ARC
54+
#if !__has_feature(objc_arc)
5555
[subs release] ;
5656
[query release] ;
5757
#endif
@@ -78,7 +78,7 @@ + (BOOL)deletePasswordForServost:(NSString*)servostName
7878
[query setAccount:account] ;
7979

8080
BOOL ok = [query deleteItem:error_p] ;
81-
#if NO_ARC
81+
#if !__has_feature(objc_arc)
8282
[query release] ;
8383
#endif
8484
return ok ;
@@ -103,7 +103,7 @@ + (BOOL)setPassword:(NSString*)password
103103
[query setPassword:password] ;
104104

105105
BOOL ok = [query save:error_p] ;
106-
#if NO_ARC
106+
#if !__has_feature(objc_arc)
107107
[query release] ;
108108
#endif
109109
return ok ;
@@ -124,7 +124,7 @@ + (NSArray*)allItemsForHost:(NSString*)hostName
124124
}
125125

126126
NSArray* answer = [query fetchAll:nil] ;
127-
#if NO_ARC
127+
#if !__has_feature(objc_arc)
128128
[query release] ;
129129
#endif
130130
return answer ;
@@ -164,7 +164,7 @@ + (NSArray*)accountNamesForServost:(NSString*)servostName
164164

165165
NSError* error = nil ;
166166
NSArray* items = [query fetchAll:&error] ;
167-
#if NO_ARC
167+
#if !__has_feature(objc_arc)
168168
[query release] ;
169169
#endif
170170
NSArray* accountNames = [items valueForKey:(NSString*)kSecAttrAccount] ;

Diff for: SSYKeychainQuery.m

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ - (id)init {
2929
return self ;
3030
}
3131

32-
#if NO_ARC
32+
#if !__has_feature(objc_arc)
3333
- (void)dealloc {
3434
[_account release] ;
3535
[_service release] ;
@@ -162,7 +162,7 @@ - (NSArray*)fetchAll:(NSError *__autoreleasing *)error {
162162
*error = [[self class] errorWithCode:status] ;
163163
}
164164

165-
#if NO_ARC
165+
#if !__has_feature(objc_arc)
166166
return [(NSArray*)result autorelease] ;
167167
#else
168168
return (__bridge_transfer NSArray*)result ;
@@ -194,7 +194,7 @@ - (BOOL)fetch:(NSError *__autoreleasing *)error_p {
194194
}
195195
}
196196

197-
#if NO_ARC
197+
#if !__has_feature(objc_arc)
198198
[self setPasswordData:result] ;
199199
[(NSData*)result autorelease] ;
200200
#else
@@ -233,7 +233,7 @@ - (void)setPassword:(NSString *)password {
233233
- (NSString *)password {
234234
if ([[self passwordData] length] > 0) {
235235
NSString* word = [[NSString alloc] initWithData:[self passwordData] encoding:NSUTF8StringEncoding] ;
236-
#if NO_ARC
236+
#if !__has_feature(objc_arc)
237237
[word autorelease] ;
238238
#endif
239239
return word ;
@@ -357,7 +357,7 @@ + (NSError *)errorWithCode:(NSInteger)code {
357357
}
358358
#else
359359
default:
360-
#if NO_ARC
360+
#if !__has_feature(objc_arc)
361361
message = (NSString*)SecCopyErrorMessageString((OSStatus)code, NULL) ;
362362
[message autorelease] ;
363363
#else

Diff for: SSYLaunchdBasics.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ + (NSSet*)installedLaunchdAgentLabelsWithPrefix:(NSString*)prefix {
4242
}
4343

4444
NSSet* answer = [targetAgentNames copy] ;
45-
#if NO_ARC
45+
#if !__has_feature(objc_arc)
4646
[targetAgentNames release] ;
4747
[answer autorelease] ;
4848
#endif
@@ -66,7 +66,7 @@ + (NSDictionary*)installedLaunchdAgentsWithPrefix:(NSString*)prefix {
6666
}
6767

6868
NSDictionary* answer = [agents copy] ;
69-
#if NO_ARC
69+
#if !__has_feature(objc_arc)
7070
[agents release] ;
7171
[answer autorelease] ;
7272
#endif

Diff for: SSYShellTasker.m

+6-6
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ - (void)doWithInfo:(NSMutableDictionary*)info {
3939
// To conserve system resources, therefore, we use a local pool here.
4040
// For more info,
4141
// http://www.cocoabuilder.com/archive/message/cocoa/2002/11/30/51122
42-
#if NO_ARC
42+
#if !__has_feature(objc_arc)
4343
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init] ;
4444
#endif
4545
NSString* command = [info objectForKey:constKeySSYShellTaskerCommand] ;
@@ -79,7 +79,7 @@ - (void)doWithInfo:(NSMutableDictionary*)info {
7979
}
8080
}
8181
[task setEnvironment:taskEnvironment] ;
82-
#if NO_ARC
82+
#if !__has_feature(objc_arc)
8383
[taskEnvironment release] ;
8484
#endif
8585
}
@@ -194,15 +194,15 @@ - (void)doWithInfo:(NSMutableDictionary*)info {
194194
forKey:constKeySSYShellTaskerNSError] ;
195195
}
196196

197-
#if NO_ARC
197+
#if !__has_feature(objc_arc)
198198
[pipeStdin release] ;
199199
[pipeStdout release] ;
200200
[pipeStderr release] ;
201201
#endif
202202
[[NSNotificationCenter defaultCenter] removeObserver:self
203203
name:NSTaskDidTerminateNotification
204204
object:task] ;
205-
#if NO_ARC
205+
#if !__has_feature(objc_arc)
206206
[task release] ;
207207
[pool release] ;
208208
#endif
@@ -272,7 +272,7 @@ + (NSInteger)doShellTaskCommand:(NSString*)command
272272

273273
result = [[info objectForKey:constKeySSYShellTaskerResult] integerValue] ;
274274

275-
#if NO_ARC
275+
#if !__has_feature(objc_arc)
276276
[tasker release] ;
277277
#endif
278278

@@ -349,4 +349,4 @@ int main(int argc, const char *argv[]) {
349349
return 0 ;
350350
}
351351
352-
*/
352+
*/

Diff for: SSYStarRatingView.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ - (id)initWithFrame:(NSRect)frame
7878
#endif
7979
#endif
8080

81-
#if NO_ARC
81+
#if !__has_feature(objc_arc)
8282
-(void)dealloc
8383
{
8484
[m_starImage release] ;

Diff for: SSYThreadPauser.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@implementation SSYThreadPauser
1313

1414
- (void)beginWorkWithInfo:(NSDictionary*)info {
15-
#if NO_ARC
15+
#if !__has_feature(objc_arc)
1616
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init] ;
1717
#endif
1818
NSConditionLock* lock = [info objectForKey:SSYThreadPauserKeyLock] ;
@@ -23,7 +23,7 @@ - (void)beginWorkWithInfo:(NSDictionary*)info {
2323
[invocation invoke] ;
2424

2525
[lock unlockWithCondition:WORK_IS_DONE] ;
26-
#if NO_ARC
26+
#if !__has_feature(objc_arc)
2727
[pool drain] ;
2828
#endif
2929
}
@@ -69,7 +69,7 @@ + (BOOL)blockUntilWorker:(id)worker
6969
NSThread* workerThread = [[NSThread alloc] initWithTarget:instance
7070
selector:@selector(beginWorkWithInfo:)
7171
object:info] ;
72-
#if NO_ARC
72+
#if !__has_feature(objc_arc)
7373
[workerThread autorelease] ;
7474
#endif
7575
// Name the thread, to help in debugging.
@@ -84,7 +84,7 @@ + (BOOL)blockUntilWorker:(id)worker
8484
}
8585
[workerThread cancel] ;
8686

87-
#if NO_ARC
87+
#if !__has_feature(objc_arc)
8888
[instance release] ;
8989
[lock release] ;
9090
#endif

Diff for: SSYXMLPeeker.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ @implementation SSYXMLPeeker
1616
@synthesize targetElement = m_targetElement ;
1717
@synthesize error = m_error ;
1818

19-
#if NO_ARC
19+
#if !__has_feature(objc_arc)
2020
- (void)dealloc {
2121
[m_parsedValue release] ;
2222
[m_targetElement release] ;
@@ -39,7 +39,7 @@ - (NSString*)stringValueOfElement:(NSString*)targetElement
3939
// is done or aborted.
4040

4141

42-
#if NO_ARC
42+
#if !__has_feature(objc_arc)
4343
[parser release] ;
4444
#endif
4545
return [self parsedValue] ;
@@ -55,7 +55,7 @@ + (NSString*)stringValueOfElement:(NSString*)targetElement
5555
*error_p = [peeker error] ;
5656
}
5757

58-
#if NO_ARC
58+
#if !__has_feature(objc_arc)
5959
[peeker release] ;
6060
#endif
6161

@@ -73,7 +73,7 @@ - (void) parser:(NSXMLParser*)parser
7373
if ([elementName isEqualToString:[self targetElement]]) {
7474
NSMutableString* emptyString = [[NSMutableString alloc] init] ;
7575
[self setParsedValue:emptyString] ;
76-
#if NO_ARC
76+
#if !__has_feature(objc_arc)
7777
[emptyString release] ;
7878
#endif
7979
}

0 commit comments

Comments
 (0)