Commit graph

6050 commits

Author SHA1 Message Date
theraven
ceba92a265 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
theraven
fc206e3169 Add support (and test) for weak keys and values in NSMapTable. This support should work in GC mode. It also works if the runtime supports ARC, even if the compiler does not use this support.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33617 72102866-910b-0410-8b05-ffd578937521
2011-07-23 16:16:01 +00:00
theraven
863fff32b7 Remove the zone pointer from objects. Now we always query the zones to find the relevant pointer. Zones are still supported, but we now optimise for the case where they are not used.
To disable zone support completely, NSAllocateObject() should ignore the zone and NSDeallocateObject() should skip the zone lookup.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33610 72102866-910b-0410-8b05-ffd578937521
2011-07-23 12:19:19 +00:00
theraven
9dbeddeeae Missing part of the NSArray update.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33609 72102866-910b-0410-8b05-ffd578937521
2011-07-23 12:02:04 +00:00
theraven
b5b216f2be 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
theraven
a76cd2adb3 I give up. No brain left.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33605 72102866-910b-0410-8b05-ffd578937521
2011-07-22 13:37:38 +00:00
theraven
d24eeb55ce Third try.
[NSException raise: GSNotEnoughCoffeeException];



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33604 72102866-910b-0410-8b05-ffd578937521
2011-07-22 13:34:08 +00:00
theraven
0d5d27b6a1 Add missing #import.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33603 72102866-910b-0410-8b05-ffd578937521
2011-07-22 13:27:04 +00:00
theraven
4a277ee9ac Stub for NSRegularExpression when a compatible version of ICU is not present.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33602 72102866-910b-0410-8b05-ffd578937521
2011-07-22 13:23:11 +00:00
theraven
b45d78dfa7 Added NSRegularExpressionSearch (10.7) support to NSString.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33600 72102866-910b-0410-8b05-ffd578937521
2011-07-21 13:17:27 +00:00
ericwa
909fc55ca2 * Source/NSNumberFormatter.m
(-attributedStringForObjectValue:withDefaultAttributes:):
Guard against initializing an NSAttributedString with a nil string.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33596 72102866-910b-0410-8b05-ffd578937521
2011-07-21 01:43:07 +00:00
ericwa
5800130467 * Source/GSAttributedString.m: Throw an exception if the string object
passed to -initWithString:attributes: doesn't respond to -length, or if
it is nil. This is the same behaviour as OS X.
* Source/NSAttributedString.m (-init): Call -initWithString:attributes:
with @"" instead of nil, since passing nil now causes an exception
to be thrown.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33595 72102866-910b-0410-8b05-ffd578937521
2011-07-21 01:23:08 +00:00
rfm
9623471068 try to ensure that including objc/runtime.h always works to get the new API.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33583 72102866-910b-0410-8b05-ffd578937521
2011-07-19 09:38:51 +00:00
rfm
cc524f2704 For the avoidance of confusion, remove references to obsolete header.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33562 72102866-910b-0410-8b05-ffd578937521
2011-07-15 13:53:45 +00:00
rfm
8dadaadea4 fix faulty assert
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33560 72102866-910b-0410-8b05-ffd578937521
2011-07-15 13:46:51 +00:00
rfm
6264555674 ssh handshake improvements and consmetic tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33535 72102866-910b-0410-8b05-ffd578937521
2011-07-12 11:40:15 +00:00
theraven
853f52049b Do the things from the last commit in the correct order.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33523 72102866-910b-0410-8b05-ffd578937521
2011-07-11 15:12:47 +00:00
theraven
354c8b3e5a Lazily initialize POSIX threads, matching OS X behaviour and stopping us from crashing when calling autorelease from a thread that was not previously registered explicitly (yuck!)
Also do some quite hacky (and not totally correct) things to try to make sure that we aren't confused into thinking that the first NSThread is the main thread, if it's created on a separate thread.  Currently only supported on FreeBSD and OpenBSD.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33521 72102866-910b-0410-8b05-ffd578937521
2011-07-11 14:31:36 +00:00
theraven
166a5fd8f5 [NSNumber -init] should not destroy itself when called as [super init]. This behaviour was breaking anything that subclassed NSNumber in user code (e.g. PyObjC).
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33517 72102866-910b-0410-8b05-ffd578937521
2011-07-11 12:36:04 +00:00
fredkiefer
3719351613 * Source/GSLocale.m (GSLanguageFromLocale): Handle local "C.UTF-8"
correctly. Needed for Cygwin.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33516 72102866-910b-0410-8b05-ffd578937521
2011-07-11 11:55:35 +00:00
fredkiefer
2279a6ccfb Support the OpenSuse key TIMEZONE in /etc/sysconfig/clock.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33512 72102866-910b-0410-8b05-ffd578937521
2011-07-11 09:35:54 +00:00
wlux
3d7865c21b Override NSObject +zone to ensure that -zone returns a valid zone
pointer when it is called on a class object.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33498 72102866-910b-0410-8b05-ffd578937521
2011-07-10 14:48:26 +00:00
theraven
3d2999fc40 Silence type errors by declaring the correct superclass of GSPlaceholderString.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33481 72102866-910b-0410-8b05-ffd578937521
2011-07-07 12:32:59 +00:00
theraven
f40d537913 Don't DESTROY() the placeholder string - that doesn't destroy it (since it overrides -release to do nothing), it just makes it unreachable.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33480 72102866-910b-0410-8b05-ffd578937521
2011-07-07 12:32:05 +00:00
theraven
e1517e15e6 Fix a memory leak that valgrind spotted.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33479 72102866-910b-0410-8b05-ffd578937521
2011-07-07 12:30:10 +00:00
theraven
d5d099e7a6 Use -retainCount instead of NSExtraRefCount() in gs_weak_load() so we can support objects that define a custom retain / release mechanism in weak variables.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33478 72102866-910b-0410-8b05-ffd578937521
2011-07-07 12:29:54 +00:00
theraven
af93046588 Fix typo NS -> GS. We don't actually want NSAllocateObject to call NSAllocateObject...
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33458 72102866-910b-0410-8b05-ffd578937521
2011-07-04 21:23:26 +00:00
theraven
4d48d0bcaa Switch the order of the reference count and the zone so that the reference count (in reference counted mode) is always immediately in front of the object. Please test this!!
Opt NSObject into the fast path for ARC.  ARC will now not call the retain / release / autorelease methods on NSObject or any classes that inherit their implementation of these methods from NSObject.  In quick and dirty testing, this gives about a 10-20% speedup.  



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33446 72102866-910b-0410-8b05-ffd578937521
2011-07-04 11:31:28 +00:00
theraven
a064345ddd Don't call c++ constructors when allocating a class with class_createInstance() - this function calls them itself, and calling them twice is a bad idea.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33436 72102866-910b-0410-8b05-ffd578937521
2011-07-03 11:04:04 +00:00
theraven
72e4d13156 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
theraven
57aca2c837 Add support to NSObject for automatically zeroing __weak references when using ARC.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33408 72102866-910b-0410-8b05-ffd578937521
2011-06-29 13:13:15 +00:00
theraven
554a136f3c Small tweaks to NSGarbageCollector.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33402 72102866-910b-0410-8b05-ffd578937521
2011-06-29 11:46:45 +00:00
rfm
fa4f612062 move comment to be before the method it applies to
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33380 72102866-910b-0410-8b05-ffd578937521
2011-06-26 10:27:52 +00:00
wlux
1d5f115076 Fix implementation of NSString -getParagraphStart🔚contentsEnd:forRange:.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33379 72102866-910b-0410-8b05-ffd578937521
2011-06-26 10:03:10 +00:00
fredkiefer
f6bec228b9 Add a few 10.6 NSURL methods to NSBundle.
Based on patch by julian.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33367 72102866-910b-0410-8b05-ffd578937521
2011-06-22 23:01:01 +00:00
rfm
50b71cb1bc locking fix
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33356 72102866-910b-0410-8b05-ffd578937521
2011-06-20 07:47:47 +00:00
rfm
33843644e1 Add some flexibility
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33355 72102866-910b-0410-8b05-ffd578937521
2011-06-20 07:33:27 +00:00
rfm
53b5f5405c fix a couple of leak detection bugs
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33353 72102866-910b-0410-8b05-ffd578937521
2011-06-20 04:37:20 +00:00
rfm
e78ceb4c96 more leak cleanup stuff
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33349 72102866-910b-0410-8b05-ffd578937521
2011-06-19 13:34:17 +00:00
rfm
8b2ffba3d9 Start stuff for handling cleanup on process exit.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33344 72102866-910b-0410-8b05-ffd578937521
2011-06-19 09:26:03 +00:00
rfm
3d1656a7bd fix uninitialised variable
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33342 72102866-910b-0410-8b05-ffd578937521
2011-06-18 18:11:57 +00:00
rfm
59540e5b9f fix possibly uninitialised variable
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33341 72102866-910b-0410-8b05-ffd578937521
2011-06-18 17:47:37 +00:00
rfm
05f8f8f257 Patches by Sebastian Reitenbach
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33338 72102866-910b-0410-8b05-ffd578937521
2011-06-18 12:57:30 +00:00
rfm
72c9155ff3 10.6 sompatibility (some)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33337 72102866-910b-0410-8b05-ffd578937521
2011-06-18 07:09:28 +00:00
rfm
54a0546f98 Fix xml parse error
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33327 72102866-910b-0410-8b05-ffd578937521
2011-06-17 13:47:24 +00:00
rfm
074a57a018 Add some requests 10.6 methods ... untested.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33326 72102866-910b-0410-8b05-ffd578937521
2011-06-17 11:45:28 +00:00
fredkiefer
d00b0bd62c Make Avahi work with gcc 2.95.
Patch by Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33291 72102866-910b-0410-8b05-ffd578937521
2011-06-13 14:50:25 +00:00
fredkiefer
8fb735ef34 Add rest of Sebastian's patch.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33280 72102866-910b-0410-8b05-ffd578937521
2011-06-11 15:32:37 +00:00
fredkiefer
f527f7a973 * Source\NSCalendar.m: Protect the name id.
Patch by Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33276 72102866-910b-0410-8b05-ffd578937521
2011-06-11 10:44:38 +00:00
rfm
212534bfba Add configure option to control gdomap port
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33264 72102866-910b-0410-8b05-ffd578937521
2011-06-09 17:08:41 +00:00