[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 20/20] block: Avoid compiler warning for w64
From: |
Blue Swirl |
Subject: |
Re: [Qemu-devel] [PATCH 20/20] block: Avoid compiler warning for w64 |
Date: |
Sun, 15 Apr 2012 17:13:25 +0000 |
On Sun, Apr 15, 2012 at 14:13, Stefan Weil <address@hidden> wrote:
> The MinGW-w64 compiler complains about a non-void function
> which does not return a value.
>
> This is not true, but we can help the compiler to
> see that by rewriting the code.
>
> Signed-off-by: Stefan Weil <address@hidden>
> ---
> block/raw-win32.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/block/raw-win32.c b/block/raw-win32.c
> index e4b0b75..a420f73 100644
> --- a/block/raw-win32.c
> +++ b/block/raw-win32.c
> @@ -335,12 +335,10 @@ static int find_device_type(BlockDriverState *bs, const
> char *filename)
> return FTYPE_HARDDISK;
> case DRIVE_CDROM:
> return FTYPE_CD;
> - default:
> - return FTYPE_FILE;
If these DRIVE_ constants are enums (or later changed to such), a
compiler may complain about missing default case. I'd prefer then to
keep 'default:', but add 'break;' in place of the return. Would this
work in your case too?
> }
> - } else {
> - return FTYPE_FILE;
> }
> +
> + return FTYPE_FILE;
This and else change is fine.
> }
>
> static int hdev_probe_device(const char *filename)
> --
> 1.7.0.4
>
- [Qemu-devel] [PATCH 06/20] w32: Move defines for socket specific errors to qemu-os-win32.h, (continued)
- [Qemu-devel] [PATCH 06/20] w32: Move defines for socket specific errors to qemu-os-win32.h, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 09/20] w64: Fix struct CPUTLBEntry, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 13/20] w64: Fix type cast in os_host_main_loop_wait, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 11/20] w64: Use uintptr_t in exec.c, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 14/20] target-mips: Fix type cast for w64 (uintptr_t), Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 16/20] cpu-exec: Remove non-portable type cast and fix format string, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 19/20] w64: Fix time conversion for some versions of MinGW-w64, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 12/20] w64: Fix data types in softmmu*.h, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 20/20] block: Avoid compiler warning for w64, Stefan Weil, 2012/04/15
- Re: [Qemu-devel] [PATCH 20/20] block: Avoid compiler warning for w64,
Blue Swirl <=
- [Qemu-devel] [PATCH 18/20] nbd: Fix compiler warning (w64), Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 15/20] target-ppc: Fix type casts for w64 (uintptr_t), Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 17/20] disas: Replace 'unsigned long' by 'uintptr_t', Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 07/20] w64: Fix definition of setjmp, Stefan Weil, 2012/04/15