mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 09:02:01 +00:00
* Source/NSPropertyList.m (GSBinaryPLParser -objectAtIndex:):
Use long long for all integer types. Before we used signed types which resulted wrong values for negative integers. * Source/NSKeyedUnarchiver.m (-_decodeObject:): Handle the string "$null" as nil all the times. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33934 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
afc6974925
commit
41298e5ec4
3 changed files with 19 additions and 20 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2011-10-03 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* Source/NSPropertyList.m (GSBinaryPLParser -objectAtIndex:): Use
|
||||||
|
long long for all integer types. Before we used signed types which
|
||||||
|
resulted wrong values for negative integers.
|
||||||
|
* Source/NSKeyedUnarchiver.m (-_decodeObject:): Handle the string
|
||||||
|
"$null" as nil all the times.
|
||||||
|
|
||||||
2011-10-03 Richard Frith-Macdonald <rfm@gnu.org>
|
2011-10-03 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/NSHost.m: Update to use inet_pton() and inet_ntop() and to
|
* Source/NSHost.m: Update to use inet_pton() and inet_ntop() and to
|
||||||
|
|
|
@ -259,11 +259,12 @@ static NSMapTable *globalClassMap = 0;
|
||||||
GSIArraySetItemAtIndex(_objMap, (GSIArrayItem)obj, index);
|
GSIArraySetItemAtIndex(_objMap, (GSIArrayItem)obj, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj == nil)
|
if ((obj == nil) || [@"$null" isEqual: obj])
|
||||||
{
|
{
|
||||||
// Record NilMarker for decoded object.
|
// Record NilMarker for decoded object.
|
||||||
o = GSIArrayItemAtIndex(_objMap, 0).obj;
|
o = GSIArrayItemAtIndex(_objMap, 0).obj;
|
||||||
GSIArraySetItemAtIndex(_objMap, (GSIArrayItem)o, index);
|
GSIArraySetItemAtIndex(_objMap, (GSIArrayItem)o, index);
|
||||||
|
obj = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
|
@ -500,8 +501,8 @@ static NSMapTable *globalClassMap = 0;
|
||||||
if (i > INT_MAX || i < INT_MIN)
|
if (i > INT_MAX || i < INT_MIN)
|
||||||
{
|
{
|
||||||
[NSException raise: NSRangeException
|
[NSException raise: NSRangeException
|
||||||
format: @"[%@ +%@]: value for key(%@) is out of range",
|
format: @"[%@ +%@]: value %ld for key(%@) is out of range",
|
||||||
NSStringFromClass([self class]), NSStringFromSelector(_cmd), aKey];
|
NSStringFromClass([self class]), NSStringFromSelector(_cmd), i, aKey];
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return (int)i;
|
return (int)i;
|
||||||
|
|
|
@ -2998,28 +2998,18 @@ GSPropertyListMake(id obj, NSDictionary *loc, BOOL xml,
|
||||||
unsigned i;
|
unsigned i;
|
||||||
unsigned char buffer[16];
|
unsigned char buffer[16];
|
||||||
|
|
||||||
|
if (len > sizeof(unsigned long long))
|
||||||
|
{
|
||||||
|
[NSException raise: NSInvalidArgumentException
|
||||||
|
format: @"Stored number too long (%d bytes) in property list", len];
|
||||||
|
}
|
||||||
|
|
||||||
[data getBytes: buffer range: NSMakeRange(counter, len)];
|
[data getBytes: buffer range: NSMakeRange(counter, len)];
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
num = (num << 8) + buffer[i];
|
num = (num << 8) + buffer[i];
|
||||||
}
|
}
|
||||||
|
result = [NSNumber numberWithLongLong: (long long)num];
|
||||||
if (next == 0x10)
|
|
||||||
{
|
|
||||||
result = [NSNumber numberWithUnsignedChar: (unsigned char)num];
|
|
||||||
}
|
|
||||||
else if (next == 0x11)
|
|
||||||
{
|
|
||||||
result = [NSNumber numberWithUnsignedShort: (unsigned short)num];
|
|
||||||
}
|
|
||||||
else if ((next == 0x12) || (next == 13))
|
|
||||||
{
|
|
||||||
result = [NSNumber numberWithUnsignedInt: (unsigned int)num];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = [NSNumber numberWithUnsignedLongLong: num];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (next == 0x22)
|
else if (next == 0x22)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue