qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [patch] Shut up compiler warning.
Date: Tue, 3 Aug 2004 23:48:02 +0100	[thread overview]
Message-ID: <200408032348.02613.paul@codesourcery.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 324 bytes --]

The new bdrv_close callbacks are declared to return "int". However their 
return value is never set, and always ignored. GCC rightly warns about this.

Attached patch changes them to have a void return type.

Is mailing patches to this list the preferred way of submitting changes? If 
not what should I do with them?

Paul

[-- Attachment #2: patch.qemu_block_close --]
[-- Type: text/x-diff, Size: 2832 bytes --]

Index: block.c
===================================================================
RCS file: /cvsroot/qemu/qemu/block.c,v
retrieving revision 1.12
diff -u -p -r1.12 block.c
--- block.c	3 Aug 2004 21:14:09 -0000	1.12
+++ block.c	3 Aug 2004 22:40:23 -0000
@@ -554,7 +554,7 @@ static int raw_write(BlockDriverState *b
     return 0;
 }
 
-static int raw_close(BlockDriverState *bs)
+static void raw_close(BlockDriverState *bs)
 {
     BDRVRawState *s = bs->opaque;
     close(s->fd);
Index: block-cow.c
===================================================================
RCS file: /cvsroot/qemu/qemu/block-cow.c,v
retrieving revision 1.2
diff -u -p -r1.2 block-cow.c
--- block-cow.c	3 Aug 2004 21:13:54 -0000	1.2
+++ block-cow.c	3 Aug 2004 22:40:23 -0000
@@ -202,7 +202,7 @@ static int cow_write(BlockDriverState *b
     return 0;
 }
 
-static int cow_close(BlockDriverState *bs)
+static void cow_close(BlockDriverState *bs)
 {
     BDRVCowState *s = bs->opaque;
     munmap(s->cow_bitmap_addr, s->cow_bitmap_size);
Index: block_int.h
===================================================================
RCS file: /cvsroot/qemu/qemu/block_int.h,v
retrieving revision 1.1
diff -u -p -r1.1 block_int.h
--- block_int.h	1 Aug 2004 21:59:26 -0000	1.1
+++ block_int.h	3 Aug 2004 22:40:23 -0000
@@ -33,7 +33,7 @@ struct BlockDriver {
                      uint8_t *buf, int nb_sectors);
     int (*bdrv_write)(BlockDriverState *bs, int64_t sector_num, 
                       const uint8_t *buf, int nb_sectors);
-    int (*bdrv_close)(BlockDriverState *bs);
+    void (*bdrv_close)(BlockDriverState *bs);
     int (*bdrv_create)(const char *filename, int64_t total_sectors, 
                        const char *backing_file, int flags);
     int (*bdrv_is_allocated)(BlockDriverState *bs, int64_t sector_num,
Index: block-qcow.c
===================================================================
RCS file: /cvsroot/qemu/qemu/block-qcow.c,v
retrieving revision 1.2
diff -u -p -r1.2 block-qcow.c
--- block-qcow.c	3 Aug 2004 21:13:54 -0000	1.2
+++ block-qcow.c	3 Aug 2004 22:40:23 -0000
@@ -521,7 +521,7 @@ static int qcow_write(BlockDriverState *
     return 0;
 }
 
-static int qcow_close(BlockDriverState *bs)
+static void qcow_close(BlockDriverState *bs)
 {
     BDRVQcowState *s = bs->opaque;
     qemu_free(s->l1_table);
Index: block-vmdk.c
===================================================================
RCS file: /cvsroot/qemu/qemu/block-vmdk.c,v
retrieving revision 1.2
diff -u -p -r1.2 block-vmdk.c
--- block-vmdk.c	3 Aug 2004 21:13:54 -0000	1.2
+++ block-vmdk.c	3 Aug 2004 22:40:23 -0000
@@ -257,7 +257,7 @@ static int vmdk_write(BlockDriverState *
     return -1;
 }
 
-static int vmdk_close(BlockDriverState *bs)
+static void vmdk_close(BlockDriverState *bs)
 {
     BDRVVmdkState *s = bs->opaque;
     qemu_free(s->l1_table);

                 reply	other threads:[~2004-08-03 22:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200408032348.02613.paul@codesourcery.com \
    --to=paul@codesourcery.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).