Major rework of 64 integer support: 64 bits integer are only returned when explicitly request via Json::Value::asInt64(), unlike previous implementation where Json::Value::asInt() returned a 64 bits integer.

This eases porting portable code and does not break compatibility with the previous release.

Json::Value::asLargestInt() has also be added to ease writing portable code independent of 64 bits integer support. It is typically used to implement writers.
This commit is contained in:
Baptiste Lepilleur
2010-12-27 17:45:23 +00:00
parent 5c5628aec2
commit 842e9ac54b
9 changed files with 266 additions and 89 deletions

View File

@@ -63,7 +63,7 @@ isControlCharacter(char ch)
enum {
/// Constant that specify the size of the buffer that must be passed to uintToString.
uintToStringBufferSize = 3*sizeof(UInt)+1
uintToStringBufferSize = 3*sizeof(LargestUInt)+1
};
// Defines a char buffer for use with uintToString().
@@ -76,7 +76,7 @@ typedef char UIntToStringBuffer[uintToStringBufferSize];
* Must have at least uintToStringBufferSize chars free.
*/
static inline void
uintToString( UInt value,
uintToString( LargestUInt value,
char *&current )
{
*--current = 0;