Commit graph

71 commits

Author SHA1 Message Date
rfm
d605c6f7b5 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
rfm
bbcf9bd03e 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
rfm
c45deb3cf8 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
rfm
31c03da34f 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
rfm
c4e1e08185 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
rfm
255df37b43 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
theraven
e486341176 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
rfm
f13d56d8ec 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
rfm
b3a79482e5 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
rfm
30cf8bf35b 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
rfm
e0711a3b8d 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
rfm
cd46236028 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
rfm
4f6e71abcd 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
rfm
a1e3e69f70 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
rfm
595be905a3 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
rfm
e7962cfb4d 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
CaS
4c7e6af282 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
fedor
376e495dad * 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
CaS
0708409c1b 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
arobert
dbdfcfab37 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
CaS
01b40beefb 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
mguesdon
83254a02f7 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
CaS
418907a03d 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
CaS
99ac08eca9 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
ayers
0db6d0ea2f * 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
CaS
cfb39df8a1 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
ayers
73dc4cb9f6 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
CaS
14577e9418 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
fedor
0e59d4552d 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
fedor
0bfcabe78e 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
CaS
b0d816ceaa 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
CaS
18c22223ec 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
CaS
d4b9683acf 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
CaS
d7e28f6deb 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
CaS
e9286f7697 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
CaS
71cd221a69 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
fedor
ac7eae4414 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
a4530c1a88 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
3df5d8e527 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
f4817879df 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
65241c052d 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
6c0137925a 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
0f42d88560 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
fedor
a051ddd885 Merge 0.6.6 branch into main.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@7187 72102866-910b-0410-8b05-ffd578937521
2000-08-07 22:00:31 +00:00
richard
54e75a58b9 NSNumber rewrite
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6366 72102866-910b-0410-8b05-ffd578937521
2000-03-23 18:57:43 +00:00
richard
7a1f4723a4 NSNumber fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6337 72102866-910b-0410-8b05-ffd578937521
2000-03-19 21:40:06 +00:00
richard
8960685649 Tiny performance improvements when testing for equality
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6336 72102866-910b-0410-8b05-ffd578937521
2000-03-19 21:04:02 +00:00
richard
0e631567e4 Changes for optimisation of storage of numbers in sets/maps/dictionaries and
for small numbers in particular.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6335 72102866-910b-0410-8b05-ffd578937521
2000-03-19 20:57:09 +00:00
richard
009d8dacbb Added methods
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6320 72102866-910b-0410-8b05-ffd578937521
2000-03-18 07:56:43 +00:00
fedor
302c691e79 Merge from dawn
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4853 72102866-910b-0410-8b05-ffd578937521
1999-09-09 02:56:20 +00:00