translate-all: Avoid -Werror=switch-bool

gcc 5.3.0 diagnoses

translate-all.c: In function ‘alloc_code_gen_buffer’:
translate-all.c:756:17: error: switch condition has boolean value
switch (buf2 != MAP_FAILED) {
^

Backports commit f68808c7494b38764e1895a9852b994638b86536 from qemu
This commit is contained in:
Richard Henderson 2018-03-01 13:01:43 -05:00 committed by Lioncash
parent 4ed2a37f6d
commit efad2631d2
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -759,7 +759,7 @@ static inline void *alloc_code_gen_buffer(struct uc_struct *uc)
size_t size2;
void *buf2 = mmap(NULL, size + uc->qemu_real_host_page_size,
PROT_NONE, flags, -1, 0);
switch (buf2 != MAP_FAILED) {
switch ((int)(buf2 != MAP_FAILED)) {
case 1:
if (!cross_256mb(buf2, size)) {
/* Success! Use the new buffer. */