mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
cope with output of large integers
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37117 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7607b307e2
commit
77415c00b5
1 changed files with 12 additions and 1 deletions
|
@ -891,7 +891,18 @@ writeObject(id obj, NSMutableString *output, NSInteger tabs)
|
|||
}
|
||||
else if ([obj isKindOfClass: NSNumberClass])
|
||||
{
|
||||
[output appendFormat: @"%g", [obj doubleValue]];
|
||||
const char *t = [obj objCType];
|
||||
|
||||
if (strchr("cCsSiIlLqQ", *t) != 0)
|
||||
{
|
||||
long long i = [(NSNumber*)obj longLongValue];
|
||||
|
||||
[output appendFormat: @"%lld", i];
|
||||
}
|
||||
else
|
||||
{
|
||||
[output appendFormat: @"%g", [(NSNumber*)obj doubleValue]];
|
||||
}
|
||||
}
|
||||
else if ([obj isKindOfClass: NSNullClass])
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue