Commit graph

78 commits

Author SHA1 Message Date
Richard Frith-MacDonald
cdd3ef3c76 Number rewrite broke subclasses ... fix to check for that.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30693 72102866-910b-0410-8b05-ffd578937521
2010-06-12 19:13:23 +00:00
Richard Frith-MacDonald
74736d8ef4 Fix for isEqual: and NaN comparison
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29781 72102866-910b-0410-8b05-ffd578937521
2010-02-26 11:20:21 +00:00
Richard Frith-MacDonald
14b91c9052 fixups for libobjc2
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29753 72102866-910b-0410-8b05-ffd578937521
2010-02-25 18:49:31 +00:00
Fred Kiefer
36da53fca3 Small bug fix for NSNumber to prevent memory leaks.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29706 72102866-910b-0410-8b05-ffd578937521
2010-02-22 23:49:33 +00:00
Richard Frith-MacDonald
dd42cc24ba Move includes to NSObjCRuntime.h to match OSX
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29692 72102866-910b-0410-8b05-ffd578937521
2010-02-20 18:32:07 +00:00
Richard Frith-MacDonald
d819b3a645 remove useless calls to zone of class
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29677 72102866-910b-0410-8b05-ffd578937521
2010-02-19 19:37:04 +00:00
Richard Frith-MacDonald
012fa8e513 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
2010-02-19 19:23:03 +00:00
Richard Frith-MacDonald
7cc69dfaae Simplify header inclusion
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29669 72102866-910b-0410-8b05-ffd578937521
2010-02-19 08:12:46 +00:00
Richard Frith-MacDonald
746afbcb53 Update integer limits code.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29661 72102866-910b-0410-8b05-ffd578937521
2010-02-18 07:06:42 +00:00
Richard Frith-MacDonald
7cd2a7551b fix typo
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29660 72102866-910b-0410-8b05-ffd578937521
2010-02-17 22:27:53 +00:00
Richard Frith-MacDonald
92bceae15f standardise on using c99 limits (define old values to the new ones)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29658 72102866-910b-0410-8b05-ffd578937521
2010-02-17 12:07:48 +00:00
Richard Frith-MacDonald
5297a2e32b Rewrite NSNumber code to compile on most systems and to mostly conform to
style/coding standards.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29639 72102866-910b-0410-8b05-ffd578937521
2010-02-15 10:58:34 +00:00
Richard Frith-MacDonald
d2f84d8995 Restore working NSNumber pending fixes to new version to get it to compile
and conform to coding standards/style.  Should get svn trunk working again.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29629 72102866-910b-0410-8b05-ffd578937521
2010-02-14 16:32:02 +00:00
David Chisnall
99cb20ae16 Rewritten NSNumber implementation. This fixes several OS X-compatibility issues:
The -pointerValue method now returns the value cast to a pointer, not some random value, as the documentation says it should.  This is a change from OpenStep, which said:

> It's an error to send this message to an NSValue that doesn't store a pointer.

The OS X docs now say:

> The receiver's value as a pointer to void. If the receiver was not created to hold a pointer-sized data item, the result is undefined.

This means that any NSNumber created with a word-sized integer should return the same value.

Fixed a number of corner-cases in the compare: implementation caused by incorrect type promotion.  The OS X docs say:

> The compare: method follows the standard C rules for type conversion.

The OS X implementation does not do this.  We now match Apple's conversion rules bug-for-bug: Every value is stored in the smallest signed type that will hold it, unless there is no unsigned type that can hold it, in which case it is stored in an `unsigned long long`, comparisons between integer and floating point values cast both to a double, comparisons between integer types perform a real comparison (so an unsigned long long is always greater than any negative number, at any precision).  The Apple implementation is actually quite sane, it is just completely unrelated to the documentation in any way.

We now use the same range of reusable objects.  Note that there is an error in Cocoa Design Patterns in the description of how Apple's implementation works.  Do not use this as a reference.

We now return `nil` when an NSNumber is sent an -init message.  This is consistent with Apple's implementation but breaks some things in the GNUstep test suite (which RFM said he will fix).

There is a small change in NSValue.h so that the locale parameter is now an `id` not an `NSString*`.  This is because, under recent OS X, it may also be an `NSLocale` instance.  I am not sure how much GNUstep supports `NSLocale`, but this change shouldn't affect anything.

The new (private) GSNumberTypes.h file lets you define macros that are instantiated with each of the names of primitive C types.  These might be useful for simplifying other classes that have -intValue, -floatValue, and so on methods, such as the `NSCell` family.

The old NSConcreteNumberTemplate and NSConcreteNumber stuff has been removed.  The code is now a bit more than 10% of the size of the old NSNumber code, and is hopefully maintainable now, so the next change won't require a complete rewrite.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29618 72102866-910b-0410-8b05-ffd578937521
2010-02-14 12:57:44 +00:00
Richard Frith-MacDonald
21d597e740 merge back reorganisation branch
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29615 72102866-910b-0410-8b05-ffd578937521
2010-02-14 10:48:10 +00:00
Richard Frith-MacDonald
a15a02db18 Quick hack to try to fix initialisation
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29393 72102866-910b-0410-8b05-ffd578937521
2010-01-24 17:54:31 +00:00
Richard Frith-MacDonald
24d43481a8 Updates for 10.5 API changes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27962 72102866-910b-0410-8b05-ffd578937521
2009-02-23 20:42:32 +00:00
Richard Frith-MacDonald
b2b14398d2 allow developers more time to adapt to LGPLv3
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26606 72102866-910b-0410-8b05-ffd578937521
2008-06-08 10:38:33 +00:00
Richard Frith-MacDonald
62559023b9 Update to GPL3 and LGPL3
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25482 72102866-910b-0410-8b05-ffd578937521
2007-09-14 11:36:11 +00:00
Richard Frith-MacDonald
da789a0c2b Fix bug #20168
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25254 72102866-910b-0410-8b05-ffd578937521
2007-06-14 05:03:35 +00:00
Richard Frith-MacDonald
0785e1104f MacOS-X compatibility tweak
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24663 72102866-910b-0410-8b05-ffd578937521
2007-02-20 08:47:55 +00:00
Richard Frith-MacDonald
e26157d901 hash tidyups and rewrite of array sorting for better performance.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23967 72102866-910b-0410-8b05-ffd578937521
2006-10-26 08:33:40 +00:00
Richard Frith-MacDonald
087e9db5e6 avoid spurious compiler warnings
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23027 72102866-910b-0410-8b05-ffd578937521
2006-06-04 06:42:10 +00:00
Richard Frith-Macdonald
d7dcbb06b7 Improve performance of hash (for use as dictionary keys)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21691 72102866-910b-0410-8b05-ffd578937521
2005-08-31 09:34:33 +00:00
Adam Fedor
fcc13ccd0f * Update FSF Address.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21245 72102866-910b-0410-8b05-ffd578937521
2005-05-22 03:32:16 +00:00
Richard Frith-Macdonald
db7b22a4fb Tidy up use of white space so we have it after if/for/while and not after (
or before ) or padding at end of line.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20773 72102866-910b-0410-8b05-ffd578937521
2005-02-22 11:22:44 +00:00
Adrian Robert
bda35fceb3 added GSdoc comments to class, method, and function declarations; for some classes some comments were already in the source file (not the header), in which case further comments were added here; otherwise comments were put in the headers
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@19588 72102866-910b-0410-8b05-ffd578937521
2004-06-22 22:40:40 +00:00
Richard Frith-Macdonald
a4728fc1d7 Retain/release fixes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@19074 72102866-910b-0410-8b05-ffd578937521
2004-04-11 05:22:33 +00:00
Manuel Guesdon
9962ec6928 2004-01-31 Manuel Guesdon <mguesdon@orange-concept.com>
* Source/NSNumber.m: Modified numberWithXX: methods
	to test against abstractClass. If class is not the abstract
	class, we alloc object of class instead of allocating
	NSXXNumber objects (cf [NSDecimalNumber numberWithDouble:x]
	thread)


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@18515 72102866-910b-0410-8b05-ffd578937521
2004-01-31 16:28:35 +00:00
Richard Frith-Macdonald
1c24d6feb9 Several minor bugfixes in handling BOOL values, fix crash in shrinking
mutable data.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@18507 72102866-910b-0410-8b05-ffd578937521
2004-01-30 11:30:56 +00:00
Richard Frith-Macdonald
d2936869b9 Minor usability tweak.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@18240 72102866-910b-0410-8b05-ffd578937521
2003-11-30 09:05:31 +00:00
David Ayers
45fb8a2fb2 * Source/NSConcreteNumber.h: Moved here from
Headers/Foundation/NSConcreteNumber.h.
        * Source/GNUmakefile: Make NSConcreteNumber.h private.
        * Source/NSConcreteNumber.m: Include NSConcreteNumber.h from
        new location.
        * Source/NSNumber.m: Ditto.
        * Source/NSURL.m: Include NSValue.h in favor of private
        NSConcreteNumber.h.
        * Source/NSURLHandle.m: Do not include NSConcreteNumber.h.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@17954 72102866-910b-0410-8b05-ffd578937521
