New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add uint64 data to json-c #542
Conversation
Your changes look decent, but defining a whole new
Which would allow things like json_object_get_type() to continue to return json_type_int, while also providing a easier way forward for future updates to expand the available magnitude beyond 64-bits (perhaps even arbitrary precision integers). |
ok, I know your meanings. It's really a good solution, I will try to change it. |
Thanks. I expect this will have the side-effect of making all places where we currently refer to c_int64 a bit more involved, but I'm hoping that ends up not being too bad. If you're going to try this then I guess we'll see. :) |
All this is a digression, could you open the coveralls right for json-c, ha-ha. It is a interesting tool. |
563641d
to
6dcf87a
Compare
…t64, uint64},...}
6dcf87a
to
c816de2
Compare
b166b06
to
af3e38e
Compare
…conversion for int64/uint64
af3e38e
to
9532f94
Compare
03040a9
to
c192df7
Compare
c192df7
to
6359b79
Compare
I think this could still use a couple more tweaks (i.e. improved assert calls, a bit of simplification in object_equal), but it's good enough to merge. I'll make those other changes later today. |
ok, thx. |
Done (commit b3296e7) |
introduced in json-c#542 fixes json-c#601
introduced in json-c#542 fixes json-c#601
Can't you just input an int64 then cast it as unsigned when you read it? |
Input where, in your json input? That means you'd have things like:
when you really mean:
Which would be quite confusing, not to mention not at all interoperable with any other json implementation that might support numbers that large. |
Sure, but you might need to support version 0.12 not 0.15
Andrew
…On Tue, Mar 23, 2021 at 1:33 PM Eric Hawicz ***@***.***> wrote:
Input where, in your json input? That means you'd have things like:
{ "foo": -9223372036854775808,
"bar": -1 }
when you really mean:
{ "foo": 9223372036854775808,
"bar": 18446744073709551615 }
Which would be quite confusing, not to mention not at all interoperable
with any other json implementation that might support numbers that large.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#542 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVCSLTSNRL6QDE7VZXQCTTFDNJDANCNFSM4K3AJNNA>
.
|
Many people want to add uint64 data into json-c in #520, #326, #143. I believe it is necessary and useful, so I make it in this commit. Review please.
Added content:
uint64_t c_uint64
data type and other related parameters, such asjson_type_uint
.json_object_uint_to_json_string()
json_object_new_uint64
json_object_get_uint64()
json_object_set_uint64()
json_object_uint_inc()
json_parse_uint64()
json_object_set_serializer()
,json_object_get_boolean()
json_object_get_int()
json_object_get_int64()
json_object_get_double()
json_object_equal()
json_c_shallow_copy_default()
json_tokener_parse_ex()
function:test_cast.c
,test_compare.c
,test_int_add.c
,test_parse.c
,test_parse_int64.c
,test_set_value.c
.As you can see, I have modified many files and achived adding-uint64. Welcome your comments and suggestions