diff --git a/qemu/aarch64.h b/qemu/aarch64.h index a7473ab2..669a4f99 100644 --- a/qemu/aarch64.h +++ b/qemu/aarch64.h @@ -2651,8 +2651,6 @@ #define strongarm_cp_reginfo strongarm_cp_reginfo_aarch64 #define strpadcpy strpadcpy_aarch64 #define strstart strstart_aarch64 -#define strtosz strtosz_aarch64 -#define strtosz_suffix strtosz_suffix_aarch64 #define stw_be_p stw_be_p_aarch64 #define stw_be_phys stw_be_phys_aarch64 #define stw_he_p stw_he_p_aarch64 diff --git a/qemu/aarch64eb.h b/qemu/aarch64eb.h index e1ba8e03..8401886d 100644 --- a/qemu/aarch64eb.h +++ b/qemu/aarch64eb.h @@ -2651,8 +2651,6 @@ #define strongarm_cp_reginfo strongarm_cp_reginfo_aarch64eb #define strpadcpy strpadcpy_aarch64eb #define strstart strstart_aarch64eb -#define strtosz strtosz_aarch64eb -#define strtosz_suffix strtosz_suffix_aarch64eb #define stw_be_p stw_be_p_aarch64eb #define stw_be_phys stw_be_phys_aarch64eb #define stw_he_p stw_he_p_aarch64eb diff --git a/qemu/arm.h b/qemu/arm.h index e34f8f1e..8719df6d 100644 --- a/qemu/arm.h +++ b/qemu/arm.h @@ -2651,8 +2651,6 @@ #define strongarm_cp_reginfo strongarm_cp_reginfo_arm #define strpadcpy strpadcpy_arm #define strstart strstart_arm -#define strtosz strtosz_arm -#define strtosz_suffix strtosz_suffix_arm #define stw_be_p stw_be_p_arm #define stw_be_phys stw_be_phys_arm #define stw_he_p stw_he_p_arm diff --git a/qemu/armeb.h b/qemu/armeb.h index b782cd05..4b521380 100644 --- a/qemu/armeb.h +++ b/qemu/armeb.h @@ -2651,8 +2651,6 @@ #define strongarm_cp_reginfo strongarm_cp_reginfo_armeb #define strpadcpy strpadcpy_armeb #define strstart strstart_armeb -#define strtosz strtosz_armeb -#define strtosz_suffix strtosz_suffix_armeb #define stw_be_p stw_be_p_armeb #define stw_be_phys stw_be_phys_armeb #define stw_he_p stw_he_p_armeb diff --git a/qemu/header_gen.py b/qemu/header_gen.py index 13084889..21d09162 100644 --- a/qemu/header_gen.py +++ b/qemu/header_gen.py @@ -2657,8 +2657,6 @@ symbols = ( 'strongarm_cp_reginfo', 'strpadcpy', 'strstart', - 'strtosz', - 'strtosz_suffix', 'stw_be_p', 'stw_be_phys', 'stw_he_p', diff --git a/qemu/include/qemu-common.h b/qemu/include/qemu-common.h index 713a59e3..f2b4adcc 100644 --- a/qemu/include/qemu-common.h +++ b/qemu/include/qemu-common.h @@ -156,23 +156,24 @@ int qemu_strtol(const char *nptr, const char **endptr, int base, /* - * strtosz() suffixes used to specify the default treatment of an - * argument passed to strtosz() without an explicit suffix. + * 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 strtosz() will use qemu_toupper() on the given argument + * A-Z, as qemu_strtosz() will use qemu_toupper() on the given argument * prior to comparison. */ -#define STRTOSZ_DEFSUFFIX_EB 'E' -#define STRTOSZ_DEFSUFFIX_PB 'P' -#define STRTOSZ_DEFSUFFIX_TB 'T' -#define STRTOSZ_DEFSUFFIX_GB 'G' -#define STRTOSZ_DEFSUFFIX_MB 'M' -#define STRTOSZ_DEFSUFFIX_KB 'K' -#define STRTOSZ_DEFSUFFIX_B 'B' -int64_t strtosz(const char *nptr, char **end); -int64_t strtosz_suffix(const char *nptr, char **end, const char default_suffix); -int64_t strtosz_suffix_unit(const char *nptr, char **end, - const char default_suffix, int64_t unit); +#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(const char *nptr, char **end); +int64_t qemu_strtosz_suffix(const char *nptr, char **end, + const char default_suffix); +int64_t qemu_strtosz_suffix_unit(const char *nptr, char **end, + const char default_suffix, int64_t unit); /* used to print char* safely */ #define STR_OR_NULL(str) ((str) ? (str) : "null") diff --git a/qemu/m68k.h b/qemu/m68k.h index dee000c3..fcc2fe53 100644 --- a/qemu/m68k.h +++ b/qemu/m68k.h @@ -2651,8 +2651,6 @@ #define strongarm_cp_reginfo strongarm_cp_reginfo_m68k #define strpadcpy strpadcpy_m68k #define strstart strstart_m68k -#define strtosz strtosz_m68k -#define strtosz_suffix strtosz_suffix_m68k #define stw_be_p stw_be_p_m68k #define stw_be_phys stw_be_phys_m68k #define stw_he_p stw_he_p_m68k diff --git a/qemu/mips.h b/qemu/mips.h index 97f66c7c..34d6d4fb 100644 --- a/qemu/mips.h +++ b/qemu/mips.h @@ -2651,8 +2651,6 @@ #define strongarm_cp_reginfo strongarm_cp_reginfo_mips #define strpadcpy strpadcpy_mips #define strstart strstart_mips -#define strtosz strtosz_mips -#define strtosz_suffix strtosz_suffix_mips #define stw_be_p stw_be_p_mips #define stw_be_phys stw_be_phys_mips #define stw_he_p stw_he_p_mips diff --git a/qemu/mips64.h b/qemu/mips64.h index 53a7988a..7c0be780 100644 --- a/qemu/mips64.h +++ b/qemu/mips64.h @@ -2651,8 +2651,6 @@ #define strongarm_cp_reginfo strongarm_cp_reginfo_mips64 #define strpadcpy strpadcpy_mips64 #define strstart strstart_mips64 -#define strtosz strtosz_mips64 -#define strtosz_suffix strtosz_suffix_mips64 #define stw_be_p stw_be_p_mips64 #define stw_be_phys stw_be_phys_mips64 #define stw_he_p stw_he_p_mips64 diff --git a/qemu/mips64el.h b/qemu/mips64el.h index 833b20f7..0c945e5f 100644 --- a/qemu/mips64el.h +++ b/qemu/mips64el.h @@ -2651,8 +2651,6 @@ #define strongarm_cp_reginfo strongarm_cp_reginfo_mips64el #define strpadcpy strpadcpy_mips64el #define strstart strstart_mips64el -#define strtosz strtosz_mips64el -#define strtosz_suffix strtosz_suffix_mips64el #define stw_be_p stw_be_p_mips64el #define stw_be_phys stw_be_phys_mips64el #define stw_he_p stw_he_p_mips64el diff --git a/qemu/mipsel.h b/qemu/mipsel.h index 8530c6a2..b94a0cf7 100644 --- a/qemu/mipsel.h +++ b/qemu/mipsel.h @@ -2651,8 +2651,6 @@ #define strongarm_cp_reginfo strongarm_cp_reginfo_mipsel #define strpadcpy strpadcpy_mipsel #define strstart strstart_mipsel -#define strtosz strtosz_mipsel -#define strtosz_suffix strtosz_suffix_mipsel #define stw_be_p stw_be_p_mipsel #define stw_be_phys stw_be_phys_mipsel #define stw_he_p stw_he_p_mipsel diff --git a/qemu/powerpc.h b/qemu/powerpc.h index 95c0ec1e..ceb4c85d 100644 --- a/qemu/powerpc.h +++ b/qemu/powerpc.h @@ -2651,8 +2651,6 @@ #define strongarm_cp_reginfo strongarm_cp_reginfo_powerpc #define strpadcpy strpadcpy_powerpc #define strstart strstart_powerpc -#define strtosz strtosz_powerpc -#define strtosz_suffix strtosz_suffix_powerpc #define stw_be_p stw_be_p_powerpc #define stw_be_phys stw_be_phys_powerpc #define stw_he_p stw_he_p_powerpc diff --git a/qemu/sparc.h b/qemu/sparc.h index fa8afddc..09f6d45f 100644 --- a/qemu/sparc.h +++ b/qemu/sparc.h @@ -2651,8 +2651,6 @@ #define strongarm_cp_reginfo strongarm_cp_reginfo_sparc #define strpadcpy strpadcpy_sparc #define strstart strstart_sparc -#define strtosz strtosz_sparc -#define strtosz_suffix strtosz_suffix_sparc #define stw_be_p stw_be_p_sparc #define stw_be_phys stw_be_phys_sparc #define stw_he_p stw_he_p_sparc diff --git a/qemu/sparc64.h b/qemu/sparc64.h index a4027b88..79289573 100644 --- a/qemu/sparc64.h +++ b/qemu/sparc64.h @@ -2651,8 +2651,6 @@ #define strongarm_cp_reginfo strongarm_cp_reginfo_sparc64 #define strpadcpy strpadcpy_sparc64 #define strstart strstart_sparc64 -#define strtosz strtosz_sparc64 -#define strtosz_suffix strtosz_suffix_sparc64 #define stw_be_p stw_be_p_sparc64 #define stw_be_phys stw_be_phys_sparc64 #define stw_he_p stw_he_p_sparc64 diff --git a/qemu/target-i386/cpu.c b/qemu/target-i386/cpu.c index e1aaac82..2716d36a 100644 --- a/qemu/target-i386/cpu.c +++ b/qemu/target-i386/cpu.c @@ -1965,8 +1965,8 @@ static void x86_cpu_parse_featurestr(CPUState *cs, char *features, char *err; char num[32]; - tsc_freq = strtosz_suffix_unit(val, &err, - STRTOSZ_DEFSUFFIX_B, 1000); + tsc_freq = qemu_strtosz_suffix_unit(val, &err, + QEMU_STRTOSZ_DEFSUFFIX_B, 1000); if (tsc_freq < 0 || *err) { error_setg(errp, "bad numerical value %s", val); return; diff --git a/qemu/util/cutils.c b/qemu/util/cutils.c index 81683def..cca74520 100644 --- a/qemu/util/cutils.c +++ b/qemu/util/cutils.c @@ -129,19 +129,19 @@ char *qemu_strsep(char **input, const char *delim) static int64_t suffix_mul(char suffix, int64_t unit) { switch (qemu_toupper(suffix)) { - case STRTOSZ_DEFSUFFIX_B: + case QEMU_STRTOSZ_DEFSUFFIX_B: return 1; - case STRTOSZ_DEFSUFFIX_KB: + case QEMU_STRTOSZ_DEFSUFFIX_KB: return unit; - case STRTOSZ_DEFSUFFIX_MB: + case QEMU_STRTOSZ_DEFSUFFIX_MB: return unit * unit; - case STRTOSZ_DEFSUFFIX_GB: + case QEMU_STRTOSZ_DEFSUFFIX_GB: return unit * unit * unit; - case STRTOSZ_DEFSUFFIX_TB: + case QEMU_STRTOSZ_DEFSUFFIX_TB: return unit * unit * unit * unit; - case STRTOSZ_DEFSUFFIX_PB: + case QEMU_STRTOSZ_DEFSUFFIX_PB: return unit * unit * unit * unit * unit; - case STRTOSZ_DEFSUFFIX_EB: + case QEMU_STRTOSZ_DEFSUFFIX_EB: return unit * unit * unit * unit * unit * unit; } return -1; @@ -153,8 +153,8 @@ static int64_t suffix_mul(char suffix, int64_t unit) * in *end, if not NULL. Return -ERANGE on overflow, Return -EINVAL on * other error. */ -int64_t strtosz_suffix_unit(const char *nptr, char **end, - const char default_suffix, int64_t unit) +int64_t qemu_strtosz_suffix_unit(const char *nptr, char **end, + const char default_suffix, int64_t unit) { int64_t retval = -EINVAL; char *endptr; @@ -196,12 +196,13 @@ fail: return retval; } -int64_t strtosz_suffix(const char *nptr, char **end, const char default_suffix) +int64_t qemu_strtosz_suffix(const char *nptr, char **end, + const char default_suffix) { - return strtosz_suffix_unit(nptr, end, default_suffix, 1024); + return qemu_strtosz_suffix_unit(nptr, end, default_suffix, 1024); } -int64_t strtosz(const char *nptr, char **end) +int64_t qemu_strtosz(const char *nptr, char **end) { - return strtosz_suffix(nptr, end, STRTOSZ_DEFSUFFIX_MB); + return qemu_strtosz_suffix(nptr, end, QEMU_STRTOSZ_DEFSUFFIX_MB); } diff --git a/qemu/x86_64.h b/qemu/x86_64.h index faf59772..60bd5af3 100644 --- a/qemu/x86_64.h +++ b/qemu/x86_64.h @@ -2651,8 +2651,6 @@ #define strongarm_cp_reginfo strongarm_cp_reginfo_x86_64 #define strpadcpy strpadcpy_x86_64 #define strstart strstart_x86_64 -#define strtosz strtosz_x86_64 -#define strtosz_suffix strtosz_suffix_x86_64 #define stw_be_p stw_be_p_x86_64 #define stw_be_phys stw_be_phys_x86_64 #define stw_he_p stw_he_p_x86_64