2003-10-22 16:26:02 +00:00
Richard Frith-Macdonald
876ae7e458 Avoid trivial warnings
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@17510 72102866-910b-0410-8b05-ffd578937521
2003-08-22 10:31:16 +00:00
David Ayers
ac30183cd6 Header reorganizsateion - Please refer to ChangeLog
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@17407 72102866-910b-0410-8b05-ffd578937521
2003-07-31 23:49:32 +00:00
Richard Frith-Macdonald
afb5488c8b A couple of locale fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@17167 72102866-910b-0410-8b05-ffd578937521
2003-07-07 09:05:53 +00:00
Adam Fedor
d228cba99b Change syntax of includes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@16874 72102866-910b-0410-8b05-ffd578937521
2003-06-07 01:24:41 +00:00
Adam Fedor
e596a161f2 Move more additional methods to the Additions libtrary.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@16299 72102866-910b-0410-8b05-ffd578937521
2003-03-31 02:59:56 +00:00
Richard Frith-Macdonald
fddaa462bc Documentation tidyups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14298 72102866-910b-0410-8b05-ffd578937521
2002-08-20 10:22:05 +00:00
Richard Frith-Macdonald
5606926df2 Fix a variety of dumb bugs.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14268 72102866-910b-0410-8b05-ffd578937521
2002-08-14 07:36:25 +00:00
Richard Frith-Macdonald
a0a6f5f346 Added date version and title
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11814 72102866-910b-0410-8b05-ffd578937521
2001-12-18 16:54:15 +00:00
Richard Frith-Macdonald
5be36e089c Many minor fixes for autogsdoc.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11787 72102866-910b-0410-8b05-ffd578937521
2001-12-17 14:31:42 +00:00
Richard Frith-Macdonald
920c3bef8e Some formatting changes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11371 72102866-910b-0410-8b05-ffd578937521
2001-11-12 13:01:09 +00:00
Richard Frith-Macdonald
299c88a96b Tidied NSNumber descriptions to conform to MacOS-X imnplementation
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11370 72102866-910b-0410-8b05-ffd578937521
2001-11-12 12:09:40 +00:00
Adam Fedor
ab97cd08af Fix portability of [un]signed char encodings
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9921 72102866-910b-0410-8b05-ffd578937521
2001-05-11 15:23:24 +00:00
Richard Frith-MacDonald
6330501121 Placeholder class used in strings
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@7999 72102866-910b-0410-8b05-ffd578937521
2000-11-03 10:11:56 +00:00
Richard Frith-MacDonald
42011ceae4 Basic tidyup for start of support for apple runtime
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@7949 72102866-910b-0410-8b05-ffd578937521
2000-10-31 16:17:33 +00:00
Richard Frith-MacDonald
f926a998e8 Tidying optimisation stuff.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@7938 72102866-910b-0410-8b05-ffd578937521
2000-10-31 11:05:23 +00:00
Richard Frith-MacDonald
db8f01b38e Class cluster and encoding/decoding fixes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@7825 72102866-910b-0410-8b05-ffd578937521
2000-10-16 12:35:42 +00:00
Richard Frith-MacDonald
46644b7779 Use NSZone functions for memory allocation
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@7780 72102866-910b-0410-8b05-ffd578937521
2000-10-10 19:47:54 +00:00
Richard Frith-MacDonald
ee3d710d31 Avoid compiler warning
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@7191 72102866-910b-0410-8b05-ffd578937521
2000-08-09 14:40:14 +00:00