Update and fix for bug #25004

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27257 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2008-12-08 09:08:05 +00:00
parent 219c8760e9
commit 141bc74c1f
5 changed files with 28 additions and 18 deletions

View file

@ -283,7 +283,7 @@ static NSMutableDictionary *clsDict; /* Class information */
@interface NSUnarchiverObjectInfo : NSUnarchiverClassInfo
{
@public
unsigned version;
NSInteger version;
NSUnarchiverClassInfo *overrides;
}
@end
@ -747,17 +747,17 @@ static Class NSDataMallocClass;
classInfo = [objDict objectForKey: className];
if (classInfo == nil)
{
classInfo = [NSUnarchiverObjectInfo
newWithName: className];
classInfo = [NSUnarchiverObjectInfo newWithName: className];
c = NSClassFromString(className);
/*
* Show a warning, if the class name that's being used to build the
* class causes NSClassFromString to return nil. This means that the
* class is unknown to the runtime.
* Show a warning, if the class name that's being used to
* build the class causes NSClassFromString to return nil.
* This means that the class is unknown to the runtime.
*/
if(c == nil)
if (c == nil)
{
NSLog(@"Got nil when trying to unarchive class %s",className);
NSLog(@"Got nil when trying to unarchive class %s",
className);
}
[classInfo mapToClass: c withName: className];
[objDict setObject: classInfo forKey: className];
@ -768,7 +768,7 @@ static Class NSDataMallocClass;
c = classInfo->class;
}
RELEASE(className);
classInfo->version = cver;
classInfo->version = (NSInteger)cver;
GSIArrayAddItem(clsMap, (GSIArrayItem)((id)classInfo));
*(Class*)address = mapClassObject(classInfo);
/*
@ -1300,14 +1300,14 @@ static Class NSDataMallocClass;
format: @"object to be replaced does not exist"];
}
- (unsigned) versionForClassName: (NSString*)className
- (NSInteger) versionForClassName: (NSString*)className
{
NSUnarchiverObjectInfo *info;
info = [objDict objectForKey: className];
if (info == nil)
{
return NSNotFound;
return (NSInteger)NSNotFound;
}
return info->version;
}