Fix signed when compiling with MSys/MinGW

fix signed issues when compiling with MSys/MinGW.
Fixes #572591.
This commit is contained in:
LRN 2009-02-23 12:33:13 +01:00 committed by Wim Taymans
parent 805569c873
commit 4cd4883ed3
2 changed files with 15 additions and 2 deletions

View file

@ -126,7 +126,11 @@ gst_net_time_packet_receive (gint fd, struct sockaddr * addr, socklen_t * len)
gint ret; gint ret;
while (TRUE) { while (TRUE) {
#ifdef G_OS_WIN32
ret = recvfrom (fd, (char *) buffer, GST_NET_TIME_PACKET_SIZE,
#else
ret = recvfrom (fd, buffer, GST_NET_TIME_PACKET_SIZE, ret = recvfrom (fd, buffer, GST_NET_TIME_PACKET_SIZE,
#endif
0, (struct sockaddr *) addr, len); 0, (struct sockaddr *) addr, len);
if (ret < 0) { if (ret < 0) {
if (errno != EAGAIN && errno != EINTR) if (errno != EAGAIN && errno != EINTR)
@ -197,9 +201,12 @@ gst_net_time_packet_send (const GstNetTimePacket * packet, gint fd,
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
ioctlsocket (fd, FIONBIO, &flags); /* Set nonblocking mode */ ioctlsocket (fd, FIONBIO, &flags); /* Set nonblocking mode */
#endif ret =
sendto (fd, (char *) buffer, GST_NET_TIME_PACKET_SIZE, send_flags, addr,
len);
#else
ret = sendto (fd, buffer, GST_NET_TIME_PACKET_SIZE, send_flags, addr, len); ret = sendto (fd, buffer, GST_NET_TIME_PACKET_SIZE, send_flags, addr, len);
#endif
#ifdef __CYGWIN__ #ifdef __CYGWIN__
fcntl (fd, F_SETFL, fdflags); fcntl (fd, F_SETFL, fdflags);

View file

@ -384,7 +384,13 @@ gst_net_time_provider_start (GstNetTimeProvider * self)
goto bind_error; goto bind_error;
len = sizeof (my_addr); len = sizeof (my_addr);
#ifdef G_OS_WIN32
ret =
getsockname (self->priv->sock.fd, (struct sockaddr *) &my_addr,
(gint *) & len);
#else
ret = getsockname (self->priv->sock.fd, (struct sockaddr *) &my_addr, &len); ret = getsockname (self->priv->sock.fd, (struct sockaddr *) &my_addr, &len);
#endif
if (ret < 0) if (ret < 0)
goto getsockname_error; goto getsockname_error;