Commit 705032644fb37a516e5072136c1a891d12e6c90e

Authored by Stefan Weil
Committed by Blue Swirl
1 parent c5b76b38

Win32: Don't remove const attribute in type casts.

Type casts removing the const attribute are bad because
they hide the fact that the argument remains const.

They also result in a compiler warning (at least with MS-C).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Showing 3 changed files with 3 additions and 3 deletions
... ... @@ -1507,7 +1507,7 @@ static ssize_t net_socket_receive_dgram(VLANClientState *vc, const uint8_t *buf,
1507 1507 {
1508 1508 NetSocketState *s = vc->opaque;
1509 1509  
1510   - return sendto(s->fd, (void *)buf, size, 0,
  1510 + return sendto(s->fd, (const void *)buf, size, 0,
1511 1511 (struct sockaddr *)&s->dgram_dst, sizeof(s->dgram_dst));
1512 1512 }
1513 1513  
... ...
qemu-char.c
... ... @@ -1708,7 +1708,7 @@ static int udp_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
1708 1708 {
1709 1709 NetCharDriver *s = chr->opaque;
1710 1710  
1711   - return sendto(s->fd, (void *)buf, len, 0,
  1711 + return sendto(s->fd, (const void *)buf, len, 0,
1712 1712 (struct sockaddr *)&s->daddr, sizeof(struct sockaddr_in));
1713 1713 }
1714 1714  
... ...
... ... @@ -961,7 +961,7 @@ long vnc_client_write_buf(VncState *vs, const uint8_t *data, size_t datalen)
961 961 }
962 962 } else
963 963 #endif /* CONFIG_VNC_TLS */
964   - ret = send(vs->csock, (void *)data, datalen, 0);
  964 + ret = send(vs->csock, (const void *)data, datalen, 0);
965 965 VNC_DEBUG("Wrote wire %p %zd -> %ld\n", data, datalen, ret);
966 966 return vnc_client_io_error(vs, ret, socket_error());
967 967 }
... ...