fixup for signedness ... charValue always returns a signed char

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32777 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2011-04-04 16:35:20 +00:00
parent d9d0d1b6fd
commit ee798647d7
2 changed files with 3 additions and 3 deletions

View file

@ -491,7 +491,7 @@ if (aValue >= -1 && aValue <= 12)\
if (self != NSNumberClass)
{
return [[[self alloc] initWithBytes: (const void *)&aValue
objCType: @encode(char)] autorelease];
objCType: @encode(signed char)] autorelease];
}
return [self numberWithInt: aValue];
}
@ -679,7 +679,7 @@ if (aValue >= -1 && aValue <= 12)\
switch (type[0])
{
case 'c':
return [self initWithInteger: *(char *) value];
return [self initWithInteger: *(signed char *) value];
case 'C':
return [self initWithInteger: *(unsigned char *) value];
case 's':

View file

@ -107,7 +107,7 @@ int main()
"NSDecimalNumber doubleValue works")
PASS(YES == [val1 boolValue],
"NSDecimalNumber boolValue works")
PASS((char)200 == [val1 charValue],
PASS((signed char)200 == [val1 charValue],
"NSDecimalNumber charValue works")
PASS(200 == [val1 intValue],
"NSDecimalNumber intValue works")