Commit 3f4cb3d37fb74db3580029624c8acd83dd5f4787

Authored by blueswir1
1 parent 14d483ec

Fix OpenSolaris gcc4 warnings: iovec type mismatches, missing 'static'

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7103 c046a42c-6fe2-441c-8c8c-71466251a162
block-cow.c
@@ -95,10 +95,10 @@ static int cow_open(BlockDriverState *bs, const char *filename, int flags) @@ -95,10 +95,10 @@ static int cow_open(BlockDriverState *bs, const char *filename, int flags)
95 95
96 /* mmap the bitmap */ 96 /* mmap the bitmap */
97 s->cow_bitmap_size = ((bs->total_sectors + 7) >> 3) + sizeof(cow_header); 97 s->cow_bitmap_size = ((bs->total_sectors + 7) >> 3) + sizeof(cow_header);
98 - s->cow_bitmap_addr = mmap(get_mmap_addr(s->cow_bitmap_size),  
99 - s->cow_bitmap_size,  
100 - PROT_READ | PROT_WRITE,  
101 - MAP_SHARED, s->fd, 0); 98 + s->cow_bitmap_addr = (void *)mmap(get_mmap_addr(s->cow_bitmap_size),
  99 + s->cow_bitmap_size,
  100 + PROT_READ | PROT_WRITE,
  101 + MAP_SHARED, s->fd, 0);
