mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +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
c6eab15afe
commit
ae4347ee40
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…
Add table
Add a link
Reference in a new issue