]> git.proxmox.com Git - mirror_qemu.git/commit
Use qemu_tolower() and qemu_toupper(), not tolower() and toupper()
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 20 Jul 2017 16:31:30 +0000 (17:31 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 21 Jul 2017 09:32:41 +0000 (10:32 +0100)
commit95a5befc2f8b359e72926f89cd661d063c2cf06c
tree6589dd6adba5d123145be8e25e29e1bd0a8e69aa
parent02ffa034fb747f09a4f5658ed64871dcee4aaca2
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>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> for the s390 part.
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Message-id: 1500568290-7966-1-git-send-email-peter.maydell@linaro.org
gdbstub.c
hw/s390x/s390-virtio-ccw.c
hw/scsi/scsi-generic.c
target/ppc/monitor.c