Commit graph

5208 commits

Author SHA1 Message Date
rfm
91e22a6407 OSX compatibility update for newline character set.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29249 72102866-910b-0410-8b05-ffd578937521
2010-01-09 07:45:18 +00:00
rfm
25ad93b2f7 Fix for exception handling with libobjc2
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29247 72102866-910b-0410-8b05-ffd578937521
2010-01-09 07:24:05 +00:00
ericwa
2c28fd3e4c Implement +[NSCharacterSet newlineCharacterSet]
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29219 72102866-910b-0410-8b05-ffd578937521
2010-01-05 22:28:12 +00:00
theraven
0bd156fa4a Refactored last two commits so that all of the real code is in GSIMap.h and is just called from the relevant classes, rather than copied and pasted everywhere. Also added fast enumeration support to GSCountedSet.
I think that's all of the classes that use GSIMaps for their implementation now fully supporting fast enumeration.  If there are any that I've missed, then just copy the methods from GSSet to implement them.  You just need to set the mutations pointer to something sensible (i.e. something that will change if the collection mutates) and then call the new GSIMapCountByEnumeratingWithStateObjectsCount() function.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29181 72102866-910b-0410-8b05-ffd578937521
2009-12-29 16:49:07 +00:00
theraven
55e8317350 Added fast enumeration support to GS[Mutable]Dictionary. This follows exactly the same pattern (and uses the same code as) GSSet. It's probably worth factoring out this code, because it is now used in four methods with almost no variation between them.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29180 72102866-910b-0410-8b05-ffd578937521
2009-12-29 16:21:01 +00:00
theraven
cee58ca099 Added fast enumeration to NSSet. This changed the layout of GSMutableSet, adding a _version ivar, but this is a private class so it doesn't change the public ABI. All mutator methods in GSMutableSet must increment this variable, allowing thread-safe fast enumeration.
As with GSArray, GSSet uses its isa pointer for detecting mutations.  This may change as a result of adding KVO notifications, so it might not be the best solution, but I can't currently think of a way we could catch isa changing to [GSMutableSet class] and not changing to a hidden class...



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29179 72102866-910b-0410-8b05-ffd578937521
2009-12-29 15:59:14 +00:00
theraven
c5cf5e4535 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
theraven
23b31db6b3 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
theraven
301520a1d7 Tidied up some compiler warnings in last commit.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29172 72102866-910b-0410-8b05-ffd578937521
2009-12-27 14:41:15 +00:00
theraven
c62a66443c Fixed missing } in last commit.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29171 72102866-910b-0410-8b05-ffd578937521
2009-12-27 14:37:41 +00:00
theraven
9d55a856cf Added private GSFastEnumeration header. This defines two macros that allow fast enumeration to be used inside GNUstep. Use, for example:
NSArray *a=  [NSArray arrayWithObjects: @"a", @"b", @"c", nil];
FOR_IN(NSString*, o, a)
	NSLog(@"%@", o);
END_FOR_IN(a)

This is equivalent to:

for (NSString *o in a)
{
	NSLog(@"%@", o);
}

On clang, it will be expanded to exactly that.  With GCC, it will be expanded to something equivalent to the code that Clang (or Apple GCC) would expand this to.

This is a private GNUstep header and is not intended for general use.  Outside of GNUstep, please use fast enumeration directly.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29170 72102866-910b-0410-8b05-ffd578937521
2009-12-27 14:34:10 +00:00
wlux
2aee2c5236 Add an auxiliary method to NSUndoManager to support coalescing undo
operations in NSTextView.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29163 72102866-910b-0410-8b05-ffd578937521
2009-12-22 23:43:38 +00:00
gcasa
e66625cfdf Conditionally compile weak attribute.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29159 72102866-910b-0410-8b05-ffd578937521
2009-12-22 22:12:56 +00:00
theraven
fffe50ffdc Added call to objc_create_block_classes_as_subclasses_of() in NSObject's +load method. This is called as soon as NSObject is loaded and creates the _NSBlock family of classes, which are statically allocated in the runtime but not statically initialised. If you create blocks without linking GNUstep-base, the isa pointer in the block will point to a class that has all of its fields set to 0.
Any blocks will have their isa pointer set to the two classes statically allocated in libobjc, but these classes can't be used for message lookup (or introspection) until after the call.  This means that you can't send messages to blocks until after NSObject's +load method has been called.  This shouldn't be a problem in most code, but if you use __attribute__((constructor)) instead of a +load method then be careful about sending messages to blocks (you can still call them as normal). 



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29144 72102866-910b-0410-8b05-ffd578937521
2009-12-20 16:59:41 +00:00
gcasa
b7894ad188 * Source/GNUmakefile: Add synchronization.m to GNU_MFILES
and correct some formatting.
	* Source/synchronization.m: Fix @synchronize support on
	Windows.   The __weak__ attribute doesn't work on Windows.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29140 72102866-910b-0410-8b05-ffd578937521
