- (void)release;
to
- (oneway void)release;
so everything implementing -release actually implements the one declared in the NSObject protocol.

Start marking things that are unavailable in ARC mode as unavailable in ARC mode.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33660 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
theraven 2011-07-31 15:31:39 +00:00
parent 1d53b9c278
commit f77f9b1f35
19 changed files with 33 additions and 25 deletions

View file

@ -178,9 +178,10 @@ typedef struct autorelease_array_list
* </desc> * </desc>
* </deflist> * </deflist>
*/ */
NS_AUTOMATED_REFCOUNT_UNAVAILABLE
@interface NSAutoreleasePool : NSObject @interface NSAutoreleasePool : NSObject
{ {
#if GS_EXPOSE(NSAutoreleasePool) #if GS_EXPOSE(NSAutoreleasePool) && !__has_feature(objc_arc)
/* For re-setting the current pool when we are dealloc'ed. */ /* For re-setting the current pool when we are dealloc'ed. */
NSAutoreleasePool *_parent; NSAutoreleasePool *_parent;
/* This pointer to our child pool is necessary for co-existing /* This pointer to our child pool is necessary for co-existing

View file

@ -35,6 +35,8 @@
#if defined(_NATIVE_OBJC_EXCEPTIONS) #if defined(_NATIVE_OBJC_EXCEPTIONS)
#define USER_NATIVE_OBJC_EXCEPTIONS 1 #define USER_NATIVE_OBJC_EXCEPTIONS 1
#elif __has_feature(objc_exceptions)
#define USER_NATIVE_OBJC_EXCEPTIONS 1
#else #else
#define USER_NATIVE_OBJC_EXCEPTIONS 0 #define USER_NATIVE_OBJC_EXCEPTIONS 0
#endif #endif

View file

@ -62,6 +62,15 @@ typedef float CGFloat;
#define NSINTEGER_DEFINED 1 #define NSINTEGER_DEFINED 1
#define CGFLOAT_DEFINED 1 #define CGFLOAT_DEFINED 1
#ifndef NS_AUTOMATED_REFCOUNT_UNAVAILABLE
# if __has_feature(objc_arc)
# define NS_AUTOMATED_REFCOUNT_UNAVAILABLE \
__attribute__((unavailable("Not available with automatic reference counting")))
# else
# define NS_AUTOMATED_REFCOUNT_UNAVAILABLE
# endif
#endif
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {

View file

@ -80,10 +80,10 @@ extern "C" {
- (BOOL) respondsToSelector: (SEL)aSelector; - (BOOL) respondsToSelector: (SEL)aSelector;
/** See [NSObject-conformsToProtocol:] */ /** See [NSObject-conformsToProtocol:] */
- (BOOL) conformsToProtocol: (Protocol*)aProtocol; - (BOOL) conformsToProtocol: (Protocol*)aProtocol;
- (id) retain; /** See [NSObject-retain] */ - (id) retain NS_AUTOMATED_REFCOUNT_UNAVAILABLE; /** See [NSObject-retain] */
- (id) autorelease /** See [NSObject-autorelease] */; - (id) autorelease NS_AUTOMATED_REFCOUNT_UNAVAILABLE /** See [NSObject-autorelease] */;
- (oneway void) release; /** See [NSObject-release] */ - (oneway void) release NS_AUTOMATED_REFCOUNT_UNAVAILABLE; /** See [NSObject-release] */
- (NSUInteger) retainCount; /** See [NSObject-retainCount] */ - (NSUInteger) retainCount NS_AUTOMATED_REFCOUNT_UNAVAILABLE; /** See [NSObject-retainCount] */
- (NSZone*) zone; /** See [NSObject-zone] */ - (NSZone*) zone; /** See [NSObject-zone] */
- (NSString*) description; /** See [NSObject-description] */ - (NSString*) description; /** See [NSObject-description] */
@end @end
@ -243,7 +243,6 @@ extern "C" {
+ (Class) superclass; + (Class) superclass;
+ (NSInteger) version; + (NSInteger) version;
- (id) autorelease;
- (id) awakeAfterUsingCoder: (NSCoder*)aDecoder; - (id) awakeAfterUsingCoder: (NSCoder*)aDecoder;
- (Class) class; - (Class) class;
- (Class) classForArchiver; - (Class) classForArchiver;
@ -269,12 +268,9 @@ extern "C" {
- (id) performSelector: (SEL)aSelector - (id) performSelector: (SEL)aSelector
withObject: (id)object1 withObject: (id)object1
withObject: (id)object2; withObject: (id)object2;
- (oneway void) release;
- (id) replacementObjectForArchiver: (NSArchiver*)anArchiver; - (id) replacementObjectForArchiver: (NSArchiver*)anArchiver;
- (id) replacementObjectForCoder: (NSCoder*)anEncoder; - (id) replacementObjectForCoder: (NSCoder*)anEncoder;
- (BOOL) respondsToSelector: (SEL)aSelector; - (BOOL) respondsToSelector: (SEL)aSelector;
- (id) retain;
- (NSUInteger) retainCount;
- (id) self; - (id) self;
- (Class) superclass; - (Class) superclass;
- (NSZone*) zone; - (NSZone*) zone;

View file

@ -1177,7 +1177,7 @@ static Class GSInlineArrayClass;
return 0; return 0;
} }
- (void) release - (oneway void) release
{ {
return; // placeholders never get released. return; // placeholders never get released.
} }

View file

@ -76,7 +76,7 @@ void _Block_release(void *);
return _Block_copy(self); return _Block_copy(self);
} }
- (void) release - (oneway void) release
{ {
_Block_release(self); _Block_release(self);
} }

