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

@ -1,7 +1,15 @@
2008-12-08 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSKeyedUnarchiver.m: ([versionForClassName:]) implement
* Source/NSUnarchiver.m:
* Source/NSCoder.m:
* Headers/Foundation/NSCoder.h:
Update method to return NSInteger.
2008-12-07 Adam Fedor <fedor@gnu.org>
* configure.ac: Add custom objc library check from gnustep-make (So we can find
libobjc in LOCAL domain).
* configure.ac: Add custom objc library check from gnustep-make
(So we can find libobjc in LOCAL domain).
2008-12-07 Richard Frith-Macdonald <rfm@gnu.org>

View file

@ -222,7 +222,7 @@ extern "C" {
* class (decoded). Version comes from [NSObject -getVersion].
*
*/
- (unsigned int) versionForClassName: (NSString*)className;
- (NSInteger) versionForClassName: (NSString*)className;
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
/*

View file

@ -65,10 +65,10 @@
return nil;
}
- (unsigned int) versionForClassName: (NSString*)className
- (NSInteger) versionForClassName: (NSString*)className
{
[self subclassResponsibility: _cmd];
return NSNotFound;
return (NSInteger)NSNotFound;
}
// Encoding Data
@ -293,8 +293,6 @@
- (unsigned int) systemVersion
{
//PENDING(ABR)- should probably mult major version by 1000, not 100, since,
// e.g., 2.0.0 is going to be <1000
return (((GNUSTEP_BASE_MAJOR_VERSION * 100)
+ GNUSTEP_BASE_MINOR_VERSION) * 100) + GNUSTEP_BASE_SUBMINOR_VERSION;
}

View file

@ -828,6 +828,10 @@ static NSMapTable globalClassMap = 0;
_delegate = delegate; // Not retained.
}
- (NSInteger) versionForClassName: (NSString*)className
{
return 0; // Not used for keyed unarchiving.
}
@end
@implementation NSObject (NSKeyedUnarchiverDelegate)

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;
}