bugs from gcc warning fixes v3
cover bugs from gcc warning fixes v3
From: Jes Sorensen <[email protected]>
Hi,
Given the contention of the previous patch set, this is a stripped down version that doesn't have any of the parts included that got people up in arms. Lets at least start out getting the real bugs fixed and we can look at the other issues in parallel.
Cheers,
Jes
Jes Sorensen (6):
Remove unused argument for nbd_client()
Respect return value from nbd_client()
Fix repeated typo: was "end if list" instead of "end of list" size_t is unsigned, change to ssize_t to handle errors from
tight_compress_data()
Change DPRINTF() to do{}while(0) to avoid compiler warning load_multiboot(): get_image_size() returns int
hw/multiboot.c | 2 +- nbd.c | 4 ++-- nbd.h | 2 +- qemu-config.c | 12 ++++++------ qemu-nbd.c | 5 ++++- slirp/bootp.c | 2 +- ui/vnc-enc-tight.c | 8 ++++---- 7 files changed, 19 insertions(+), 16 deletions(-)
Signature · 1 line
1.7.2.2
PATCH 1/6 Remove unused argument for nbd_client()
From: Jes Sorensen <[email protected]>
--- nbd.c | 4 ++-- nbd.h | 2 +- qemu-nbd.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
nbd.c +2 -2
@@ -393,7 +393,7 @@ int nbd_disconnect(int fd)return 0 ; } -int nbd_client (int fd,int csock) +int nbd_client (int fd) {int ret;int serrno;
@@ -427,7 +427,7 @@ int nbd_disconnect(int fd)return -1 ; } -int nbd_client (int fd,int csock) +int nbd_client (int fd) { errno =ENOTSUP ;return -1 ;
nbd.h +1 -1
@@ -55,7 +55,7 @@ int nbd_send_request(int csock, struct nbd_request *request);int nbd_receive_reply (int csock,struct nbd_reply *reply);int nbd_trip (BlockDriverState *bs,int csock,off_t size,uint64_t dev_offset,off_t *offset,bool readonly,uint8_t *data,int data_size); -int nbd_client (int fd,int csock); +int nbd_client (int fd);int nbd_disconnect (int fd);#endif
qemu-nbd.c +1 -1
@@ -417,7 +417,7 @@ int main(int argc, char **argv)show_parts (device); -nbd_client (fd, sock); +nbd_client (fd);close (fd); out:kill (pid,SIGTERM );
Signature · 1 line
1.7.2.2
PATCH 2/6 Respect return value from nbd_client()
In reply to [email protected]From: Jes Sorensen <[email protected]>
--- qemu-nbd.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
qemu-nbd.c +4 -1
@@ -417,7 +417,10 @@ int main(int argc, char **argv)show_parts (device); -nbd_client (fd); + ret =nbd_client (fd); +if (ret) { + ret =1 ; + }close (fd); out:kill (pid,SIGTERM );
Signature · 1 line
1.7.2.2
PATCH 3/6 Fix repeated typo: was "end if list" instead of "end of list"
In reply to [email protected]From: Jes Sorensen <[email protected]>
--- qemu-config.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
qemu-config.c +6 -6
@@ -80,7 +80,7 @@ static QemuOptsList qemu_drive_opts = { .name = "readonly", .type = QEMU_OPT_BOOL, }, - {/* end if list */ } + {/* end of list */ } }, };
@@ -147,7 +147,7 @@ static QemuOptsList qemu_chardev_opts = { .name = "signal", .type = QEMU_OPT_BOOL, }, - {/* end if list */ } + {/* end of list */ } }, };
@@ -203,7 +203,7 @@ static QemuOptsList qemu_device_opts = {* sanity checking will happen later * when setting device properties */ - {/* end if list */ } + {/* end of list */ } }, };
@@ -247,7 +247,7 @@ static QemuOptsList qemu_rtc_opts = { .name = "driftfix", .type = QEMU_OPT_STRING, }, - {/* end if list */ } + {/* end of list */ } }, };
@@ -265,7 +265,7 @@ static QemuOptsList qemu_global_opts = { .name = "value", .type = QEMU_OPT_STRING, }, - {/* end if list */ } + {/* end of list */ } }, };
@@ -284,7 +284,7 @@ static QemuOptsList qemu_mon_opts = { .name = "default", .type = QEMU_OPT_BOOL, }, - {/* end if list */ } + {/* end of list */ } }, };
Signature · 1 line
1.7.2.2
PATCH 4/6 size_t is unsigned, change to ssize_t to handle errors from tight_compress_data()
In reply to [email protected]From: Jes Sorensen <[email protected]>
--- ui/vnc-enc-tight.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
ui/vnc-enc-tight.c +4 -4
@@ -905,7 +905,7 @@ static void tight_pack24(VncState *vs, uint8_t *buf, size_t count, size_t *ret)static int send_full_color_rect (VncState *vs,int x,int y,int w,int h) {int stream =0 ; -size_t bytes; +ssize_t bytes;#ifdef CONFIG_VNC_PNG if (tight_can_send_png_rect (vs, w, h)) {
@@ -949,7 +949,7 @@ static int send_solid_rect(VncState *vs)static int send_mono_rect (VncState *vs,int x,int y,int w,int h,uint32_t bg,uint32_t fg) { -size_t bytes; +ssize_t bytes;int stream =1 ;int level = tight_conf[vs->tight.compression].mono_zlib_level;
@@ -1029,7 +1029,7 @@ static bool send_gradient_rect(VncState *vs, int x, int y, int w, int h) {int stream =3 ;int level = tight_conf[vs->tight.compression].gradient_zlib_level; -size_t bytes; +ssize_t bytes;if (vs->clientds.pf.bytes_per_pixel ==1 )return send_full_color_rect (vs, x, y, w, h);
@@ -1066,7 +1066,7 @@ static int send_palette_rect(VncState *vs, int x, int y,int stream =2 ;int level = tight_conf[vs->tight.compression].idx_zlib_level;int colors; -size_t bytes; +ssize_t bytes;#ifdef CONFIG_VNC_PNG if (tight_can_send_png_rect (vs, w, h)) {
Signature · 1 line
1.7.2.2
PATCH 5/6 Change DPRINTF() to do{}while(0) to avoid compiler warning
In reply to [email protected]From: Jes Sorensen <[email protected]>
--- slirp/bootp.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
slirp/bootp.c +1 -1
@@ -33,7 +33,7 @@ static const uint8_t rfc1533_cookie[] = { RFC1533_COOKIE };#define DPRINTF (fmt, ...) \ do if (slirp_debug & DBG_CALL) { fprintf(dfd, fmt, ## __VA_ARGS__); fflush(dfd); } while (0)#else -#define DPRINTF (fmt, ...) +#define DPRINTF (fmt, ...) do{}while(0)#endif static BOOTPClient *get_new_addr(Slirp *slirp, struct in_addr *paddr,
Signature · 1 line
1.7.2.2
PATCH 6/6 load_multiboot(): get_image_size() returns int
In reply to [email protected]From: Jes Sorensen <[email protected]>
Do not store return of get_image_size() in a uint32_t as it makes it impossible to detect error returns from get_image_size.
--- hw/multiboot.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
hw/multiboot.c +1 -1
@@ -252,7 +252,7 @@ int load_multiboot(void *fw_cfg, do { char *next_space; - uint32_t mb_mod_length; + int mb_mod_length; uint32_t offs = mbs.mb_buf_size; next_initrd = strchr(initrd_filename, ',');
Signature · 1 line
1.7.2.2
Blue Swirl
AppliedThanks, applied all.
Quoted 35 lines · On Tue, Aug 31, 2010 at 7:30 AM, <[email protected]> wrote:
From: Jes Sorensen <[email protected]>
Hi,
Given the contention of the previous patch set, this is a stripped down version that doesn't have any of the parts included that got people up in arms. Lets at least start out getting the real bugs fixed and we can look at the other issues in parallel.
Cheers,
JesJes Sorensen (6):
Remove unused argument fornbd_client()
Respect return value fromnbd_client()
Fix repeated typo: was "end if list" instead of "end of list"size_tis unsigned, change tossize_tto handle errors fromtight_compress_data()
ChangeDPRINTF()to do{}while(0) to avoid compiler warningload_multiboot():get_image_size()returns inthw/multiboot.c | 2 +-
nbd.c | 4 ++--
nbd.h | 2 +-
qemu-config.c | 12 ++++++------
qemu-nbd.c | 5 ++++-
slirp/bootp.c | 2 +-
ui/vnc-enc-tight.c | 8 ++++----7 files changed, 19 insertions(+), 16 deletions(-)--
1.7.2.2