diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-06-29 23:05:36 +0000 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-06-29 23:05:36 +0000 |
| commit | d849012d19f1743691a05f4c38f69e6af5110806 (patch) | |
| tree | eb794af0126e4f4003d9ee7b8c6f3b57459d1d32 /lib/json.c | |
| parent | efd934cab078c715c5f647c19cebd8f85463b753 (diff) | |
lib: always use 64-bit integers for json
json-c does not (yet) offer support for unsigned integer types, and
furthermore, the docs state that all integers are stored internally as
64-bit. So there's never a case in which we would want to limit,
implicitly or otherwise, the range of an integer when adding it to a
json object.
Among other things this fixes the display of ASN values greater than
(1/2) * (2^32 - 1)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/json.c')
| -rw-r--r-- | lib/json.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/json.c b/lib/json.c index 5b7c3e9ffa..d8c97e4486 100644 --- a/lib/json.c +++ b/lib/json.c @@ -48,13 +48,7 @@ json_object_string_add(struct json_object* obj, const char *key, } void -json_object_int_add(struct json_object* obj, const char *key, int32_t i) -{ - json_object_object_add(obj, key, json_object_new_int(i)); -} - -void -json_object_long_add(struct json_object* obj, const char *key, int64_t i) +json_object_int_add(struct json_object* obj, const char *key, int64_t i) { #if defined(HAVE_JSON_C_JSON_H) json_object_object_add(obj, key, json_object_new_int64(i)); |
