Skip to content

Commit 8234b87

Browse files
committedJul 26, 2017
• Replaced some pre-Leopard NO_ARC directives with more modern #if !__has_feature(objc_arc)
• Fixed some empty headerdoc blocks which Xcode 9 does not like.
1 parent 44cea37 commit 8234b87

5 files changed

+24
-33
lines changed
 

‎SSYAlert.h

+2-9
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,6 @@ extern NSString* const SSYAlertDidProcessErrorNotification ;
143143
different from Apple's method
144144
attemptRecoveryFromError:optionIndex:delegate:didRecoverSelector:contextInfo:
145145
in which the analagous optionIndex parameter can be any nonnegative integer.
146-
@param delegate
147-
@param didRecoverSelector
148-
@param contextInfo
149146
*/
150147
- (void)attemptRecoveryFromError:(NSError *)error
151148
recoveryOption:(NSUInteger)recoveryOption
@@ -154,18 +151,14 @@ extern NSString* const SSYAlertDidProcessErrorNotification ;
154151
contextInfo:(void *)contextInfo ;
155152

156153
/*!
157-
@brief
158-
159154
@details Note that this is different from Apple's method
160155
attemptRecoveryFromError:optionIndex:delegate:didRecoverSelector:contextInfo:
161156
in the 'recoveryOption' parameter.
162-
@param error
163157
@param recoveryOption Should be one of NSAlertFirstButtonReturn,
164158
NSAlertSecondButtonReturn, or NSAlertThirdButton return. Note that this is
165159
different from Apple's method
166160
attemptRecoveryFromError:optionIndex:delegate:didRecoverSelector:contextInfo:
167161
in which the analagous optionIndex parameter can be any nonnegative integer.
168-
@result
169162
*/
170163
- (BOOL)attemptRecoveryFromError:(NSError *)error
171164
recoveryOption:(NSUInteger)recoveryOption ;
@@ -815,7 +808,7 @@ extern NSObject <SSYAlertErrorHideManager> * gSSYAlertErrorHideManager ;
815808
816809
@param title The window title or nil.&nbsp; If nil, title will
817810
be set to localized "Alert".
818-
@param buttons: 0-3 strings which will become the titles of
811+
@param buttons 0-3 strings which will become the titles of
819812
buttons 1-3, terminated by a nil sentinel.
820813
If no button titles are passed, dialog will have 1 button titled
821814
as localized "OK".
@@ -833,7 +826,7 @@ extern NSObject <SSYAlertErrorHideManager> * gSSYAlertErrorHideManager ;
833826
Pass 0-3 button title arguments.
834827
@param title The window title or nil.&nbsp; If nil, title will
835828
be set to localized "Alert".
836-
@param buttonsArray: An array of 0-3 strings which will become
829+
@param buttonsArray An array of 0-3 strings which will become
837830
the titles of buttons 1-3.&nbsp; If this parameter is nil or an
838831
empty array, dialog will have 1 button titled as localized "OK".
839832
@result Indicates button clicked by user: NSAlertFirstButtonReturn,

‎SSYRunLoopTickler.m

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#import "SSYRunLoopTickler.h"
2-
#import "SSY_ARC_OR_NO_ARC.h"
32

43
@implementation SSYRunLoopTickler
54

@@ -19,8 +18,8 @@ + (void)tickle {
1918
NSLog(@"%s failed to send its message.", __PRETTY_FUNCTION__) ;
2019
}
2120

22-
#if NO_ARC
23-
[message release] ;
21+
#if !__has_feature(objc_arc)
22+
[message release] ;
2423
#endif
2524

2625
// If I remove the port now, the desired "tickle" causing a
@@ -42,4 +41,4 @@ + (void)removePort:(NSPort*)port {
4241
forMode:NSDefaultRunLoopMode] ;
4342
}
4443

45-
@end
44+
@end

‎SSYShellTasker.h

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#import <Cocoa/Cocoa.h>
2+
13
extern NSInteger const SSYShellTaskerErrorFailedLaunch ;
24
extern NSInteger const SSYShellTaskerErrorTimedOut ;
35
extern NSString* const constKeySSYShellTaskerTimeout ;

‎SSYShellTasker.m

+10-11
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#import "NSError+InfoAccess.h"
33
#import "SSYThreadPauser.h"
44
#import "SSYRunLoopTickler.h"
5-
#import "SSY_ARC_OR_NO_ARC.h"
65

