From 718ca77232c8f6e5e368aca552c26996966b86ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 17 Nov 2021 23:24:49 +0100 Subject: shared/json: use int64_t instead of intmax_t We were already asserting that the intmax_t and uintmax_t types are the same as int64_t and uint64_t. Pretty much everywhere in the code base we use the latter types. In principle intmax_t could be something different on some new architecture, and then the code would fail to compile or behave differently. We actually do not want the code to behave differently on those architectures, because that'd break interoperability. So let's just use int64_t/uint64_t since that's what we indend to use. --- src/nss-resolve/nss-resolve.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/nss-resolve') diff --git a/src/nss-resolve/nss-resolve.c b/src/nss-resolve/nss-resolve.c index e2a29475a2..d77ffdd9f2 100644 --- a/src/nss-resolve/nss-resolve.c +++ b/src/nss-resolve/nss-resolve.c @@ -82,7 +82,7 @@ static uint32_t ifindex_to_scopeid(int family, const void *a, int ifindex) { static int json_dispatch_ifindex(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata) { int *ifi = userdata; - intmax_t t; + int64_t t; assert(variant); assert(ifi); @@ -100,7 +100,7 @@ static int json_dispatch_ifindex(const char *name, JsonVariant *variant, JsonDis static int json_dispatch_family(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata) { int *family = userdata; - intmax_t t; + int64_t t; assert(variant); assert(family); @@ -160,7 +160,7 @@ static int json_dispatch_address(const char *name, JsonVariant *variant, JsonDis return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "JSON field '%s' is array of unexpected size.", strna(name)); JSON_VARIANT_ARRAY_FOREACH(i, variant) { - intmax_t b; + int64_t b; if (!json_variant_is_integer(i)) return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "Element %zu of JSON field '%s' is not an integer.", k, strna(name)); -- cgit v1.2.1