diff --git a/src/nspawn/nspawn-oci.c b/src/nspawn/nspawn-oci.c index dfa5c833c5..826981c3f7 100644 --- a/src/nspawn/nspawn-oci.c +++ b/src/nspawn/nspawn-oci.c @@ -1424,7 +1424,7 @@ static int oci_cgroup_block_io_weight_device(const char *name, JsonVariant *v, J static const JsonDispatch table[] = { { "major", JSON_VARIANT_UNSIGNED, oci_device_major, offsetof(struct device_data, major), JSON_MANDATORY }, { "minor", JSON_VARIANT_UNSIGNED, oci_device_minor, offsetof(struct device_data, minor), JSON_MANDATORY }, - { "weight", JSON_VARIANT_UNSIGNED, json_dispatch_unsigned, offsetof(struct device_data, weight), 0 }, + { "weight", JSON_VARIANT_UNSIGNED, json_dispatch_uintmax, offsetof(struct device_data, weight), 0 }, { "leafWeight", JSON_VARIANT_INTEGER, oci_unsupported, 0, JSON_PERMISSIVE }, {} }; @@ -1484,7 +1484,7 @@ static int oci_cgroup_block_io_throttle(const char *name, JsonVariant *v, JsonDi static const JsonDispatch table[] = { { "major", JSON_VARIANT_UNSIGNED, oci_device_major, offsetof(struct device_data, major), JSON_MANDATORY }, { "minor", JSON_VARIANT_UNSIGNED, oci_device_minor, offsetof(struct device_data, minor), JSON_MANDATORY }, - { "rate", JSON_VARIANT_UNSIGNED, json_dispatch_unsigned, offsetof(struct device_data, rate), JSON_MANDATORY }, + { "rate", JSON_VARIANT_UNSIGNED, json_dispatch_uintmax, offsetof(struct device_data, rate), JSON_MANDATORY }, {} }; diff --git a/src/shared/json.c b/src/shared/json.c index cc79375410..d391eb01cc 100644 --- a/src/shared/json.c +++ b/src/shared/json.c @@ -4063,7 +4063,7 @@ int json_dispatch_tristate(const char *name, JsonVariant *variant, JsonDispatchF return 0; } -int json_dispatch_integer(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata) { +int json_dispatch_intmax(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata) { intmax_t *i = userdata; assert(variant); @@ -4076,7 +4076,7 @@ int json_dispatch_integer(const char *name, JsonVariant *variant, JsonDispatchFl return 0; } -int json_dispatch_unsigned(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata) { +int json_dispatch_uintmax(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata) { uintmax_t *u = userdata; assert(variant); diff --git a/src/shared/json.h b/src/shared/json.h index d429066761..d14740db88 100644 --- a/src/shared/json.h +++ b/src/shared/json.h @@ -293,8 +293,8 @@ int json_dispatch_strv(const char *name, JsonVariant *variant, JsonDispatchFlags int json_dispatch_boolean(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata); int json_dispatch_tristate(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata); int json_dispatch_variant(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata); -int json_dispatch_integer(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata); -int json_dispatch_unsigned(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata); +int json_dispatch_intmax(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata); +int json_dispatch_uintmax(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata); int json_dispatch_uint32(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata); int json_dispatch_int32(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata); int json_dispatch_uid_gid(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata); @@ -303,10 +303,10 @@ int json_dispatch_id128(const char *name, JsonVariant *variant, JsonDispatchFlag int json_dispatch_unsupported(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata); assert_cc(sizeof(uintmax_t) == sizeof(uint64_t)); -#define json_dispatch_uint64 json_dispatch_unsigned +#define json_dispatch_uint64 json_dispatch_uintmax assert_cc(sizeof(intmax_t) == sizeof(int64_t)); -#define json_dispatch_int64 json_dispatch_integer +#define json_dispatch_int64 json_dispatch_intmax assert_cc(sizeof(uint32_t) == sizeof(unsigned)); #define json_dispatch_uint json_dispatch_uint32