Commit 3f4cb3d37fb74db3580029624c8acd83dd5f4787
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
Showing
13 changed files
with
35 additions
and
31 deletions
block-cow.c
| ... | ... | @@ -95,10 +95,10 @@ static int cow_open(BlockDriverState *bs, const char *filename, int flags) |
| 95 | 95 | |
| 96 | 96 | /* mmap the bitmap */ |
| 97 | 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 | 102 | if (s->cow_bitmap_addr == MAP_FAILED) |
| 103 | 103 | goto fail; |
| 104 | 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 | 197 | static void cow_close(BlockDriverState *bs) |
| 198 | 198 | { |
| 199 | 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 | 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 | 583 | if (!acb->cluster_offset) { |
| 584 | 584 | if (bs->backing_hd) { |
| 585 | 585 | /* read from the base image */ |
| 586 | - acb->hd_iov.iov_base = acb->buf; | |
| 586 | + acb->hd_iov.iov_base = (void *)acb->buf; | |
| 587 | 587 | acb->hd_iov.iov_len = acb->n * 512; |
| 588 | 588 | qemu_iovec_init_external(&acb->hd_qiov, &acb->hd_iov, 1); |
| 589 | 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 | 607 | ret = -EIO; |
| 608 | 608 | goto done; |
| 609 | 609 | } |
| 610 | - acb->hd_iov.iov_base = acb->buf; | |
| 610 | + acb->hd_iov.iov_base = (void *)acb->buf; | |
| 611 | 611 | acb->hd_iov.iov_len = acb->n * 512; |
| 612 | 612 | qemu_iovec_init_external(&acb->hd_qiov, &acb->hd_iov, 1); |
| 613 | 613 | acb->hd_aiocb = bdrv_aio_readv(s->hd, |
| ... | ... | @@ -643,7 +643,7 @@ static BlockDriverAIOCB *qcow_aio_readv(BlockDriverState *bs, |
| 643 | 643 | if (qiov->niov > 1) |
| 644 | 644 | acb->buf = acb->orig_buf = qemu_memalign(512, qiov->size); |
| 645 | 645 | else |
| 646 | - acb->buf = qiov->iov->iov_base; | |
| 646 | + acb->buf = (uint8_t *)qiov->iov->iov_base; | |
| 647 | 647 | acb->nb_sectors = nb_sectors; |
| 648 | 648 | acb->n = 0; |
| 649 | 649 | acb->cluster_offset = 0; |
| ... | ... | @@ -738,8 +738,9 @@ static BlockDriverAIOCB *qcow_aio_writev(BlockDriverState *bs, |
| 738 | 738 | if (qiov->niov > 1) { |
| 739 | 739 | acb->buf = acb->orig_buf = qemu_memalign(512, qiov->size); |
| 740 | 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 | 744 | acb->nb_sectors = nb_sectors; |
| 744 | 745 | acb->n = 0; |
| 745 | 746 | ... | ... |
block-qcow2.c
| ... | ... | @@ -1346,7 +1346,7 @@ static void qcow_aio_read_cb(void *opaque, int ret) |
| 1346 | 1346 | n1 = backing_read1(bs->backing_hd, acb->sector_num, |
| 1347 | 1347 | acb->buf, acb->n); |
| 1348 | 1348 | if (n1 > 0) { |
| 1349 | - acb->hd_iov.iov_base = acb->buf; | |
| 1349 | + acb->hd_iov.iov_base = (void *)acb->buf; | |
| 1350 | 1350 | acb->hd_iov.iov_len = acb->n * 512; |
| 1351 | 1351 | qemu_iovec_init_external(&acb->hd_qiov, &acb->hd_iov, 1); |
| 1352 | 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 | 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 | 1385 | acb->hd_iov.iov_len = acb->n * 512; |
| 1386 | 1386 | qemu_iovec_init_external(&acb->hd_qiov, &acb->hd_iov, 1); |
| 1387 | 1387 | acb->hd_aiocb = bdrv_aio_readv(s->hd, |
| ... | ... | @@ -1417,8 +1417,9 @@ static QCowAIOCB *qcow_aio_setup(BlockDriverState *bs, |
| 1417 | 1417 | acb->buf = acb->orig_buf = qemu_memalign(512, qiov->size); |
| 1418 | 1418 | if (is_write) |
| 1419 | 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 | 1423 | acb->nb_sectors = nb_sectors; |
| 1423 | 1424 | acb->n = 0; |
| 1424 | 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 | 1778 | } |
| 1779 | 1779 | |
| 1780 | 1780 | for (i = 0; i < 0x10 * s->sectors_per_cluster; i++) { |
| 1781 | - int cluster_count; | |
| 1781 | + int cluster_count = 0; | |
| 1782 | 1782 | |
| 1783 | 1783 | DLOG(fprintf(stderr, "check direntry %d: \n", i); print_direntry(direntries + i)); |
| 1784 | 1784 | if (is_volume_label(direntries + i) || is_dot(direntries + i) || | ... | ... |
block.c
| ... | ... | @@ -1434,7 +1434,7 @@ static int bdrv_read_em(BlockDriverState *bs, int64_t sector_num, |
| 1434 | 1434 | QEMUIOVector qiov; |
| 1435 | 1435 | |
| 1436 | 1436 | async_ret = NOT_DONE; |
| 1437 | - iov.iov_base = buf; | |
| 1437 | + iov.iov_base = (void *)buf; | |
| 1438 | 1438 | iov.iov_len = nb_sectors * 512; |
| 1439 | 1439 | qemu_iovec_init_external(&qiov, &iov, 1); |
| 1440 | 1440 | acb = bdrv_aio_readv(bs, sector_num, &qiov, nb_sectors, | ... | ... |
bt-host.c
fpu/softfloat-macros.h
| ... | ... | @@ -590,12 +590,12 @@ static bits32 estimateSqrt32( int16 aExp, bits32 a ) |
| 590 | 590 | |
| 591 | 591 | index = ( a>>27 ) & 15; |
| 592 | 592 | if ( aExp & 1 ) { |
| 593 | - z = 0x4000 + ( a>>17 ) - sqrtOddAdjustments[ index ]; | |
| 593 | + z = 0x4000 + ( a>>17 ) - sqrtOddAdjustments[ (int)index ]; | |
| 594 | 594 | z = ( ( a / z )<<14 ) + ( z<<15 ); |
| 595 | 595 | a >>= 1; |
| 596 | 596 | } |
| 597 | 597 | else { |
| 598 | - z = 0x8000 + ( a>>17 ) - sqrtEvenAdjustments[ index ]; | |
| 598 | + z = 0x8000 + ( a>>17 ) - sqrtEvenAdjustments[ (int)index ]; | |
| 599 | 599 | z = a / z + z; |
| 600 | 600 | z = ( 0x20000 <= z ) ? 0xFFFF8000 : ( z<<15 ); |
| 601 | 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 | 1469 | #ifdef DEBUG_AIO |
| 1470 | 1470 | printf("aio_read_cd: lba=%u n=%d\n", s->lba, n); |
| 1471 | 1471 | #endif |
| 1472 | - bm->iov.iov_base = s->io_buffer + data_offset; | |
| 1472 | + bm->iov.iov_base = (void *)(s->io_buffer + data_offset); | |
| 1473 | 1473 | bm->iov.iov_len = n * 4 * 512; |
| 1474 | 1474 | qemu_iovec_init_external(&bm->qiov, &bm->iov, 1); |
| 1475 | 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 | 335 | BADF("Bad buffer tag 0x%x\n", tag); |
| 336 | 336 | return NULL; |
| 337 | 337 | } |
| 338 | - return r->iov.iov_base; | |
| 338 | + return (uint8_t *)r->iov.iov_base; | |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 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 | 365 | /* ??? Tags are not unique for different luns. We only implement a |
| 366 | 366 | single lun, so this should not matter. */ |
| 367 | 367 | r = scsi_new_request(s, tag); |
| 368 | - outbuf = r->iov.iov_base; | |
| 368 | + outbuf = (uint8_t *)r->iov.iov_base; | |
| 369 | 369 | is_write = 0; |
| 370 | 370 | DPRINTF("Command: lun=%d tag=0x%x data=0x%02x", lun, tag, buf[0]); |
| 371 | 371 | switch (command >> 5) { | ... | ... |
hw/virtio-console.c
| ... | ... | @@ -38,8 +38,10 @@ static void virtio_console_handle_output(VirtIODevice *vdev, VirtQueue *vq) |
| 38 | 38 | ssize_t len = 0; |
| 39 | 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 | 45 | virtqueue_push(vq, &elem, len); |
| 44 | 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 | 313 | static int receive_header(VirtIONet *n, struct iovec *iov, int iovcnt, |
| 314 | 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 | 317 | int offset = 0; |
| 318 | 318 | |
| 319 | 319 | hdr->flags = 0; | ... | ... |
net.c
| ... | ... | @@ -626,7 +626,7 @@ void net_slirp_smb(const char *exported_dir) |
| 626 | 626 | } |
| 627 | 627 | |
| 628 | 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 | 630 | if (mkdir(smb_dir, 0700) < 0) { |
| 631 | 631 | fprintf(stderr, "qemu: could not create samba server dir '%s'\n", smb_dir); |
| 632 | 632 | exit(1); |
| ... | ... | @@ -740,7 +740,7 @@ static void tap_send(void *opaque) |
| 740 | 740 | struct strbuf sbuf; |
| 741 | 741 | int f = 0; |
| 742 | 742 | sbuf.maxlen = sizeof(buf); |
| 743 | - sbuf.buf = buf; | |
| 743 | + sbuf.buf = (char *)buf; | |
| 744 | 744 | size = getmsg(s->fd, NULL, &sbuf, &f) >=0 ? sbuf.len : -1; |
| 745 | 745 | #else |
| 746 | 746 | size = read(s->fd, buf, sizeof(buf)); |
| ... | ... | @@ -796,7 +796,7 @@ static int tap_open(char *ifname, int ifname_size) |
| 796 | 796 | * Allocate TAP device, returns opened fd. |
| 797 | 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 | 801 | int tap_fd, if_fd, ppa = -1; |
| 802 | 802 | static int ip_fd = 0; | ... | ... |
qemu-char.c
| ... | ... | @@ -754,8 +754,8 @@ static CharDriverState *qemu_chr_open_stdio(void) |
| 754 | 754 | |
| 755 | 755 | #ifdef __sun__ |
| 756 | 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 | 760 | const char *slave; |
| 761 | 761 | int mfd = -1, sfd = -1; |
| ... | ... | @@ -795,7 +795,7 @@ err: |
| 795 | 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 | 800 | termios_p->c_iflag &= |
| 801 | 801 | ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON); | ... | ... |