summaryrefslogtreecommitdiffstats
path: root/include/qemu
diff options
context:
space:
mode:
authorMarkus Armbruster2017-02-21 21:14:00 +0100
committerMarkus Armbruster2017-02-23 20:35:36 +0100
commit466dea14e677555dd24465aca75d00a3537ad062 (patch)
treee1df0ed42f3bbac5bafe441aaad90b3d8ced3a3f /include/qemu
parentutil/cutils: Rename qemu_strtosz() to qemu_strtosz_MiB() (diff)
downloadqemu-466dea14e677555dd24465aca75d00a3537ad062.tar.gz
qemu-466dea14e677555dd24465aca75d00a3537ad062.tar.xz
qemu-466dea14e677555dd24465aca75d00a3537ad062.zip
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>
Diffstat (limited to 'include/qemu')
-rw-r--r--include/qemu/cutils.h17
1 files changed, 1 insertions, 16 deletions
diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h
index a08b1b03af..3fdbb6b4c1 100644
--- a/include/qemu/cutils.h
+++ b/include/qemu/cutils.h
@@ -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);