Commit Graph

15 Commits

Author SHA1 Message Date
Eric Haszlakiewicz
85c244f048 Eliminate unnecessary cast that was added to test_double_serializer. 2020-06-07 18:50:10 +00:00
Eric Haszlakiewicz
66d91fdf86 The split of json_object into type-specific sub-structures is now functionally complete.
Remove all of the temporary defines, structures, old compat fuctions, extra fields, etc... that were needed during the conversion to a split set of json_object_* structures.
2020-06-07 17:23:56 +00:00
Eric Haszlakiewicz
9ecb1222bd Kick json_type_int and json_type_double out of struct json_object.
Clean up the code in json_object_new_* a bit by dropping unnecesary json_object_base variables.
2020-05-26 02:31:35 +00:00
Björn Esser
dd040ba446 tests: Fix test_double_serializer without thread-local storage. 2020-05-18 12:27:00 +02:00
dota17
8b162c4b89 clang-format the files 2020-04-03 11:39:30 +08:00
chenguoping
424b315ce0 pointer types discards qualifiers 2019-12-27 15:39:31 +08:00
chenguoping
1446572997 add testcases of object and token 2019-12-27 15:07:00 +08:00
Eric Haszlakiewicz
25aedddcdf Fix memory leaks in test_double_serializer, and make sure all tests return 0 at the end of main(). 2019-11-23 12:05:28 -05:00
Eric Haszlakiewicz
b1ad748842 Extend test_double_serializer to check NaN and Infinity handling. 2019-11-22 22:56:33 -05:00
Eric Haszlakiewicz
68abf12afa Issue #498: Fix a memory leak bug introduced in test_double_serializer in 485f2a02 by adding a json_object_put call. 2019-07-26 03:35:38 +00:00
Pierce Lopez
634900d270 tests: appease -Wwrite-strings 2019-06-09 12:17:06 -04:00
Eric Haszlakiewicz
485f2a02c7 Issue #486: append a missing ".0" to negative double values too. 2019-05-28 02:44:22 +00:00
Eric Haszlakiewicz
d5da847f51 PR#394: don't always append the ".0" if the double value rounds to zero because some custom formats *will* include it (e.g. %.2f).
Also try to accomodate formats to explicitly exclude the decimal (e.g. %.0f).
2017-12-24 13:45:52 -05:00
Eric Haszlakiewicz
1a94c70336 Add a json_c_set_serialization_double_format() function to set the *library-wide* format for how doubles are written to a serialized JSON output. 2017-06-18 18:12:07 +00:00
Matthias Schiffer
c2b004ba0e Make default double serializer ignore userdata again
The user might want to use the userdata for something different, so the
serializer should ignore it by default.

Explicitly setting the serializer to json_object_double_to_json_string will
still make it interpret the userdata as a format string.
2016-05-29 11:24:55 +02:00