mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Cleanup:
- (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:
parent
12745b6fde
commit
b85364de7e
19 changed files with 33 additions and 25 deletions
|
@ -178,9 +178,10 @@ typedef struct autorelease_array_list
|
|||
* </desc>
|
||||
* </deflist>
|
||||
*/
|
||||
NS_AUTOMATED_REFCOUNT_UNAVAILABLE
|
||||
@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. */
|
||||
NSAutoreleasePool *_parent;
|
||||
/* This pointer to our child pool is necessary for co-existing
|
||||
|
|
|
@ -35,6 +35,8 @@
|
|||
|
||||
#if defined(_NATIVE_OBJC_EXCEPTIONS)
|
||||
#define USER_NATIVE_OBJC_EXCEPTIONS 1
|
||||
#elif __has_feature(objc_exceptions)
|
||||
#define USER_NATIVE_OBJC_EXCEPTIONS 1
|
||||
#else
|
||||
#define USER_NATIVE_OBJC_EXCEPTIONS 0
|
||||
#endif
|
||||
|
|
|
@ -62,6 +62,15 @@ typedef float CGFloat;
|
|||
|
||||
#define NSINTEGER_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)
|
||||
extern "C" {
|
||||
|
|
|
@ -80,10 +80,10 @@ extern "C" {
|
|||
- (BOOL) respondsToSelector: (SEL)aSelector;
|
||||
/** See [NSObject-conformsToProtocol:] */
|
||||
- (BOOL) conformsToProtocol: (Protocol*)aProtocol;
|
||||
- (id) retain; /** See [NSObject-retain] */
|
||||
- (id) autorelease /** See [NSObject-autorelease] */;
|
||||
- (oneway void) release; /** See [NSObject-release] */
|
||||
- (NSUInteger) retainCount; /** See [NSObject-retainCount] */
|
||||
- (id) retain NS_AUTOMATED_REFCOUNT_UNAVAILABLE; /** See [NSObject-retain] */
|
||||
- (id) autorelease NS_AUTOMATED_REFCOUNT_UNAVAILABLE /** See [NSObject-autorelease] */;
|
||||
- (oneway void) release NS_AUTOMATED_REFCOUNT_UNAVAILABLE; /** See [NSObject-release] */
|
||||
- (NSUInteger) retainCount NS_AUTOMATED_REFCOUNT_UNAVAILABLE; /** See [NSObject-retainCount] */
|
||||
- (NSZone*) zone; /** See [NSObject-zone] */
|
||||
- (NSString*) description; /** See [NSObject-description] */
|
||||
@end
|
||||
|
@ -243,7 +243,6 @@ extern "C" {
|
|||
+ (Class) superclass;
|
||||
+ (NSInteger) version;
|
||||
|
||||
- (id) autorelease;
|
||||
- (id) awakeAfterUsingCoder: (NSCoder*)aDecoder;
|
||||
- (Class) class;
|
||||
- (Class) classForArchiver;
|
||||
|
@ -269,12 +268,9 @@ extern "C" {
|
|||
- (id) performSelector: (SEL)aSelector
|
||||
withObject: (id)object1
|
||||
withObject: (id)object2;
|
||||
- (oneway void) release;
|
||||
- (id) replacementObjectForArchiver: (NSArchiver*)anArchiver;
|
||||
- (id) replacementObjectForCoder: (NSCoder*)anEncoder;
|
||||
- (BOOL) respondsToSelector: (SEL)aSelector;
|
||||
- (id) retain;
|
||||
- (NSUInteger) retainCount;
|
||||
- (id) self;
|
||||
- (Class) superclass;
|
||||
- (NSZone*) zone;
|
||||
|
|
|
@ -1177,7 +1177,7 @@ static Class GSInlineArrayClass;
|
|||
return 0;
|
||||
}
|
||||
|
||||
- (void) release
|
||||
- (oneway void) release
|
||||
{
|
||||
return; // placeholders never get released.
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ void _Block_release(void *);
|
|||
return _Block_copy(self);
|
||||
}
|
||||
|
||||
- (void) release
|
||||
- (oneway void) release
|
||||
{
|
||||
_Block_release(self);
|
||||
}
|
||||
|
|
|
@ -891,7 +891,7 @@ fixBOM(unsigned char **bytes, NSUInteger*length, BOOL *owned,
|
|||
return 0;
|
||||
}
|
||||
|
||||
- (void) release
|
||||
- (oneway void) release
|
||||
{
|
||||
return; // placeholders never get released.
|
||||
}
|
||||
|
|
|
@ -1700,7 +1700,7 @@ IF_NO_GC(
|
|||
return YES;
|
||||
}
|
||||
|
||||
- (void) release
|
||||
- (oneway void) release
|
||||
{
|
||||
/* We lock during release so that other threads can't grab the
|
||||
* object between us checking the reference count and deallocating.
|
||||
|
|
|
@ -1493,7 +1493,7 @@ static NSLock *cached_proxies_gate = nil;
|
|||
return result;
|
||||
}
|
||||
|
||||
- (void) release
|
||||
- (oneway void) release
|
||||
{
|
||||
/* We lock the connection table while checking, to prevent
|
||||
* another thread from grabbing this connection while we are
|
||||
|
|
|
@ -1518,7 +1518,7 @@ otherTime(NSDate* other)
|
|||
return self;
|
||||
}
|
||||
|
||||
- (void) release
|
||||
- (oneway void) release
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -428,7 +428,7 @@ static NSIndexPath *dummy = nil;
|
|||
return _length;
|
||||
}
|
||||
|
||||
- (void) release
|
||||
- (oneway void) release
|
||||
{
|
||||
if (self != empty)
|
||||
{
|
||||
|
|
|
@ -1696,7 +1696,7 @@ typedef struct {
|
|||
}
|
||||
}
|
||||
|
||||
- (void) release
|
||||
- (oneway void) release
|
||||
{
|
||||
M_LOCK(messagePortLock);
|
||||
if (NSDecrementExtraRefCountWasZero(self))
|
||||
|
|
|
@ -104,7 +104,7 @@ static NSNull *null = 0;
|
|||
return NO;
|
||||
}
|
||||
|
||||
- (void) release
|
||||
- (oneway void) release
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -378,7 +378,7 @@ static BOOL useSmallInt;
|
|||
}
|
||||
- (id)retain { return self; }
|
||||
- (id)autorelease { return self; }
|
||||
- (void)release { }
|
||||
- (oneway void)release { }
|
||||
@end
|
||||
#endif
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ static Class NSPort_concrete_class;
|
|||
return [super autorelease];
|
||||
}
|
||||
|
||||
- (void) release
|
||||
- (oneway void) release
|
||||
{
|
||||
if (_is_valid && [self retainCount] == 1)
|
||||
{
|
||||
|
|
|
@ -2214,7 +2214,7 @@ static Class tcpPortClass;
|
|||
}
|
||||
}
|
||||
|
||||
- (void) release
|
||||
- (oneway void) release
|
||||
{
|
||||
M_LOCK(tcpPortLock);
|
||||
if (NSDecrementExtraRefCountWasZero(self))
|
||||
|
|
|
@ -560,7 +560,7 @@ static NSString *_time_zone_path(NSString *subpath, NSString *type)
|
|||
return (GSPlaceholderTimeZone*)zone;
|
||||
}
|
||||
|
||||
- (void) release
|
||||
- (oneway void) release
|
||||
{
|
||||
return; // placeholders never get released.
|
||||
}
|
||||
|
@ -620,7 +620,7 @@ static NSString *_time_zone_path(NSString *subpath, NSString *type)
|
|||
return [[NSTimeZoneClass defaultTimeZone] name];
|
||||
}
|
||||
|
||||
- (void) release
|
||||
- (oneway void) release
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -299,7 +299,7 @@ static NSURLProtocol *placeholder = nil;
|
|||
}
|
||||
[super dealloc];
|
||||
}
|
||||
- (void) release
|
||||
- (oneway void) release
|
||||
{
|
||||
/* 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
|
||||
|
|
|
@ -700,7 +700,7 @@ static NSLock *placeholderLock;
|
|||
return 0;
|
||||
}
|
||||
|
||||
- (void) release
|
||||
- (oneway void) release
|
||||
{
|
||||
return; // placeholders never get released.
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue