mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 08:41:03 +00:00
Make NSNumber more like OSX ... retain for copy, and return YES/NO as BOOL
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29676 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d6a9545848
commit
0d67ea2cac
5 changed files with 27 additions and 114 deletions
|
@ -400,6 +400,12 @@ static Class NSDoubleNumberClass;
|
|||
|
||||
#include "GSNumberTypes.h"
|
||||
|
||||
- (id) initWithBool: (BOOL)aValue
|
||||
{
|
||||
[self release];
|
||||
return [[NSNumberClass numberWithBool: aValue] retain];
|
||||
}
|
||||
|
||||
/*
|
||||
* Macro for checking whether this value is the same as one of the singleton
|
||||
* instances.
|
||||
|
@ -596,14 +602,8 @@ if (aValue >= -1 && aValue <= 12)\
|
|||
|
||||
- (id) copyWithZone: (NSZone *) aZone
|
||||
{
|
||||
if (NSShouldRetainWithZone (self, aZone))
|
||||
{
|
||||
return RETAIN (self);
|
||||
}
|
||||
else
|
||||
{
|
||||
return NSCopyObject (self, 0, aZone);
|
||||
}
|
||||
// OSX just returns the receive with no copy.
|
||||
return RETAIN (self);
|
||||
}
|
||||
|
||||
- (id) initWithCoder: (NSCoder *) coder
|
||||
|
@ -643,6 +643,13 @@ if (aValue >= -1 && aValue <= 12)\
|
|||
}
|
||||
|
||||
#include "GSNumberTypes.h"
|
||||
|
||||
- (BOOL) boolValue
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (NSDecimal) decimalValue
|
||||
{
|
||||
NSDecimalNumber *dn;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue