Commit graph

33 commits

Author SHA1 Message Date
Richard Frith-MacDonald
5e2d923b78 improve comment
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40179 72102866-910b-0410-8b05-ffd578937521
2016-10-26 11:34:11 +00:00
Richard Frith-MacDonald
a51249a65d Apply patch by Patrick Laurent and tidy a bit.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39411 72102866-910b-0410-8b05-ffd578937521
2016-02-24 07:41:20 +00:00
Niels Grewe
28c824a78a Modify the interfaces of all collection classes to be compatible with the
new lightweight generics implemenation. (Newer MacOS X/iOS code assuming 
the presence of the generics annotations can otherwise not be compiled with
GNUstep). This should be well-behaved under clang and gcc both. 

Fix NSCache which was copying the cache keys when it really shouldn't
have. Added a few test cases for eviction behaviour.

Few smaller tweaks to avoid compiler warnings.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39406 72102866-910b-0410-8b05-ffd578937521
2016-02-22 21:04:18 +00:00
Riccardo Mottola
9eac37b9c8 Add firstObject: method existing since 10.6
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38595 72102866-910b-0410-8b05-ffd578937521
2015-06-01 17:43:37 +00:00
Fred Kiefer
32a9c4c1dd * Headers/Foundation/NSArray.h,
* Source/NSArray.m: Move -setValue:forKey: from NSMutableArray
  to NSArray.
Patch by Marcian Lytwyn <marcian.lytwyn@advcsi.com>.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37464 72102866-910b-0410-8b05-ffd578937521
2013-12-13 21:01:22 +00:00
Richard Frith-MacDonald
19bec3c0c9 A few string methods and OSX version compatibility tweaks.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36781 72102866-910b-0410-8b05-ffd578937521
2013-07-01 07:08:55 +00:00
Richard Frith-MacDonald
55149fdc40 Memory management nad documentation fixes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35584 72102866-910b-0410-8b05-ffd578937521
2012-09-21 10:27:05 +00:00
Niels Grewe
f8fd11f3fd Completely overhaul how we do sorting in -base. GSSorting.h now defines an
interface that can be used for all sorting tasks in the library. The actual sort
algorithms to use are now plugable. Timsort is the new default sorting
algorithm, the existing algorithms, shellsort and quicksort, can still be
selected using a configure switch.

Also implement the new NSComparator (blocks) based sorting and insertion index
searching methods for NSMutableArray and NSArray.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35573 72102866-910b-0410-8b05-ffd578937521
2012-09-19 13:31:09 +00:00
David Chisnall
3cb1b08b26 Support for collection subscripting (NSArray and NSDictionary).
Yes, the syntax is ugly, but no doubt people will start using it in June...



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35033 72102866-910b-0410-8b05-ffd578937521
2012-04-06 12:23:10 +00:00
David Chisnall
d2ea054c26 Lots of little fixes to make -base compile with -Werror (now builds without warnings).
Richard: I'm unsure about three of these, which were fixes in memset() calls in:
- NSConcreteMapTable.m
- NSConcreteHashTable.m
- Additions/NSData+GNUstepBase.m

Please can you check them?  I think they are intended to zero the entire object
(rather than the first word), but the lack of comments makes me unsure.

Most changes were just tweaks to variable types.  I've also removed some dead code from NSInvocation.  This was small group of things that were marked for internal use only, but not actually referenced in the code anywhere.

Other improvements:

- NSArray / NSDictionary fixed up to use the 10.7 (ARC-friendly) prototypes.
- getObjects:andKeys: implemented for NSDictionary (10.5 method)
- NSPointerArray and NSHashTable now properly support weak objects.
- Tests for weak objects in collections.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33621 72102866-910b-0410-8b05-ffd578937521
2011-07-24 13:09:22 +00:00
David Chisnall
d323a291d8 Change id* -> id[] for OS X 10.7 compatibility in NSArray. This change is required for ARC: now, id* means pointer to a single object, id[] means array.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33607 72102866-910b-0410-8b05-ffd578937521
2011-07-22 16:07:23 +00:00
David Chisnall
56a002dae7 Rewrote NSProxy's -retain / -release to be the same as NSObject, not its own ad-hoc thing.
Added declaration of __bridge for use in non-ARC mode.

