mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-02-15 17:09:31 -07:00
util/cutils: New qemu_strtosz()
Most callers of qemu_strtosz_suffix() pass QEMU_STRTOSZ_DEFSUFFIX_B. Capture the pattern in new qemu_strtosz(). Inline qemu_strtosz_suffix() into its only remaining caller. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1487708048-2131-17-git-send-email-armbru@redhat.com>
This commit is contained in:
parent
e591591b32
commit
466dea14e6
6 changed files with 30 additions and 41 deletions
|
|
@ -139,22 +139,7 @@ int parse_uint(const char *s, unsigned long long *value, char **endptr,
|
|||
int base);
|
||||
int parse_uint_full(const char *s, unsigned long long *value, int base);
|
||||
|
||||
/*
|
||||
* qemu_strtosz() suffixes used to specify the default treatment of an
|
||||
* argument passed to qemu_strtosz() without an explicit suffix.
|
||||
* These should be defined using upper case characters in the range
|
||||
* A-Z, as qemu_strtosz() will use qemu_toupper() on the given argument
|
||||
* prior to comparison.
|
||||
*/
|
||||
#define QEMU_STRTOSZ_DEFSUFFIX_EB 'E'
|
||||
#define QEMU_STRTOSZ_DEFSUFFIX_PB 'P'
|
||||
#define QEMU_STRTOSZ_DEFSUFFIX_TB 'T'
|
||||
#define QEMU_STRTOSZ_DEFSUFFIX_GB 'G'
|
||||
#define QEMU_STRTOSZ_DEFSUFFIX_MB 'M'
|
||||
#define QEMU_STRTOSZ_DEFSUFFIX_KB 'K'
|
||||
#define QEMU_STRTOSZ_DEFSUFFIX_B 'B'
|
||||
int64_t qemu_strtosz_suffix(const char *nptr, char **end,
|
||||
const char default_suffix);
|
||||
int64_t qemu_strtosz(const char *nptr, char **end);
|
||||
int64_t qemu_strtosz_MiB(const char *nptr, char **end);
|
||||
int64_t qemu_strtosz_metric(const char *nptr, char **end);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue