[Sumover-dev] [svn commit] r4465 - common/trunk/src

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Thu Jun 11 17:27:54 BST 2009


Author: piers
Date: Thu Jun 11 17:27:48 2009
New Revision: 4465

Modified:
   common/trunk/src/net_udp.c
   common/trunk/src/net_udp.h

Log:
Fixed fd_t type problem when including net_udp.h into Rat (and other external software). I changed things so [back] that fd_t is only used within the library (net_udp.c) implementation. Not tested with mingw or Windows.


Modified: common/trunk/src/net_udp.c
==============================================================================
--- common/trunk/src/net_udp.c	(original)
+++ common/trunk/src/net_udp.c	Thu Jun 11 17:27:48 2009
@@ -1349,7 +1349,7 @@
  * Clears file descriptor from set associated with UDP sessions (see select(2)).
  * 
  **/
-void udp_fd_zero( fd_set *readset, fd_t *max_fd )
+void udp_fd_zero( fd_set *readset, int *max_fd )
 {
 	FD_ZERO(readset);
 	*max_fd = 0;
@@ -1361,7 +1361,7 @@
  * 
  * Adds file descriptor associated of @s to set associated with UDP sessions.
  **/
-void udp_fd_set( fd_set *readset, fd_t *max_fd, socket_udp *s)
+void udp_fd_set( fd_set *readset, int *max_fd, socket_udp *s)
 {
 	FD_SET(s->fd, readset);
 	if (s->fd > (fd_t)*max_fd) {
@@ -1378,7 +1378,7 @@
  *
  * Returns: non-zero if set, zero otherwise.
  **/
-int udp_fd_isset( fd_set *readset, fd_t *max_fd, socket_udp *s)
+int udp_fd_isset( fd_set *readset, int *max_fd, socket_udp *s)
 {
 	UNUSED(max_fd);
 
@@ -1393,9 +1393,9 @@
  * 
  * Return value: number of UDP sessions ready for reading.
  **/
-int udp_select( fd_set *readset, fd_t max_fd, struct timeval *timeout)
+int udp_select( fd_set *readset, int max_fd, struct timeval *timeout)
 {
-	return select(max_fd + 1, readset, NULL, NULL, timeout);
+	return select((fd_t)max_fd + 1, readset, NULL, NULL, timeout);
 }
 
 /**

Modified: common/trunk/src/net_udp.h
==============================================================================
--- common/trunk/src/net_udp.h	(original)
+++ common/trunk/src/net_udp.h	Thu Jun 11 17:27:48 2009
@@ -57,10 +57,10 @@
 const char *udp_host_addr(socket_udp *s);
 int         udp_fd(socket_udp *s);
 
-int         udp_select( fd_set *readset, fd_t max_fd, struct timeval *timeout);
-void        udp_fd_zero( fd_set *readset, fd_t *max_fd );
-void        udp_fd_set( fd_set *readset, fd_t *max_fd, socket_udp *s);
-int         udp_fd_isset( fd_set *readset, fd_t *max_fd, socket_udp *s);
+int         udp_select( fd_set *readset, int max_fd, struct timeval *timeout);
+void        udp_fd_zero( fd_set *readset, int *max_fd );
+void        udp_fd_set( fd_set *readset, int *max_fd, socket_udp *s);
+int         udp_fd_isset( fd_set *readset, int *max_fd, socket_udp *s);
 
 #if defined(__cplusplus)
 }



More information about the Sumover-dev mailing list