mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
make subclassing easier
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29907 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b5dbc1afc5
commit
3d40713794
2 changed files with 16 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2010-03-12 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSKeyedArchiver.m:
|
||||||
|
Create _+clsMap lazily so it's there for subclasses even if the
|
||||||
|
initialiser was not called.
|
||||||
|
|
||||||
2010-03-11 12:14-EST Gregory John Casamento <greg.casamento@gmail.com>
|
2010-03-11 12:14-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||||
|
|
||||||
* Source/GNUmakefile: Remove reference to synchonization.m.
|
* Source/GNUmakefile: Remove reference to synchonization.m.
|
||||||
|
|
|
@ -345,7 +345,7 @@ static NSMapTable *globalClassMap = 0;
|
||||||
|
|
||||||
- (Class) classForClassName: (NSString*)aString
|
- (Class) classForClassName: (NSString*)aString
|
||||||
{
|
{
|
||||||
return (Class)NSMapGet(_clsMap, (void*)aString);
|
return _clsMap == 0 ? Nil : (Class)NSMapGet(_clsMap, (void*)aString);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) containsValueForKey: (NSString*)aKey
|
- (BOOL) containsValueForKey: (NSString*)aKey
|
||||||
|
@ -806,8 +806,6 @@ static NSMapTable *globalClassMap = 0;
|
||||||
_objects = [_archive objectForKey: @"$objects"];
|
_objects = [_archive objectForKey: @"$objects"];
|
||||||
_keyMap = [_archive objectForKey: @"$top"];
|
_keyMap = [_archive objectForKey: @"$top"];
|
||||||
|
|
||||||
_clsMap = NSCreateMapTable(NSObjectMapKeyCallBacks,
|
|
||||||
NSNonOwnedPointerMapValueCallBacks, 0);
|
|
||||||
#if GS_WITH_GC
|
#if GS_WITH_GC
|
||||||
_objMap = NSAllocateCollectable(sizeof(GSIArray_t), NSScannedOption);
|
_objMap = NSAllocateCollectable(sizeof(GSIArray_t), NSScannedOption);
|
||||||
#else
|
#else
|
||||||
|
@ -831,10 +829,18 @@ static NSMapTable *globalClassMap = 0;
|
||||||
{
|
{
|
||||||
if (aString == nil)
|
if (aString == nil)
|
||||||
{
|
{
|
||||||
NSMapRemove(_clsMap, (void*)aString);
|
if (_clsMap != 0)
|
||||||
|
{
|
||||||
|
NSMapRemove(_clsMap, (void*)aString);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (_clsMap == 0)
|
||||||
|
{
|
||||||
|
_clsMap = NSCreateMapTable(NSObjectMapKeyCallBacks,
|
||||||
|
NSNonOwnedPointerMapValueCallBacks, 0);
|
||||||
|
}
|
||||||
NSMapInsert(_clsMap, (void*)aString, (void*)aClass);
|
NSMapInsert(_clsMap, (void*)aString, (void*)aClass);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue