Changeset 3788:fe1762804632 in roaraudio for libroar/socket.c


Ignore:
Timestamp:
05/07/10 15:44:52 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

fix some warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/socket.c

    r3785 r3788  
    5959 int opt = IPTOS_LOWDELAY; 
    6060#endif 
    61 #ifdef TCP_NODELAY 
     61#if defined(TCP_NODELAY) && !defined(ROAR_TARGET_WIN32) 
    6262 int t   = 1; 
    6363#endif 
     
    7070 setsockopt(fh, IPPROTO_IP, IP_TOS, &opt, sizeof(int)); 
    7171#endif 
    72 #ifdef TCP_NODELAY 
     72#if defined(TCP_NODELAY) && !defined(ROAR_TARGET_WIN32) 
    7373 setsockopt(fh, IPPROTO_TCP, TCP_NODELAY, &t, sizeof(int)); 
    7474#endif 
     
    476476#ifdef ROAR_HAVE_IPX 
    477477#define _NEED_OBJ 
    478  int i; 
    479478 int ret; 
     479#endif 
     480#ifdef ROAR_HAVE_IPX 
     481 unsigned int ipx_port; 
    480482#endif 
    481483#ifdef ROAR_HAVE_UNIX 
     
    503505#endif 
    504506 //unsigned int host_div = 0; 
     507#ifdef ROAR_TARGET_WIN32 
     508 int PASCAL (*mode_func)(SOCKET,const struct sockaddr*,int) = connect; // default is to connect 
     509#else 
    505510 int (*mode_func)(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen) = connect; // default is to connect 
     511#endif 
    506512#ifdef ROAR_HAVE_LIBDNET 
    507513#define _NEED_OBJ 
     
    649655  obj[0] = 0; 
    650656 
    651   if ( (ret = sscanf(host, "%8x.%12s(%x)", &socket_addr.ipx.sipx_network, obj, 
    652                                (unsigned int *)&socket_addr.ipx.sipx_port)) < 2 ) { 
    653    return -1; 
     657  if ( (ret = sscanf(host, "%8x.%12s(%x)", &socket_addr.ipx.sipx_network, obj, &ipx_port)) < 2 ) { 
     658   return -1; 
     659   socket_addr.ipx.sipx_port = ipx_port; 
    654660  } else if ( ret == 2 ) { 
    655661   socket_addr.ipx.sipx_port = port; // Network Byte Order? 
Note: See TracChangeset for help on using the changeset viewer.