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
This commit is contained in:
Markus Armbruster 2018-03-02 08:39:44 -05:00 committed by Lioncash
parent ac34d92d09
commit 41c2e1168f
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
3 changed files with 7 additions and 7 deletions

View file

@ -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

View file

@ -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) {

View file

@ -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;