Changeset 15282 for trunk/FACT++/dim/src/tcpip.c
- Timestamp:
- 04/08/13 15:07:07 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/dim/src/tcpip.c
r13995 r15282 290 290 if(DIM_IO_path[0] == -1) 291 291 { 292 if( (DIM_IO_path[0] = socket(AF_INET, SOCK_STREAM, 0)) == -1 )292 if( (DIM_IO_path[0] = (int)socket(AF_INET, SOCK_STREAM, 0)) == -1 ) 293 293 { 294 294 perror("socket"); … … 369 369 closesock(DIM_IO_path[0]); 370 370 DIM_IO_path[0] = -1; 371 if( (DIM_IO_path[0] = socket(AF_INET, SOCK_STREAM, 0)) == -1 )371 if( (DIM_IO_path[0] = (int)socket(AF_INET, SOCK_STREAM, 0)) == -1 ) 372 372 { 373 373 perror("socket"); … … 568 568 static int get_bytes_to_read(int conn_id) 569 569 { 570 int i, ret, count ;570 int i, ret, count = 0; 571 571 572 572 for(i = 0; i < 3; i++) … … 616 616 would this be better? not sure afterwards... 617 617 nbytes = (size < count) ? size : count; 618 if( (len = readsock(Net_conns[conn_id].channel, p, nbytes, 0)) <= 0 )619 */ 620 if( (len = readsock(Net_conns[conn_id].channel, p,size, 0)) <= 0 )618 if( (len = readsock(Net_conns[conn_id].channel, p, (size_t)nbytes, 0)) <= 0 ) 619 */ 620 if( (len = (int)readsock(Net_conns[conn_id].channel, p, (size_t)size, 0)) <= 0 ) 621 621 { /* Connection closed by other side. */ 622 622 Net_conns[conn_id].read_rout( conn_id, -1, 0 ); … … 654 654 655 655 othersize = sizeof(other); 656 memset( (char *) &other, 0, othersize );657 Net_conns[conn_id].mbx_channel = accept( Net_conns[conn_id].channel,656 memset( (char *) &other, 0, (size_t)othersize ); 657 Net_conns[conn_id].mbx_channel = (int)accept( Net_conns[conn_id].channel, 658 658 (struct sockaddr*)&other, (unsigned int *)&othersize ); 659 659 if( Net_conns[conn_id].mbx_channel < 0 ) … … 842 842 int ret; 843 843 844 ptr = (unsigned char *)node+ strlen(node)+1;844 ptr = (unsigned char *)node+(int)strlen(node)+1; 845 845 ipaddr[0] = *ptr++; 846 846 ipaddr[1] = *ptr++; … … 900 900 { 901 901 sscanf(node,"%d.%d.%d.%d",&a, &b, &c, &d); 902 ipaddr[0] = a;903 ipaddr[1] = b;904 ipaddr[2] = c;905 ipaddr[3] = d;902 ipaddr[0] = (unsigned char)a; 903 ipaddr[1] = (unsigned char)b; 904 ipaddr[2] = (unsigned char)c; 905 ipaddr[3] = (unsigned char)d; 906 906 host_number = 1; 907 907 #ifndef VxWorks … … 928 928 host_number = 1; 929 929 /* 930 ptr = (unsigned char *)node+ strlen(node)+1;930 ptr = (unsigned char *)node+(int)strlen(node)+1; 931 931 ipaddr[0] = *ptr++; 932 932 ipaddr[1] = *ptr++; … … 961 961 #endif 962 962 963 if( (path = socket(AF_INET, SOCK_STREAM, 0)) == -1 )963 if( (path = (int)socket(AF_INET, SOCK_STREAM, 0)) == -1 ) 964 964 { 965 965 perror("socket"); … … 1053 1053 1054 1054 dim_tcpip_init(0); 1055 if( (path = socket(AF_INET, SOCK_STREAM, 0)) == -1 )1055 if( (path = (int)socket(AF_INET, SOCK_STREAM, 0)) == -1 ) 1056 1056 { 1057 1057 return(0); … … 1257 1257 int wrote; 1258 1258 1259 wrote = writesock( Net_conns[conn_id].channel, buffer,size, 0 );1259 wrote = (int)writesock( Net_conns[conn_id].channel, buffer, (size_t)size, 0 ); 1260 1260 if( wrote == -1 ) { 1261 1261 /* … … 1306 1306 1307 1307 set_non_blocking(Net_conns[conn_id].channel); 1308 wrote = writesock( Net_conns[conn_id].channel, buffer,size, 0 );1308 wrote = (int)writesock( Net_conns[conn_id].channel, buffer, (size_t)size, 0 ); 1309 1309 #ifndef WIN32 1310 1310 ret = errno; … … 1332 1332 if(selret > 0) 1333 1333 { 1334 wrote = writesock( Net_conns[conn_id].channel, buffer,size, 0 );1334 wrote = (int)writesock( Net_conns[conn_id].channel, buffer, (size_t)size, 0 ); 1335 1335 if( wrote == -1 ) 1336 1336 {
Note:
See TracChangeset
for help on using the changeset viewer.