diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2017-07-20 17:11:50 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2017-07-20 17:11:50 +0100 |
commit | 8568110702f1c4911b25e57914ac2e886357f802 (patch) | |
tree | 55eefe85c4f3f9cd529c61455109ed993e2d9c2f /target/ppc/monitor.c | |
parent | a235ea962d113b71244f457aef7a596929b9307b (diff) |
Use qemu_tolower() and qemu_toupper(), not tolower() and toupper()
On NetBSD, where tolower() and toupper() are implemented using an
array lookup, the compiler warns if you pass a plain 'char'
to these functions:
gdbstub.c:914:13: warning: array subscript has type 'char'
This reflects the fact that toupper() and tolower() give
undefined behaviour if they are passed a value that isn't
a valid 'unsigned char' or EOF.
We have qemu_tolower() and qemu_toupper() to avoid this problem;
use them.
(The use in scsi-generic.c does not trigger the warning because
it passes a uint8_t; we switch it anyway, for consistency.)
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target/ppc/monitor.c')
-rw-r--r-- | target/ppc/monitor.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/target/ppc/monitor.c b/target/ppc/monitor.c index b8f30e9eaf..14915119fc 100644 --- a/target/ppc/monitor.c +++ b/target/ppc/monitor.c @@ -115,14 +115,14 @@ int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval) CPUPPCState *env = &cpu->env; /* General purpose registers */ - if ((tolower(name[0]) == 'r') && + if ((qemu_tolower(name[0]) == 'r') && ppc_cpu_get_reg_num(name + 1, ARRAY_SIZE(env->gpr), ®num)) { *pval = env->gpr[regnum]; return 0; } /* Floating point registers */ - if ((tolower(name[0]) == 'f') && + if ((qemu_tolower(name[0]) == 'f') && ppc_cpu_get_reg_num(name + 1, ARRAY_SIZE(env->fpr), ®num)) { *pval = env->fpr[regnum]; return 0; |