Notice that the cJSON use "int" type to represent the interger number, what will happen if the number is larger than 2^32?
Why cJSON doesn't use "long long" instead of "int"?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The "int" type is provided as a convenience. If you need larger numbers, the double will give you int-precise 48bit numbers.
JSON does not define how numbers should be specified as a datatype.
If you DID want to include 64bit ints, you could change the code to do this with reasonable ease; though it would mean adding a second codepath to the number parse/print routines.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Notice that the cJSON use "int" type to represent the interger number, what will happen if the number is larger than 2^32?
Why cJSON doesn't use "long long" instead of "int"?
The "int" type is provided as a convenience. If you need larger numbers, the double will give you int-precise 48bit numbers.
JSON does not define how numbers should be specified as a datatype.
If you DID want to include 64bit ints, you could change the code to do this with reasonable ease; though it would mean adding a second codepath to the number parse/print routines.