View file

@ -891,7 +891,7 @@ fixBOM(unsigned char **bytes, NSUInteger*length, BOOL *owned,
return 0; return 0;
} }
- (void) release - (oneway void) release
{ {
return; // placeholders never get released. return; // placeholders never get released.
} }

View file

@ -1700,7 +1700,7 @@ IF_NO_GC(
return YES; return YES;
} }
- (void) release - (oneway void) release
{ {
/* We lock during release so that other threads can't grab the /* We lock during release so that other threads can't grab the
* object between us checking the reference count and deallocating. * object between us checking the reference count and deallocating.

View file

@ -1493,7 +1493,7 @@ static NSLock *cached_proxies_gate = nil;
return result; return result;
} }
- (void) release - (oneway void) release
{ {
/* We lock the connection table while checking, to prevent /* We lock the connection table while checking, to prevent
* another thread from grabbing this connection while we are * another thread from grabbing this connection while we are

View file

@ -1518,7 +1518,7 @@ otherTime(NSDate* other)
return self; return self;
} }
- (void) release - (oneway void) release
{ {
} }

View file

@ -428,7 +428,7 @@ static NSIndexPath *dummy = nil;
return _length; return _length;
} }
- (void) release - (oneway void) release
{ {
if (self != empty) if (self != empty)
{ {

View file

@ -1696,7 +1696,7 @@ typedef struct {
} }
} }
- (void) release - (oneway void) release
{ {
M_LOCK(messagePortLock); M_LOCK(messagePortLock);
if (NSDecrementExtraRefCountWasZero(self)) if (NSDecrementExtraRefCountWasZero(self))

View file

@ -104,7 +104,7 @@ static NSNull *null = 0;
return NO; return NO;
} }
- (void) release - (oneway void) release
{ {
} }

View file

@ -378,7 +378,7 @@ static BOOL useSmallInt;
} }
- (id)retain { return self; } - (id)retain { return self; }
- (id)autorelease { return self; } - (id)autorelease { return self; }
- (void)release { } - (oneway void)release { }
@end @end
#endif #endif

View file

@ -184,7 +184,7 @@ static Class NSPort_concrete_class;
return [super autorelease]; return [super autorelease];
} }
- (void) release - (oneway void) release
{ {
if (_is_valid && [self retainCount] == 1) if (_is_valid && [self retainCount] == 1)
{ {

View file

@ -2214,7 +2214,7 @@ static Class tcpPortClass;
} }
} }
- (void) release - (oneway void) release
{ {
M_LOCK(tcpPortLock); M_LOCK(tcpPortLock);
if (NSDecrementExtraRefCountWasZero(self)) if (NSDecrementExtraRefCountWasZero(self))

View file

@ -560,7 +560,7 @@ static NSString *_time_zone_path(NSString *subpath, NSString *type)
return (GSPlaceholderTimeZone*)zone; return (GSPlaceholderTimeZone*)zone;
} }
- (void) release - (oneway void) release
{ {
return; // placeholders never get released. return; // placeholders never get released.
} }
@ -620,7 +620,7 @@ static NSString *_time_zone_path(NSString *subpath, NSString *type)
return [[NSTimeZoneClass defaultTimeZone] name]; return [[NSTimeZoneClass defaultTimeZone] name];
} }
- (void) release - (oneway void) release
{ {
} }

View file

@ -299,7 +299,7 @@ static NSURLProtocol *placeholder = nil;
} }
[super dealloc]; [super dealloc];
} }
- (void) release - (oneway void) release
{ {
/* In a multi-threaded environment we could have two threads release the /* In a multi-threaded environment we could have two threads release the
* class at the same time ... causing -dealloc to be called twice at the * class at the same time ... causing -dealloc to be called twice at the

View file

@ -700,7 +700,7 @@ static NSLock *placeholderLock;
return 0; return 0;
} }
- (void) release - (oneway void) release
{ {
return; // placeholders never get released. return; // placeholders never get released.
} }