]> git.proxmox.com Git - mirror_qemu.git/commitdiff
translate-all: Avoid -Werror=switch-bool
authorRichard Henderson <rth@twiddle.net>
Sun, 8 Jan 2017 17:48:34 +0000 (09:48 -0800)
committerRichard Henderson <rth@twiddle.net>
Sun, 8 Jan 2017 17:48:34 +0000 (09:48 -0800)
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) {
                 ^

Signed-off-by: Richard Henderson <rth@twiddle.net>
translate-all.c

index 3dd9214904d201f726317bad9357b35c3bd104d2..20262938bb707388d5e8f9b6a6b87376fa8cc4fc 100644 (file)
@@ -753,7 +753,7 @@ static inline void *alloc_code_gen_buffer(void)
         size_t size2;
         void *buf2 = mmap(NULL, size + 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.  */