From 41c2e1168fb0c8fafaab528926690c020866cf18 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 2 Mar 2018 08:39:44 -0500 Subject: [PATCH] util/cutils: Rename qemu_strtoll(), qemu_strtoull() The name qemu_strtoll() suggests conversion to long long, but it actually converts to int64_t. Rename to qemu_strtoi64(). The name qemu_strtoull() suggests conversion to unsigned long long, but it actually converts to uint64_t. Rename to qemu_strtou64(). Backports commit b30d188677456b17c1cd68969e08ddc634cef644 from qemu --- qemu/include/qemu/cutils.h | 6 +++--- qemu/qobject/qdict.c | 2 +- qemu/util/cutils.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/qemu/include/qemu/cutils.h b/qemu/include/qemu/cutils.h index 12856a48..d55afd18 100644 --- a/qemu/include/qemu/cutils.h +++ b/qemu/include/qemu/cutils.h @@ -126,9 +126,9 @@ int qemu_strtol(const char *nptr, const char **endptr, int base, long *result); int qemu_strtoul(const char *nptr, const char **endptr, int base, unsigned long *result); -int qemu_strtoll(const char *nptr, const char **endptr, int base, - int64_t *result); -int qemu_strtoull(const char *nptr, const char **endptr, int base, +int qemu_strtoi64(const char *nptr, const char **endptr, int base, + int64_t *result); +int qemu_strtou64(const char *nptr, const char **endptr, int base, uint64_t *result); /* * qemu_strtosz() suffixes used to specify the default treatment of an diff --git a/qemu/qobject/qdict.c b/qemu/qobject/qdict.c index 8fd7d523..aa18965d 100644 --- a/qemu/qobject/qdict.c +++ b/qemu/qobject/qdict.c @@ -705,7 +705,7 @@ static int qdict_is_list(QDict *maybe_list, Error **errp) for (ent = qdict_first(maybe_list); ent != NULL; ent = qdict_next(maybe_list, ent)) { - if (qemu_strtoll(ent->key, NULL, 10, &val) == 0) { + if (qemu_strtoi64(ent->key, NULL, 10, &val) == 0) { if (is_list == -1) { is_list = 1; } else if (!is_list) { diff --git a/qemu/util/cutils.c b/qemu/util/cutils.c index 05fe3769..94519d43 100644 --- a/qemu/util/cutils.c +++ b/qemu/util/cutils.c @@ -321,8 +321,8 @@ int qemu_strtoul(const char *nptr, const char **endptr, int base, * Works like qemu_strtol(), except it stores INT64_MAX on overflow, * and INT_MIN on underflow. */ -int qemu_strtoll(const char *nptr, const char **endptr, int base, - int64_t *result) +int qemu_strtoi64(const char *nptr, const char **endptr, int base, + int64_t *result) { char *p; int err = 0; @@ -345,7 +345,7 @@ int qemu_strtoll(const char *nptr, const char **endptr, int base, * * Works like qemu_strtoul(), except it stores UINT64_MAX on overflow. */ -int qemu_strtoull(const char *nptr, const char **endptr, int base, +int qemu_strtou64(const char *nptr, const char **endptr, int base, uint64_t *result) { char *p;