102 if (s->cow_bitmap_addr == MAP_FAILED) 102 if (s->cow_bitmap_addr == MAP_FAILED)
103 goto fail; 103 goto fail;
104 s->cow_bitmap = s->cow_bitmap_addr + sizeof(cow_header); 104 s->cow_bitmap = s->cow_bitmap_addr + sizeof(cow_header);
@@ -197,7 +197,7 @@ static int cow_write(BlockDriverState *bs, int64_t sector_num, @@ -197,7 +197,7 @@ static int cow_write(BlockDriverState *bs, int64_t sector_num,
197 static void cow_close(BlockDriverState *bs) 197 static void cow_close(BlockDriverState *bs)
198 { 198 {
199 BDRVCowState *s = bs->opaque; 199 BDRVCowState *s = bs->opaque;
200 - munmap(s->cow_bitmap_addr, s->cow_bitmap_size); 200 + munmap((void *)s->cow_bitmap_addr, s->cow_bitmap_size);
201 close(s->fd); 201 close(s->fd);
202 } 202 }
203 203
block-qcow.c
@@ -583,7 +583,7 @@ static void qcow_aio_read_cb(void *opaque, int ret) @@ -583,7 +583,7 @@ static void qcow_aio_read_cb(void *opaque, int ret)
583 if (!acb->cluster_offset) { 583 if (!acb->cluster_offset) {
584 if (bs->backing_hd) { 584 if (bs->backing_hd) {
585 /* read from the base image */ 585 /* read from the base image */
586 - acb->hd_iov.iov_base = acb->buf; 586 + acb->hd_iov.iov_base = (void *)acb->buf;
587 acb->hd_iov.iov_len = acb->n * 512; 587 acb->hd_iov.iov_len = acb->n * 512;
588 qemu_iovec_init_external(&acb->hd_qiov, &acb->hd_iov, 1); 588 qemu_iovec_init_external(&acb->hd_qiov, &acb->hd_iov, 1);
589 acb->hd_aiocb = bdrv_aio_readv(bs->backing_hd, acb->sector_num, 589 acb->hd_aiocb = bdrv_aio_readv(bs->backing_hd, acb->sector_num,
@@ -607,7 +607,7 @@ static void qcow_aio_read_cb(void *opaque, int ret) @@ -607,7 +607,7 @@ static void qcow_aio_read_cb(void *opaque, int ret)
607 ret = -EIO; 607 ret = -EIO;
608 goto done; 608 goto done;
609 } 609 }
610 - acb->hd_iov.iov_base = acb->buf; 610 + acb->hd_iov.iov_base = (void *)acb->buf;
611 acb->hd_iov.iov_len = acb->n * 512; 611 acb->hd_iov.iov_len = acb->n * 512;
612 qemu_iovec_init_external(&acb->hd_qiov, &acb->hd_iov, 1); 612 qemu_iovec_init_external(&acb->hd_qiov, &acb->hd_iov, 1);
613 acb->hd_aiocb = bdrv_aio_readv(s->hd, 613 acb->hd_aiocb = bdrv_aio_readv(s->hd,
@@ -643,7 +643,7 @@ static BlockDriverAIOCB *qcow_aio_readv(BlockDriverState *bs, @@ -643,7 +643,7 @@ static BlockDriverAIOCB *qcow_aio_readv(BlockDriverState *bs,
643 if (qiov->niov > 1) 643 if (qiov->niov > 1)
644 acb->buf = acb->orig_buf = qemu_memalign(512, qiov->size); 644 acb->buf = acb->orig_buf = qemu_memalign(512, qiov->size);
645 else 645 else
646 - acb->buf = qiov->iov->iov_base; 646 + acb->buf = (uint8_t *)qiov->iov->iov_base;
647 acb->nb_sectors = nb_sectors; 647 acb->nb_sectors = nb_sectors;
648 acb->n = 0; 648 acb->n = 0;
649 acb->cluster_offset = 0; 649 acb->cluster_offset = 0;
@@ -738,8 +738,9 @@ static BlockDriverAIOCB *qcow_aio_writev(BlockDriverState *bs, @@ -738,8 +738,9 @@ static BlockDriverAIOCB *qcow_aio_writev(BlockDriverState *bs,
738 if (qiov->niov > 1) { 738 if (qiov->niov > 1) {
739 acb->buf = acb->orig_buf = qemu_memalign(512, qiov->size); 739 acb->buf = acb->orig_buf = qemu_memalign(512, qiov->size);
740 qemu_iovec_to_buffer(qiov, acb->buf); 740 qemu_iovec_to_buffer(qiov, acb->buf);
741 - } else  
742 - acb->buf = qiov->iov->iov_base; 741 + } else {
  742 + acb->buf = (uint8_t *)qiov->iov->iov_base;
  743 + }
743 acb->nb_sectors = nb_sectors; 744 acb->nb_sectors = nb_sectors;
744 acb->n = 0; 745 acb->n = 0;
745 746
block-qcow2.c
@@ -1346,7 +1346,7 @@ static void qcow_aio_read_cb(void *opaque, int ret) @@ -1346,7 +1346,7 @@ static void qcow_aio_read_cb(void *opaque, int ret)
1346 n1 = backing_read1(bs->backing_hd, acb->sector_num, 1346 n1 = backing_read1(bs->backing_hd, acb->sector_num,
1347 acb->buf, acb->n); 1347 acb->buf, acb->n);
1348 if (n1 > 0) { 1348 if (n1 > 0) {
1349 - acb->hd_iov.iov_base = acb->buf; 1349 + acb->hd_iov.iov_base = (void *)acb->buf;
1350 acb->hd_iov.iov_len = acb->n * 512; 1350 acb->hd_iov.iov_len = acb->n * 512;
1351 qemu_iovec_init_external(&acb->hd_qiov, &acb->hd_iov, 1); 1351 qemu_iovec_init_external(&acb->hd_qiov, &acb->hd_iov, 1);
1352 acb->hd_aiocb = bdrv_aio_readv(bs->backing_hd, acb->sector_num, 1352 acb->hd_aiocb = bdrv_aio_readv(bs->backing_hd, acb->sector_num,
@@ -1381,7 +1381,7 @@ static void qcow_aio_read_cb(void *opaque, int ret) @@ -1381,7 +1381,7 @@ static void qcow_aio_read_cb(void *opaque, int ret)
1381 goto done; 1381 goto done;
1382 } 1382 }
1383 1383
1384 - acb->hd_iov.iov_base = acb->buf; 1384 + acb->hd_iov.iov_base = (void *)acb->buf;
1385 acb->hd_iov.iov_len = acb->n * 512; 1385 acb->hd_iov.iov_len = acb->n * 512;
1386 qemu_iovec_init_external(&acb->hd_qiov, &acb->hd_iov, 1); 1386 qemu_iovec_init_external(&acb->hd_qiov, &acb->hd_iov, 1);
1387 acb->hd_aiocb = bdrv_aio_readv(s->hd, 1387 acb->hd_aiocb = bdrv_aio_readv(s->hd,
@@ -1417,8 +1417,9 @@ static QCowAIOCB *qcow_aio_setup(BlockDriverState *bs, @@ -1417,8 +1417,9 @@ static QCowAIOCB *qcow_aio_setup(BlockDriverState *bs,
1417 acb->buf = acb->orig_buf = qemu_memalign(512, qiov->size); 1417 acb->buf = acb->orig_buf = qemu_memalign(512, qiov->size);
1418 if (is_write) 1418 if (is_write)
1419 qemu_iovec_to_buffer(qiov, acb->buf); 1419 qemu_iovec_to_buffer(qiov, acb->buf);
1420 - } else  
1421 - acb->buf = qiov->iov->iov_base; 1420 + } else {
  1421 + acb->buf = (uint8_t *)qiov->iov->iov_base;
  1422 + }
1422 acb->nb_sectors = nb_sectors; 1423 acb->nb_sectors = nb_sectors;
1423 acb->n = 0; 1424 acb->n = 0;
1424 acb->cluster_offset = 0; 1425 acb->cluster_offset = 0;
block-vvfat.c
@@ -1778,7 +1778,7 @@ DLOG(fprintf(stderr, "read cluster %d (sector %d)\n", (int)cluster_num, (int)clu @@ -1778,7 +1778,7 @@ DLOG(fprintf(stderr, "read cluster %d (sector %d)\n", (int)cluster_num, (int)clu
1778 } 1778 }
1779 1779
1780 for (i = 0; i < 0x10 * s->sectors_per_cluster; i++) { 1780 for (i = 0; i < 0x10 * s->sectors_per_cluster; i++) {
1781 - int cluster_count; 1781 + int cluster_count = 0;
1782 1782
1783 DLOG(fprintf(stderr, "check direntry %d: \n", i); print_direntry(direntries + i)); 1783 DLOG(fprintf(stderr, "check direntry %d: \n", i); print_direntry(direntries + i));
1784 if (is_volume_label(direntries + i) || is_dot(direntries + i) || 1784 if (is_volume_label(direntries + i) || is_dot(direntries + i) ||
@@ -1434,7 +1434,7 @@ static int bdrv_read_em(BlockDriverState *bs, int64_t sector_num, @@ -1434,7 +1434,7 @@ static int bdrv_read_em(BlockDriverState *bs, int64_t sector_num,
1434 QEMUIOVector qiov; 1434 QEMUIOVector qiov;
1435 1435
1436 async_ret = NOT_DONE; 1436 async_ret = NOT_DONE;
1437 - iov.iov_base = buf; 1437 + iov.iov_base = (void *)buf;
1438 iov.iov_len = nb_sectors * 512; 1438 iov.iov_len = nb_sectors * 512;
1439 qemu_iovec_init_external(&qiov, &iov, 1); 1439 qemu_iovec_init_external(&qiov, &iov, 1);
1440 acb = bdrv_aio_readv(bs, sector_num, &qiov, nb_sectors, 1440 acb = bdrv_aio_readv(bs, sector_num, &qiov, nb_sectors,
bt-host.c
@@ -53,7 +53,7 @@ static void bt_host_send(struct HCIInfo *hci, @@ -53,7 +53,7 @@ static void bt_host_send(struct HCIInfo *hci,
53 struct iovec iv[2]; 53 struct iovec iv[2];
54 int ret; 54 int ret;
55 55
56 - iv[0].iov_base = &pkt; 56 + iv[0].iov_base = (void *)&pkt;
57 iv[0].iov_len = 1; 57 iv[0].iov_len = 1;
58 iv[1].iov_base = (void *) data; 58 iv[1].iov_base = (void *) data;
59 iv[1].iov_len = len; 59 iv[1].iov_len = len;
fpu/softfloat-macros.h
@@ -590,12 +590,12 @@ static bits32 estimateSqrt32( int16 aExp, bits32 a ) @@ -590,12 +590,12 @@ static bits32 estimateSqrt32( int16 aExp, bits32 a )
590 590
591 index = ( a>>27 ) & 15; 591 index = ( a>>27 ) & 15;
592 if ( aExp & 1 ) { 592 if ( aExp & 1 ) {
593 - z = 0x4000 + ( a>>17 ) - sqrtOddAdjustments[ index ]; 593 + z = 0x4000 + ( a>>17 ) - sqrtOddAdjustments[ (int)index ];
594 z = ( ( a / z )<<14 ) + ( z<<15 ); 594 z = ( ( a / z )<<14 ) + ( z<<15 );
595 a >>= 1; 595 a >>= 1;
596 } 596 }
597 else { 597 else {
598 - z = 0x8000 + ( a>>17 ) - sqrtEvenAdjustments[ index ]; 598 + z = 0x8000 + ( a>>17 ) - sqrtEvenAdjustments[ (int)index ];
599 z = a / z + z; 599 z = a / z + z;
600 z = ( 0x20000 <= z ) ? 0xFFFF8000 : ( z<<15 ); 600 z = ( 0x20000 <= z ) ? 0xFFFF8000 : ( z<<15 );
601 if ( z <= a ) return (bits32) ( ( (sbits32) a )>>1 ); 601 if ( z <= a ) return (bits32) ( ( (sbits32) a )>>1 );
hw/ide.c
@@ -1469,7 +1469,7 @@ static void ide_atapi_cmd_read_dma_cb(void *opaque, int ret) @@ -1469,7 +1469,7 @@ static void ide_atapi_cmd_read_dma_cb(void *opaque, int ret)
1469 #ifdef DEBUG_AIO 1469 #ifdef DEBUG_AIO
1470 printf("aio_read_cd: lba=%u n=%d\n", s->lba, n); 1470 printf("aio_read_cd: lba=%u n=%d\n", s->lba, n);
1471 #endif 1471 #endif
1472 - bm->iov.iov_base = s->io_buffer + data_offset; 1472 + bm->iov.iov_base = (void *)(s->io_buffer + data_offset);
1473 bm->iov.iov_len = n * 4 * 512; 1473 bm->iov.iov_len = n * 4 * 512;
1474 qemu_iovec_init_external(&bm->qiov, &bm->iov, 1); 1474 qemu_iovec_init_external(&bm->qiov, &bm->iov, 1);
1475 bm->aiocb = bdrv_aio_readv(s->bs, (int64_t)s->lba << 2, &bm->qiov, 1475 bm->aiocb = bdrv_aio_readv(s->bs, (int64_t)s->lba << 2, &bm->qiov,
hw/scsi-disk.c
@@ -335,7 +335,7 @@ static uint8_t *scsi_get_buf(SCSIDevice *d, uint32_t tag) @@ -335,7 +335,7 @@ static uint8_t *scsi_get_buf(SCSIDevice *d, uint32_t tag)
335 BADF("Bad buffer tag 0x%x\n", tag); 335 BADF("Bad buffer tag 0x%x\n", tag);
336 return NULL; 336 return NULL;
337 } 337 }
338 - return r->iov.iov_base; 338 + return (uint8_t *)r->iov.iov_base;
339 } 339 }
340 340
341 /* Execute a scsi command. Returns the length of the data expected by the 341 /* Execute a scsi command. Returns the length of the data expected by the
@@ -365,7 +365,7 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag, @@ -365,7 +365,7 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag,
365 /* ??? Tags are not unique for different luns. We only implement a 365 /* ??? Tags are not unique for different luns. We only implement a
366 single lun, so this should not matter. */ 366 single lun, so this should not matter. */
367 r = scsi_new_request(s, tag); 367 r = scsi_new_request(s, tag);
368 - outbuf = r->iov.iov_base; 368 + outbuf = (uint8_t *)r->iov.iov_base;
369 is_write = 0; 369 is_write = 0;
370 DPRINTF("Command: lun=%d tag=0x%x data=0x%02x", lun, tag, buf[0]); 370 DPRINTF("Command: lun=%d tag=0x%x data=0x%02x", lun, tag, buf[0]);
371 switch (command >> 5) { 371 switch (command >> 5) {
hw/virtio-console.c
@@ -38,8 +38,10 @@ static void virtio_console_handle_output(VirtIODevice *vdev, VirtQueue *vq) @@ -38,8 +38,10 @@ static void virtio_console_handle_output(VirtIODevice *vdev, VirtQueue *vq)
38 ssize_t len = 0; 38 ssize_t len = 0;
39 int d; 39 int d;
40 40
41 - for (d=0; d < elem.out_num; d++)  
42 - len += qemu_chr_write(s->chr, elem.out_sg[d].iov_base,elem.out_sg[d].iov_len); 41 + for (d = 0; d < elem.out_num; d++) {
  42 + len += qemu_chr_write(s->chr, (uint8_t *)elem.out_sg[d].iov_base,
  43 + elem.out_sg[d].iov_len);
  44 + }
43 virtqueue_push(vq, &elem, len); 45 virtqueue_push(vq, &elem, len);
44 virtio_notify(vdev, vq); 46 virtio_notify(vdev, vq);
45 } 47 }
hw/virtio-net.c
@@ -313,7 +313,7 @@ static int iov_fill(struct iovec *iov, int iovcnt, const void *buf, int count) @@ -313,7 +313,7 @@ static int iov_fill(struct iovec *iov, int iovcnt, const void *buf, int count)
313 static int receive_header(VirtIONet *n, struct iovec *iov, int iovcnt, 313 static int receive_header(VirtIONet *n, struct iovec *iov, int iovcnt,
314 const void *buf, size_t size, size_t hdr_len) 314 const void *buf, size_t size, size_t hdr_len)
315 { 315 {
316 - struct virtio_net_hdr *hdr = iov[0].iov_base; 316 + struct virtio_net_hdr *hdr = (struct virtio_net_hdr *)iov[0].iov_base;
317 int offset = 0; 317 int offset = 0;
318 318
319 hdr->flags = 0; 319 hdr->flags = 0;
@@ -626,7 +626,7 @@ void net_slirp_smb(const char *exported_dir) @@ -626,7 +626,7 @@ void net_slirp_smb(const char *exported_dir)
626 } 626 }
627 627
628 /* XXX: better tmp dir construction */ 628 /* XXX: better tmp dir construction */
629 - snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%d", getpid()); 629 + snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%ld", (long)getpid());
630 if (mkdir(smb_dir, 0700) < 0) { 630 if (mkdir(smb_dir, 0700) < 0) {
631 fprintf(stderr, "qemu: could not create samba server dir '%s'\n", smb_dir); 631 fprintf(stderr, "qemu: could not create samba server dir '%s'\n", smb_dir);
632 exit(1); 632 exit(1);
@@ -740,7 +740,7 @@ static void tap_send(void *opaque) @@ -740,7 +740,7 @@ static void tap_send(void *opaque)
740 struct strbuf sbuf; 740 struct strbuf sbuf;
741 int f = 0; 741 int f = 0;
742 sbuf.maxlen = sizeof(buf); 742 sbuf.maxlen = sizeof(buf);
743 - sbuf.buf = buf; 743 + sbuf.buf = (char *)buf;
744 size = getmsg(s->fd, NULL, &sbuf, &f) >=0 ? sbuf.len : -1; 744 size = getmsg(s->fd, NULL, &sbuf, &f) >=0 ? sbuf.len : -1;
745 #else 745 #else
746 size = read(s->fd, buf, sizeof(buf)); 746 size = read(s->fd, buf, sizeof(buf));
@@ -796,7 +796,7 @@ static int tap_open(char *ifname, int ifname_size) @@ -796,7 +796,7 @@ static int tap_open(char *ifname, int ifname_size)
796 * Allocate TAP device, returns opened fd. 796 * Allocate TAP device, returns opened fd.
797 * Stores dev name in the first arg(must be large enough). 797 * Stores dev name in the first arg(must be large enough).
798 */ 798 */
799 -int tap_alloc(char *dev, size_t dev_size) 799 +static int tap_alloc(char *dev, size_t dev_size)
800 { 800 {
801 int tap_fd, if_fd, ppa = -1; 801 int tap_fd, if_fd, ppa = -1;
802 static int ip_fd = 0; 802 static int ip_fd = 0;
qemu-char.c
@@ -754,8 +754,8 @@ static CharDriverState *qemu_chr_open_stdio(void) @@ -754,8 +754,8 @@ static CharDriverState *qemu_chr_open_stdio(void)
754 754
755 #ifdef __sun__ 755 #ifdef __sun__
756 /* Once Solaris has openpty(), this is going to be removed. */ 756 /* Once Solaris has openpty(), this is going to be removed. */
757 -int openpty(int *amaster, int *aslave, char *name,  
758 - struct termios *termp, struct winsize *winp) 757 +static int openpty(int *amaster, int *aslave, char *name,
  758 + struct termios *termp, struct winsize *winp)
759 { 759 {
760 const char *slave; 760 const char *slave;
761 int mfd = -1, sfd = -1; 761 int mfd = -1, sfd = -1;
@@ -795,7 +795,7 @@ err: @@ -795,7 +795,7 @@ err:
795 return -1; 795 return -1;
796 } 796 }
797 797
798 -void cfmakeraw (struct termios *termios_p) 798 +static void cfmakeraw (struct termios *termios_p)
799 { 799 {
800 termios_p->c_iflag &= 800 termios_p->c_iflag &=
801 ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON); 801 ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);