mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
cleanups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28787 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d46a7f8bb1
commit
e4a6d046be
13 changed files with 53 additions and 509 deletions
17
ChangeLog
17
ChangeLog
|
@ -1,3 +1,20 @@
|
|||
2009-10-10 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Headers/Foundation/NSString.h:
|
||||
* Source/NSString.m:
|
||||
* Source/GSString.m:
|
||||
Remove obsolete immutable proxy method.
|
||||
* Source/NSIndexPath.m:
|
||||
* Source/NSDistributedNotificationCenter.m:
|
||||
* Source/NSAttributedString.m:
|
||||
* Source/GSArray.m:
|
||||
* Source/GSFFCallInvocation.m:
|
||||
* Source/GSFFIInvocation.m:
|
||||
* Source/GSAttributedString.m:
|
||||
* Source/NSConnection.m:
|
||||
* Source/NSThread.m:
|
||||
Replace unnecessary calls to NSDeallocateObject().
|
||||
|
||||
2009-10-07 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
* configure.ac: Add librt for sched_yield on solaris.
|
||||
|
|
|
@ -807,10 +807,6 @@ extern struct objc_class _NSConstantStringClassReference;
|
|||
|
||||
#if GS_API_VERSION(GS_API_NONE, 011700)
|
||||
|
||||
@interface NSMutableString (GNUstep)
|
||||
- (NSString*) immutableProxy;
|
||||
@end
|
||||
|
||||
/**
|
||||
* Provides some additional (non-standard) utility methods.
|
||||
*/
|
||||
|
|
|
@ -130,9 +130,9 @@ static Class GSInlineArrayClass;
|
|||
}
|
||||
#endif
|
||||
NSZoneFree([self zone], _contents_array);
|
||||
_contents_array = 0;
|
||||
}
|
||||
NSDeallocateObject(self);
|
||||
GSNOSUPERDEALLOC;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (id) init
|
||||
|
@ -404,9 +404,9 @@ static Class GSInlineArrayClass;
|
|||
{
|
||||
[_contents_array[i] release];
|
||||
}
|
||||
_contents_array = 0;
|
||||
}
|
||||
NSDeallocateObject(self);
|
||||
GSNOSUPERDEALLOC;
|
||||
[super dealloc];
|
||||
}
|
||||
- (id) init
|
||||
{
|
||||
|
@ -932,10 +932,12 @@ static Class GSInlineArrayClass;
|
|||
|
||||
- (id) initWithArray: (GSArray*)anArray
|
||||
{
|
||||
[super init];
|
||||
array = anArray;
|
||||
IF_NO_GC(RETAIN(array));
|
||||
pos = 0;
|
||||
if ((self = [super init]) != nil)
|
||||
{
|
||||
array = anArray;
|
||||
IF_NO_GC(RETAIN(array));
|
||||
pos = 0;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -949,8 +951,7 @@ static Class GSInlineArrayClass;
|
|||
- (void) dealloc
|
||||
{
|
||||
RELEASE(array);
|
||||
NSDeallocateObject(self);
|
||||
GSNOSUPERDEALLOC;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -209,8 +209,7 @@ unCacheAttributes(NSDictionary *attrs)
|
|||
- (void) dealloc
|
||||
{
|
||||
[self finalize];
|
||||
NSDeallocateObject(self);
|
||||
GSNOSUPERDEALLOC;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSString*) description
|
||||
|
|
|
@ -529,7 +529,7 @@ static IMP gs_objc_msg_forward (SEL sel)
|
|||
- (id) initWithArgframe: (arglist_t)frame selector: (SEL)aSelector
|
||||
{
|
||||
/* We should never get here */
|
||||
NSDeallocateObject(self);
|
||||
[self dealloc];
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"Runtime incorrectly configured to pass argframes"];
|
||||
return nil;
|
||||
|
|
|
@ -292,7 +292,7 @@ static id gs_objc_proxy_lookup(id receiver, SEL op)
|
|||
- (id) initWithArgframe: (arglist_t)frame selector: (SEL)aSelector
|
||||
{
|
||||
/* We should never get here */
|
||||
NSDeallocateObject(self);
|
||||
[self dealloc];
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"Runtime incorrectly configured to pass argframes"];
|
||||
return nil;
|
||||
|
|
|
@ -349,6 +349,8 @@ static void getCString_u(GSStr self, char *buffer, unsigned int maxLength,
|
|||
|
||||
- (void) dealloc
|
||||
{
|
||||
NSLog(@"Warning ... attempt to deallocate instance of %@ in zone %p",
|
||||
NSStringFromClass([self class]), [self zone]);
|
||||
GSNOSUPERDEALLOC; // Placeholders never get deallocated.
|
||||
}
|
||||
|
||||
|
@ -2814,12 +2816,6 @@ transmute(GSStr self, NSString *aString)
|
|||
setup();
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
GSNOSUPERDEALLOC;
|
||||
}
|
||||
|
||||
- (id) initWithBytes: (const void*)chars
|
||||
length: (NSUInteger)length
|
||||
encoding: (NSStringEncoding)encoding
|
||||
|
@ -3190,24 +3186,21 @@ agree, create a new GSCInlineString otherwise.
|
|||
@implementation GSCBufferString
|
||||
- (void) dealloc
|
||||
{
|
||||
if (_flags.owned && _contents.c != 0)
|
||||
if (_contents.c != 0)
|
||||
{
|
||||
NSZoneFree(NSZoneFromPointer(_contents.c), _contents.c);
|
||||
if (_flags.owned)
|
||||
{
|
||||
NSZoneFree(NSZoneFromPointer(_contents.c), _contents.c);
|
||||
}
|
||||
_contents.c = 0;
|
||||
}
|
||||
NSDeallocateObject(self);
|
||||
GSNOSUPERDEALLOC;
|
||||
[super dealloc];
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@implementation GSCInlineString
|
||||
- (void) dealloc
|
||||
{
|
||||
NSDeallocateObject(self);
|
||||
GSNOSUPERDEALLOC;
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
|
@ -3235,8 +3228,7 @@ agree, create a new GSCInlineString otherwise.
|
|||
- (void) dealloc
|
||||
{
|
||||
DESTROY(_parent);
|
||||
NSDeallocateObject(self);
|
||||
GSNOSUPERDEALLOC;
|
||||
[super dealloc];
|
||||
}
|
||||
@end
|
||||
|
||||
|
@ -3528,24 +3520,21 @@ agree, create a new GSUnicodeInlineString otherwise.
|
|||
@implementation GSUnicodeBufferString
|
||||
- (void) dealloc
|
||||
{
|
||||
if (_flags.owned && _contents.u != 0)
|
||||
if (_contents.u != 0)
|
||||
{
|
||||
NSZoneFree(NSZoneFromPointer(_contents.u), _contents.u);
|
||||
if (_flags.owned)
|
||||
{
|
||||
NSZoneFree(NSZoneFromPointer(_contents.u), _contents.u);
|
||||
}
|
||||
_contents.u = 0;
|
||||
}
|
||||
NSDeallocateObject(self);
|
||||
GSNOSUPERDEALLOC;
|
||||
[super dealloc];
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@implementation GSUnicodeInlineString
|
||||
- (void) dealloc
|
||||
{
|
||||
NSDeallocateObject(self);
|
||||
GSNOSUPERDEALLOC;
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
|
@ -3574,8 +3563,7 @@ agree, create a new GSUnicodeInlineString otherwise.
|
|||
- (void) dealloc
|
||||
{
|
||||
DESTROY(_parent);
|
||||
NSDeallocateObject(self);
|
||||
GSNOSUPERDEALLOC;
|
||||
[super dealloc];
|
||||
}
|
||||
@end
|
||||
|
||||
|
@ -3758,8 +3746,7 @@ NSAssert(_flags.owned == 1 && _zone != 0, NSInternalInconsistencyException);
|
|||
self->_contents.c = 0;
|
||||
self->_zone = 0;
|
||||
}
|
||||
NSDeallocateObject(self);
|
||||
GSNOSUPERDEALLOC;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void) deleteCharactersInRange: (NSRange)range
|
||||
|
@ -4571,424 +4558,6 @@ NSAssert(_flags.owned == 1 && _zone != 0, NSInternalInconsistencyException);
|
|||
|
||||
|
||||
|
||||
@interface NSImmutableString: NSString
|
||||
{
|
||||
id _parent;
|
||||
}
|
||||
- (id) initWithString: (NSString*)parent;
|
||||
@end
|
||||
|
||||
@interface GSImmutableString: NSImmutableString
|
||||
@end
|
||||
|
||||
@implementation NSImmutableString
|
||||
|
||||
- (BOOL) canBeConvertedToEncoding: (NSStringEncoding)enc
|
||||
{
|
||||
return [_parent canBeConvertedToEncoding: enc];
|
||||
}
|
||||
|
||||
- (unichar) characterAtIndex: (NSUInteger)index
|
||||
{
|
||||
return [_parent characterAtIndex: index];
|
||||
}
|
||||
|
||||
- (NSComparisonResult) compare: (NSString*)aString
|
||||
options: (NSUInteger)mask
|
||||
range: (NSRange)aRange
|
||||
{
|
||||
return [_parent compare: aString options: mask range: aRange];
|
||||
}
|
||||
|
||||
- (const char *) cString
|
||||
{
|
||||
return [_parent cString];
|
||||
}
|
||||
|
||||
- (const char *) cStringUsingEncoding
|
||||
{
|
||||
return [_parent cStringUsingEncoding];
|
||||
}
|
||||
|
||||
- (NSUInteger) cStringLength
|
||||
{
|
||||
return [_parent cStringLength];
|
||||
}
|
||||
|
||||
- (NSData*) dataUsingEncoding: (NSStringEncoding)encoding
|
||||
allowLossyConversion: (BOOL)flag
|
||||
{
|
||||
return [_parent dataUsingEncoding: encoding allowLossyConversion: flag];
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
RELEASE(_parent);
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (id) copyWithZone: (NSZone*)z
|
||||
{
|
||||
return [_parent copyWithZone: z];
|
||||
}
|
||||
|
||||
- (id) mutableCopy
|
||||
{
|
||||
return [_parent mutableCopy];
|
||||
}
|
||||
|
||||
- (id) mutableCopyWithZone: (NSZone*)z
|
||||
{
|
||||
return [_parent mutableCopyWithZone: z];
|
||||
}
|
||||
|
||||
- (void) encodeWithCoder: (NSCoder*)aCoder
|
||||
{
|
||||
[_parent encodeWithCoder: aCoder];
|
||||
}
|
||||
|
||||
- (NSStringEncoding) fastestEncoding
|
||||
{
|
||||
return [_parent fastestEncoding];
|
||||
}
|
||||
|
||||
- (void) getCharacters: (unichar*)buffer
|
||||
{
|
||||
[_parent getCharacters: buffer];
|
||||
}
|
||||
|
||||
- (void) getCharacters: (unichar*)buffer range: (NSRange)aRange
|
||||
{
|
||||
[_parent getCharacters: buffer range: aRange];
|
||||
}
|
||||
|
||||
- (void) getCString: (char*)buffer
|
||||
{
|
||||
[_parent getCString: buffer];
|
||||
}
|
||||
|
||||
- (void) getCString: (char*)buffer
|
||||
maxLength: (NSUInteger)maxLength
|
||||
{
|
||||
[_parent getCString: buffer maxLength: maxLength];
|
||||
}
|
||||
|
||||
- (BOOL) getCString: (char*)buffer
|
||||
maxLength: (NSUInteger)maxLength
|
||||
encoding: (NSStringEncoding)encoding
|
||||
{
|
||||
return [_parent getCString: buffer maxLength: maxLength encoding: encoding];
|
||||
}
|
||||
|
||||
- (void) getCString: (char*)buffer
|
||||
maxLength: (NSUInteger)maxLength
|
||||
range: (NSRange)aRange
|
||||
remainingRange: (NSRange*)leftoverRange
|
||||
{
|
||||
[_parent getCString: buffer
|
||||
maxLength: maxLength
|
||||
range: aRange
|
||||
remainingRange: leftoverRange];
|
||||
}
|
||||
|
||||
- (NSUInteger) hash
|
||||
{
|
||||
return [_parent hash];
|
||||
}
|
||||
|
||||
- (id) initWithString: (NSString*)parent
|
||||
{
|
||||
_parent = RETAIN(parent);
|
||||
return self;
|
||||
}
|
||||
|
||||
- (BOOL) isEqual: (id)anObject
|
||||
{
|
||||
return [_parent isEqual: anObject];
|
||||
}
|
||||
|
||||
- (BOOL) isEqualToString: (NSString*)anObject
|
||||
{
|
||||
return [_parent isEqualToString: anObject];
|
||||
}
|
||||
|
||||
- (NSUInteger) length
|
||||
{
|
||||
return [_parent length];
|
||||
}
|
||||
|
||||
- (NSUInteger) lengthOfBytesUsingEncoding
|
||||
{
|
||||
return [_parent lengthOfBytesUsingEncoding];
|
||||
}
|
||||
|
||||
- (const char*) lossyCString
|
||||
{
|
||||
return [_parent lossyCString];
|
||||
}
|
||||
|
||||
- (NSUInteger) maximumLengthOfBytesUsingEncoding
|
||||
{
|
||||
return [_parent maximumLengthOfBytesUsingEncoding];
|
||||
}
|
||||
|
||||
- (NSRange) rangeOfComposedCharacterSequenceAtIndex: (NSUInteger)anIndex
|
||||
{
|
||||
return [_parent rangeOfComposedCharacterSequenceAtIndex: anIndex];
|
||||
}
|
||||
|
||||
- (NSRange) rangeOfCharacterFromSet: (NSCharacterSet*)aSet
|
||||
options: (NSUInteger)mask
|
||||
range: (NSRange)aRange
|
||||
{
|
||||
GS_RANGE_CHECK(aRange, ((GSStr)_parent)->_count);
|
||||
return [_parent rangeOfCharacterFromSet: aSet options: mask range: aRange];
|
||||
}
|
||||
|
||||
- (NSRange) rangeOfString: (NSString*)aString
|
||||
options: (NSUInteger)mask
|
||||
range: (NSRange)aRange
|
||||
{
|
||||
GS_RANGE_CHECK(aRange, ((GSStr)_parent)->_count);
|
||||
if (aString == nil)
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"[%@ -%@] nil string argument",
|
||||
NSStringFromClass([self class]), NSStringFromSelector(_cmd)];
|
||||
if (GSObjCIsInstance(aString) == NO)
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"[%@ -%@] not a string argument",
|
||||
NSStringFromClass([self class]), NSStringFromSelector(_cmd)];
|
||||
return [_parent rangeOfString: aString options: mask range: aRange];
|
||||
}
|
||||
|
||||
- (NSStringEncoding) smallestEncoding
|
||||
{
|
||||
return [_parent smallestEncoding];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation GSImmutableString
|
||||
|
||||
+ (void) initialize
|
||||
{
|
||||
setup();
|
||||
}
|
||||
|
||||
- (BOOL) canBeConvertedToEncoding: (NSStringEncoding)enc
|
||||
{
|
||||
if (((GSStr)_parent)->_flags.wide == 1)
|
||||
return canBeConvertedToEncoding_u((GSStr)_parent, enc);
|
||||
else
|
||||
return canBeConvertedToEncoding_c((GSStr)_parent, enc);
|
||||
}
|
||||
|
||||
- (unichar) characterAtIndex: (NSUInteger)index
|
||||
{
|
||||
if (((GSStr)_parent)->_flags.wide == 1)
|
||||
return characterAtIndex_u((GSStr)_parent, index);
|
||||
else
|
||||
return characterAtIndex_c((GSStr)_parent, index);
|
||||
}
|
||||
|
||||
- (NSComparisonResult) compare: (NSString*)aString
|
||||
options: (NSUInteger)mask
|
||||
range: (NSRange)aRange
|
||||
{
|
||||
GS_RANGE_CHECK(aRange, ((GSStr)_parent)->_count);
|
||||
if (aString == nil)
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"[%@ -%@] nil string argument",
|
||||
NSStringFromClass([self class]), NSStringFromSelector(_cmd)];
|
||||
if (GSObjCIsInstance(aString) == NO)
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"[%@ -%@] not a string argument",
|
||||
NSStringFromClass([self class]), NSStringFromSelector(_cmd)];
|
||||
if (((GSStr)_parent)->_flags.wide == 1)
|
||||
return compare_u((GSStr)_parent, aString, mask, aRange);
|
||||
else
|
||||
return compare_c((GSStr)_parent, aString, mask, aRange);
|
||||
}
|
||||
|
||||
- (const char *) cString
|
||||
{
|
||||
if (((GSStr)_parent)->_flags.wide == 1)
|
||||
return cString_u((GSStr)_parent, externalEncoding);
|
||||
else
|
||||
return cString_c((GSStr)_parent, externalEncoding);
|
||||
}
|
||||
|
||||
- (const char *) cStringUsingEncoding: (NSStringEncoding)encoding
|
||||
{
|
||||
if (((GSStr)_parent)->_flags.wide == 1)
|
||||
return cString_u((GSStr)_parent, encoding);
|
||||
else
|
||||
return cString_c((GSStr)_parent, encoding);
|
||||
}
|
||||
|
||||
- (NSUInteger) cStringLength
|
||||
{
|
||||
if (((GSStr)_parent)->_flags.wide == 1)
|
||||
return cStringLength_u((GSStr)_parent, externalEncoding);
|
||||
else
|
||||
return cStringLength_c((GSStr)_parent, externalEncoding);
|
||||
}
|
||||
|
||||
- (NSData*) dataUsingEncoding: (NSStringEncoding)encoding
|
||||
allowLossyConversion: (BOOL)flag
|
||||
{
|
||||
if (((GSStr)_parent)->_flags.wide == 1)
|
||||
return dataUsingEncoding_u((GSStr)_parent, encoding, flag);
|
||||
else
|
||||
return dataUsingEncoding_c((GSStr)_parent, encoding, flag);
|
||||
}
|
||||
|
||||
- (void) encodeWithCoder: (NSCoder*)aCoder
|
||||
{
|
||||
[_parent encodeWithCoder: aCoder];
|
||||
}
|
||||
|
||||
- (NSStringEncoding) fastestEncoding
|
||||
{
|
||||
if (((GSStr)_parent)->_flags.wide == 1)
|
||||
return NSUnicodeStringEncoding;
|
||||
else
|
||||
return internalEncoding;
|
||||
}
|
||||
|
||||
- (void) getCharacters: (unichar*)buffer
|
||||
{
|
||||
if (((GSStr)_parent)->_flags.wide == 1)
|
||||
{
|
||||
getCharacters_u((GSStr)_parent, buffer,
|
||||
(NSRange){0, ((GSStr)_parent)->_count});
|
||||
}
|
||||
else
|
||||
{
|
||||
getCharacters_c((GSStr)_parent, buffer,
|
||||
(NSRange){0, ((GSStr)_parent)->_count});
|
||||
}
|
||||
}
|
||||
|
||||
- (void) getCharacters: (unichar*)buffer range: (NSRange)aRange
|
||||
{
|
||||
GS_RANGE_CHECK(aRange, ((GSStr)_parent)->_count);
|
||||
if (((GSStr)_parent)->_flags.wide == 1)
|
||||
{
|
||||
getCharacters_u((GSStr)_parent, buffer, aRange);
|
||||
}
|
||||
else
|
||||
{
|
||||
getCharacters_c((GSStr)_parent, buffer, aRange);
|
||||
}
|
||||
}
|
||||
|
||||
- (NSUInteger) hash
|
||||
{
|
||||
if (((GSStr)_parent)->_flags.hash == 0)
|
||||
{
|
||||
((GSStr)_parent)->_flags.hash = (*hashImp)((id)_parent, hashSel);
|
||||
}
|
||||
return ((GSStr)_parent)->_flags.hash;
|
||||
}
|
||||
|
||||
- (BOOL) isEqual: (id)anObject
|
||||
{
|
||||
if (((GSStr)_parent)->_flags.wide == 1)
|
||||
return isEqual_u((GSStr)_parent, anObject);
|
||||
else
|
||||
return isEqual_c((GSStr)_parent, anObject);
|
||||
}
|
||||
|
||||
- (BOOL) isEqualToString: (NSString*)anObject
|
||||
{
|
||||
if (((GSStr)_parent)->_flags.wide == 1)
|
||||
return isEqual_u((GSStr)_parent, anObject);
|
||||
else
|
||||
return isEqual_c((GSStr)_parent, anObject);
|
||||
}
|
||||
|
||||
- (NSUInteger) length
|
||||
{
|
||||
return ((GSStr)_parent)->_count;
|
||||
}
|
||||
|
||||
- (NSUInteger) lengthOfBytesUsingEncoding: (NSStringEncoding)encoding
|
||||
{
|
||||
if (((GSStr)_parent)->_flags.wide == 1)
|
||||
return cStringLength_u((GSStr)_parent, encoding);
|
||||
else
|
||||
return cStringLength_c((GSStr)_parent, encoding);
|
||||
}
|
||||
|
||||
- (const char*) lossyCString
|
||||
{
|
||||
if (((GSStr)_parent)->_flags.wide == 1)
|
||||
return lossyCString_u((GSStr)_parent);
|
||||
else
|
||||
return lossyCString_c((GSStr)_parent);
|
||||
}
|
||||
|
||||
- (NSUInteger) maximumLengthOfBytesUsingEncoding
|
||||
{
|
||||
return [_parent maximumLengthOfBytesUsingEncoding];
|
||||
}
|
||||
|
||||
- (NSRange) rangeOfComposedCharacterSequenceAtIndex: (NSUInteger)anIndex
|
||||
{
|
||||
if (((GSStr)_parent)->_flags.wide == 1)
|
||||
return rangeOfSequence_u((GSStr)_parent, anIndex);
|
||||
else
|
||||
return rangeOfSequence_c((GSStr)_parent, anIndex);
|
||||
}
|
||||
|
||||
- (NSRange) rangeOfCharacterFromSet: (NSCharacterSet*)aSet
|
||||
options: (NSUInteger)mask
|
||||
range: (NSRange)aRange
|
||||
{
|
||||
GS_RANGE_CHECK(aRange, ((GSStr)_parent)->_count);
|
||||
if (((GSStr)_parent)->_flags.wide == 1)
|
||||
return rangeOfCharacter_u((GSStr)_parent, aSet, mask, aRange);
|
||||
else
|
||||
return rangeOfCharacter_c((GSStr)_parent, aSet, mask, aRange);
|
||||
}
|
||||
|
||||
- (NSRange) rangeOfString: (NSString*)aString
|
||||
options: (NSUInteger)mask
|
||||
range: (NSRange)aRange
|
||||
{
|
||||
GS_RANGE_CHECK(aRange, ((GSStr)_parent)->_count);
|
||||
if (aString == nil)
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"[%@ -%@] nil string argument",
|
||||
NSStringFromClass([self class]), NSStringFromSelector(_cmd)];
|
||||
if (GSObjCIsInstance(aString) == NO)
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"[%@ -%@] not a string argument",
|
||||
NSStringFromClass([self class]), NSStringFromSelector(_cmd)];
|
||||
if (((GSStr)_parent)->_flags.wide == 1)
|
||||
return rangeOfString_u((GSStr)_parent, aString, mask, aRange);
|
||||
else
|
||||
return rangeOfString_c((GSStr)_parent, aString, mask, aRange);
|
||||
}
|
||||
|
||||
- (NSStringEncoding) smallestEncoding
|
||||
{
|
||||
if (((GSStr)_parent)->_flags.wide == 1)
|
||||
{
|
||||
return NSUnicodeStringEncoding;
|
||||
}
|
||||
else
|
||||
{
|
||||
return internalEncoding;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* <p>The NXConstantString class is used by the compiler for constant
|
||||
* strings, as such its ivar layout is determined by the compiler
|
||||
|
|
|
@ -999,8 +999,7 @@ static Class GSMutableAttributedStringClass;
|
|||
- (void) dealloc
|
||||
{
|
||||
RELEASE(_owner);
|
||||
NSDeallocateObject(self);
|
||||
GSNOSUPERDEALLOC;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSUInteger) length
|
||||
|
|
|
@ -220,8 +220,7 @@ stringFromMsgType(int type)
|
|||
- (void) dealloc
|
||||
{
|
||||
RELEASE(obj);
|
||||
NSDeallocateObject(self);
|
||||
GSNOSUPERDEALLOC;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (BOOL) countdown
|
||||
|
|
|
@ -238,8 +238,7 @@ static NSDistributedNotificationCenter *netCenter = nil;
|
|||
}
|
||||
RELEASE(_remote);
|
||||
RELEASE(_type);
|
||||
NSDeallocateObject(self);
|
||||
GSNOSUPERDEALLOC;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -126,7 +126,7 @@ static NSIndexPath *dummy = nil;
|
|||
NSHashRemove(shared, self);
|
||||
[lock unlock];
|
||||
NSZoneFree(NSDefaultMallocZone(), _indexes);
|
||||
NSDeallocateObject(self);
|
||||
[super dealloc];
|
||||
}
|
||||
GSNOSUPERDEALLOC;
|
||||
}
|
||||
|
|
|
@ -107,12 +107,6 @@ extern BOOL GSScanDouble(unichar*, unsigned, double*);
|
|||
@end
|
||||
@class GSMutableArray;
|
||||
@class GSMutableDictionary;
|
||||
@class NSImmutableString;
|
||||
@interface NSImmutableString : NSObject // Help the compiler
|
||||
@end
|
||||
@class GSImmutableString;
|
||||
@interface GSImmutableString : NSObject // Help the compiler
|
||||
@end
|
||||
|
||||
/*
|
||||
* Cache classes and method implementations for speed.
|
||||
|
@ -5068,31 +5062,3 @@ static NSFileManager *fm = nil;
|
|||
|
||||
@end
|
||||
|
||||
|
||||
/**
|
||||
* GNUstep specific (non-standard) additions to the NSMutableString class.
|
||||
* The methods in this category are not available in MacOS-X
|
||||
*/
|
||||
@implementation NSMutableString (GNUstep)
|
||||
|
||||
/**
|
||||
* Returns a proxy to the receiver which will allow access to the
|
||||
* receiver as an NSString, but which will not allow any of the
|
||||
* extra NSMutableString methods to be used. You can use this method
|
||||
* to provide other code with read-only access to a mutable string
|
||||
* you own.
|
||||
*/
|
||||
- (NSString*) immutableProxy
|
||||
{
|
||||
if ([self isKindOfClass: GSMutableStringClass])
|
||||
{
|
||||
return AUTORELEASE([[GSImmutableString alloc] initWithString: self]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return AUTORELEASE([[NSImmutableString alloc] initWithString: self]);
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -679,8 +679,7 @@ static void setThreadForCurrentThread(NSThread *t)
|
|||
}
|
||||
}
|
||||
DESTROY(_gcontext);
|
||||
NSDeallocateObject(self);
|
||||
GSNOSUPERDEALLOC;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (id) init
|
||||
|
|
Loading…
Reference in a new issue