From 4fc8d6711aff7a9c11e402c3d77b481609f9f486 Mon Sep 17 00:00:00 2001 From: Blue Swirl Date: Sat, 20 Feb 2010 08:29:17 +0000 Subject: [PATCH] Fix warning on mingw32 /src/qemu/hw/ide/core.c: In function 'ide_drive_pre_save': /src/qemu/hw/ide/core.c:2740: warning: comparison is always false due to limited range of data type Signed-off-by: Blue Swirl --- hw/ide/core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index 9d687a9d80..2e0971ddeb 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -2727,6 +2727,7 @@ static int ide_drive_post_load(void *opaque, int version_id) static void ide_drive_pre_save(void *opaque) { IDEState *s = opaque; + int idx; s->cur_io_buffer_len = 0; @@ -2736,11 +2737,13 @@ static void ide_drive_pre_save(void *opaque) s->cur_io_buffer_offset = s->data_ptr - s->io_buffer; s->cur_io_buffer_len = s->data_end - s->data_ptr; - s->end_transfer_fn_idx = transfer_end_table_idx(s->end_transfer_func); - if (s->end_transfer_fn_idx == -1) { + idx = transfer_end_table_idx(s->end_transfer_func); + if (idx == -1) { fprintf(stderr, "%s: invalid end_transfer_func for DRQ_STAT\n", __func__); s->end_transfer_fn_idx = 2; + } else { + s->end_transfer_fn_idx = idx; } }