Tweaked arrayWithObjects:count: to take a const id* parameter, to avoid ARC
treating it as a write-back parameter.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33425 72102866-910b-0410-8b05-ffd578937521
2011-06-30 14:44:58 +00:00
Richard Frith-MacDonald
59d4be1265 OSX compat tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32323 72102866-910b-0410-8b05-ffd578937521
2011-02-23 11:52:17 +00:00
Richard Frith-MacDonald
b107ae4ac4 preparation for possibly excluding GNUstep extensions by default
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29690 72102866-910b-0410-8b05-ffd578937521
2010-02-20 17:16:23 +00:00
Richard Frith-MacDonald
6a1ff80510 Backward compatibility fixups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29663 72102866-910b-0410-8b05-ffd578937521
2010-02-18 11:40:58 +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
David Chisnall
34c77138fc Added implementations of some of the new (10.6) NSArray methods that take blocks as arguments. These all use the new GSBlocks.h macros, so compile cleanly with GCC, but can be used by code compiled by clang.
Some of these implementations are not as efficient as they could be (especially the ones that take an NSIndexSet as the first argument).  They also don't yet support concurrent enumeration.  Apple implements these using Grand Central.  We could possibly have a background thread that we send these things to (or use GCD if libdispatch is available).  It's not worth spawning a new thread for them, except in exceptional circumstances (and, unfortunately, we can't easily tell how expensive a single iteration of a block is.  Possibly we could time one block invocation, and if it's longer than some threshold make it concurrent, but it's probably not worth the effort).



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29176 72102866-910b-0410-8b05-ffd578937521
2009-12-27 16:49:52 +00:00
David Chisnall
05f18160df Added -enumerateObjectsUsingBlock: implementation to NSArray.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29174 72102866-910b-0410-8b05-ffd578937521
2009-12-27 15:25:12 +00:00
David Chisnall
7d0822ec49 Made NSArray conform to NSFastEnumeration. No idea why it wasn't already - it implements the methods...
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29173 72102866-910b-0410-8b05-ffd578937521
2009-12-27 14:41:42 +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
ec0b3ab41a MacOS-X compatibility updates.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26598 72102866-910b-0410-8b05-ffd578937521
2008-06-06 13:57:06 +00:00
Richard Frith-MacDonald
d6cfc0e91c Improve MacOS-X compatibility of headers.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25638 72102866-910b-0410-8b05-ffd578937521
2007-11-29 20:53:26 +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
Nicola Pero
6848cb6de9 Review of KVC and improvements by Chris Farber
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25313 72102866-910b-0410-8b05-ffd578937521
2007-07-10 17:16:31 +00:00
Richard Frith-MacDonald
57a828c7c7 Header tidyups, particularly updating of version compatibility macros.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24000 72102866-910b-0410-8b05-ffd578937521
2006-10-31 07:05:46 +00:00
Richard Frith-MacDonald
f645b84196 Resolve bug 17464
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23488 72102866-910b-0410-8b05-ffd578937521
2006-09-13 10:20:49 +00:00
Richard Frith-MacDonald
c2e8c881e7 Some cleanup in preparation for next release.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22618 72102866-910b-0410-8b05-ffd578937521
2006-03-08 11:28:59 +00:00
Richard Frith-Macdonald
c9c6734169 Spelling fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21962 72102866-910b-0410-8b05-ffd578937521
2005-11-06 13:53:40 +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
90a810065d MacOS-X compatibility fixes and improved documentation about class cluster
initialisers.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20012 72102866-910b-0410-8b05-ffd578937521
2004-09-07 05:43:20 +00:00
Manuel Guesdon
63ba83e121 2004-01-06 Manuel Guesdon <mguesdon@orange-concept.com>
* Headers/Foundation/NSArray.h/.m: added -setValue:forKey:
	      and -valueForKey: to comply to Mac OS X v10.3 and
		  later documentation.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@18322 72102866-910b-0410-8b05-ffd578937521
2004-01-06 19:43:29 +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
Renamed from Headers/gnustep/base/NSArray.h (Browse further)