76
NSInteger const SSYShellTaskerErrorFailedLaunch = 90551 ;
87
NSInteger const SSYShellTaskerErrorTimedOut = 90552 ;
@@ -39,8 +38,8 @@ - (void)doWithInfo:(NSMutableDictionary*)info {
3938
// To conserve system resources, therefore, we use a local pool here.
4039
// For more info,
4140
// http://www.cocoabuilder.com/archive/message/cocoa/2002/11/30/51122
42-
#if NO_ARC
43-
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init] ;
41+
#if !__has_feature(objc_arc)
42+
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init] ;
4443
#endif
4544
NSString* command = [info objectForKey:constKeySSYShellTaskerCommand] ;
4645
NSArray* arguments = [info objectForKey:constKeySSYShellTaskerArguments] ;
@@ -79,8 +78,8 @@ - (void)doWithInfo:(NSMutableDictionary*)info {
7978
}
8079
}
8180
[task setEnvironment:taskEnvironment] ;
82-
#if NO_ARC
83-
[taskEnvironment release] ;
81+
#if !__has_feature(objc_arc)
82+
[taskEnvironment release] ;
8483
#endif
8584
}
8685

@@ -194,15 +193,15 @@ - (void)doWithInfo:(NSMutableDictionary*)info {
194193
forKey:constKeySSYShellTaskerNSError] ;
195194
}
196195

197-
#if NO_ARC
198-
[pipeStdin release] ;
196+
#if !__has_feature(objc_arc)
197+
[pipeStdin release] ;
199198
[pipeStdout release] ;
200199
[pipeStderr release] ;
201200
#endif
202201
[[NSNotificationCenter defaultCenter] removeObserver:self
203202
name:NSTaskDidTerminateNotification
204203
object:task] ;
205-
#if NO_ARC
204+
#if !__has_feature(objc_arc)
206205
[task release] ;
207206
[pool release] ;
208207
#endif
@@ -272,8 +271,8 @@ + (NSInteger)doShellTaskCommand:(NSString*)command
272271

273272
result = [[info objectForKey:constKeySSYShellTaskerResult] integerValue] ;
274273

275-
#if NO_ARC
276-
[tasker release] ;
274+
#if !__has_feature(objc_arc)
275+
[tasker release] ;
277276
#endif
278277

279278
return result ;
@@ -349,4 +348,4 @@ int main(int argc, const char *argv[]) {
349348
return 0 ;
350349
}
351350
352-
*/
351+
*/

‎SSYThreadPauser.m

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#import "SSYThreadPauser.h"
22
#import "NSInvocation+Quick.h"
3-
#import "SSY_ARC_OR_NO_ARC.h"
43

54
NSString* const SSYThreadPauserKeyLock = @"SSYThreadPauserKeyLock" ;
65
NSString* const SSYThreadPauserKeyInvocation = @"SSYThreadPauserKeyInvocation" ;
@@ -12,8 +11,8 @@
1211
@implementation SSYThreadPauser
1312

1413
- (void)beginWorkWithInfo:(NSDictionary*)info {
15-
#if NO_ARC
16-
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init] ;
14+
#if !__has_feature(objc_arc)
15+
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init] ;
1716
#endif
1817
NSConditionLock* lock = [info objectForKey:SSYThreadPauserKeyLock] ;
1918
[lock lock] ;
@@ -23,8 +22,8 @@ - (void)beginWorkWithInfo:(NSDictionary*)info {
2322
[invocation invoke] ;
2423

2524
[lock unlockWithCondition:WORK_IS_DONE] ;
26-
#if NO_ARC
27-
[pool drain] ;
25+
#if !__has_feature(objc_arc)
26+
[pool drain] ;
2827
#endif
2928
}
3029

@@ -69,7 +68,7 @@ + (BOOL)blockUntilWorker:(id)worker
6968
NSThread* workerThread = [[NSThread alloc] initWithTarget:instance
7069
selector:@selector(beginWorkWithInfo:)
7170
object:info] ;
72-
#if NO_ARC
71+
#if !__has_feature(objc_arc)
7372
[workerThread autorelease] ;
7473
#endif
7574
// Name the thread, to help in debugging.
@@ -84,8 +83,8 @@ + (BOOL)blockUntilWorker:(id)worker
8483
}
8584
[workerThread cancel] ;
8685

87-
#if NO_ARC
88-
[instance release] ;
86+
#if !__has_feature(objc_arc)
87+
[instance release] ;
8988
[lock release] ;
9089
#endif
9190

@@ -95,4 +94,3 @@ + (BOOL)blockUntilWorker:(id)worker
9594

9695
@end
9796

98-

0 commit comments

Comments
 (0)
Please sign in to comment.