2009-12-19 18:52:05 +00:00
rfm
d56ff38a2a Readability tweak
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29115 72102866-910b-0410-8b05-ffd578937521
2009-12-11 15:13:16 +00:00
gcasa
da7701eb6f * Source/synchronization.m: Corrected header text.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29114 72102866-910b-0410-8b05-ffd578937521
2009-12-11 06:42:12 +00:00
rfm
c84063c3a8 GSMutableString inherits hash implementation from GSString
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29105 72102866-910b-0410-8b05-ffd578937521
2009-12-07 05:10:50 +00:00
rfm
f8c0ecf186 improve string comparison.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29104 72102866-910b-0410-8b05-ffd578937521
2009-12-07 05:02:55 +00:00
rfm
7abb743f91 Move hash implementation to GSString
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29096 72102866-910b-0410-8b05-ffd578937521
2009-12-04 09:52:14 +00:00
rfm
ed0d9c8014 Perform port/name cleanup on startup.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29095 72102866-910b-0410-8b05-ffd578937521
2009-12-03 09:07:10 +00:00
rfm
b025de4a73 fixup missing notification changes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29087 72102866-910b-0410-8b05-ffd578937521
2009-12-01 08:30:41 +00:00
rfm
a4d6e16f4c clarify
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29086 72102866-910b-0410-8b05-ffd578937521
2009-12-01 07:49:38 +00:00
rfm
119de7ab88 clarify doccumentation a little
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29085 72102866-910b-0410-8b05-ffd578937521
2009-12-01 07:47:29 +00:00
rfm
845201b6f5 avoid warning log about unexpected response
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29075 72102866-910b-0410-8b05-ffd578937521
2009-11-27 13:05:26 +00:00
rfm
9a772dd309 improve error message
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29074 72102866-910b-0410-8b05-ffd578937521
2009-11-27 10:55:42 +00:00
rfm
1f22968eb4 Attempt notification queue fix
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29073 72102866-910b-0410-8b05-ffd578937521
2009-11-27 10:42:33 +00:00
rfm
ee898e98e1 stricter check of plist keys
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29071 72102866-910b-0410-8b05-ffd578937521
2009-11-27 09:19:02 +00:00
rfm
39108cd5d9 encoding fixup for xml with bad dictionary key
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29070 72102866-910b-0410-8b05-ffd578937521
2009-11-27 09:10:15 +00:00
rfm
b244c84d70 Tweak for serializing 'xml' property lists
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29069 72102866-910b-0410-8b05-ffd578937521
2009-11-27 08:44:43 +00:00
rfm
fb3ff1f085 pass more info to notification functions
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29068 72102866-910b-0410-8b05-ffd578937521
2009-11-27 07:53:38 +00:00
rfm
703dad767d Add osx compatibility option
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29067 72102866-910b-0410-8b05-ffd578937521
2009-11-26 22:15:39 +00:00
rfm
3c8d8797a6 Fix for XML plist parsing.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29066 72102866-910b-0410-8b05-ffd578937521
2009-11-26 21:57:26 +00:00
wlux
d7259afa3c Write out proper XML encoding for control characters. Fixes a bug
where menu positions in GUI programs would appear not persistent.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29064 72102866-910b-0410-8b05-ffd578937521
2009-11-26 17:34:16 +00:00
rfm
3a390b4d65 better attempt at workaround for broken libobjc
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29057 72102866-910b-0410-8b05-ffd578937521
2009-11-24 20:39:31 +00:00
rfm
43cda8ed2c tidy
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29049 72102866-910b-0410-8b05-ffd578937521
2009-11-23 18:07:25 +00:00
theraven
5e3de82c70 Added fall-back line for forwarding. Now -forwardingProxyForSelector: should work on all runtimes, with all ABIs, it will just be painfully slow on the GCC runtime and the legacy ABI.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29048 72102866-910b-0410-8b05-ffd578937521
2009-11-23 16:43:08 +00:00
rfm
d9749d603d Documentation generation improvments
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29047 72102866-910b-0410-8b05-ffd578937521
2009-11-23 09:42:18 +00:00
rfm
f3eaac4188 minor debug improvement
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28988 72102866-910b-0410-8b05-ffd578937521
2009-11-10 09:14:57 +00:00
rfm
ab08a4642b Have -drain call -release
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28950 72102866-910b-0410-8b05-ffd578937521
2009-11-04 05:51:34 +00:00
rfm
43e2bd29f4 Avoid memory leak and improve performance for common structures.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28939 72102866-910b-0410-8b05-ffd578937521
2009-11-02 18:32:35 +00:00
fedor
c3f8da55d7 * Source/Makefile.postamble: Add flag filter for libgnustep-base-entry.m (for GCC 4.4 on MinGW).
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28889 72102866-910b-0410-8b05-ffd578937521
2009-10-26 18:01:08 +00:00
wlux
56ba86ce4c Prevent potential deadlock in multithreaded programs due to an
allocation lock that was never unlocked.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28859 72102866-910b-0410-8b05-ffd578937521
2009-10-20 05:25:04 +00:00
rfm
8755ceb15b simplify for older compilers
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28821 72102866-910b-0410-8b05-ffd578937521
2009-10-13 09:59:34 +00:00
rfm
e054b0321e fix missing macro
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28817 72102866-910b-0410-8b05-ffd578937521
2009-10-12 19:04:21 +00:00
rfm
d8a2ff7287 new initialisation function.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28806 72102866-910b-0410-8b05-ffd578937521
2009-10-12 14:38:49 +00:00
rfm
3e76492092 patch for kvo struct setters by Eric Wasylishen
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28793 72102866-910b-0410-8b05-ffd578937521
2009-10-11 04:57:34 +00:00
rfm
6bf3a906e9 cleanups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28787 72102866-910b-0410-8b05-ffd578937521
2009-10-10 08:16:17 +00:00
rfm
4c004d6da5 Fix files missed from last ocmmit.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28780 72102866-910b-0410-8b05-ffd578937521
2009-10-07 14:54:37 +00:00
rfm
16ce1cd7b3 lrge changes to remove mframe
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28778 72102866-910b-0410-8b05-ffd578937521
2009-10-05 16:00:28 +00:00