From a2d37998c5ea1c5712cb15d9d9ad885371ee4b5d Mon Sep 17 00:00:00 2001 From: Daniel Heckenberg Date: Sun, 9 Mar 2003 11:10:53 +0000 Subject: Minor changes for compilation using Visual C++ 6.0 (SP3) under Windows ncluding: - no array declaration with variable size - fixed signed/unsigned comparison warnings svn path=/trunk/externals/ext13/; revision=460 --- streamin13~.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'streamin13~.c') diff --git a/streamin13~.c b/streamin13~.c index 41422ee..f827694 100644 --- a/streamin13~.c +++ b/streamin13~.c @@ -14,7 +14,7 @@ #include #define SOCKET_ERROR -1 #else -#include +#include #endif @@ -92,8 +92,11 @@ static int streamin13_listen(t_streamin13 *x,int portno) int sockfd; static int on = 1; - - shutdown(x->x_connectsocket,SHUT_RDWR); +#ifndef NT + shutdown(x->x_connectsocket,SHUT_RDWR); +#else + shutdown(x->x_connectsocket,SD_BOTH); +#endif sys_closesocket(x->x_connectsocket); sockfd = socket(AF_INET, SOCK_DGRAM, 0); @@ -132,7 +135,7 @@ static int streamin13_listen(t_streamin13 *x,int portno) streamin13_tempbuf(x,64); } - + return(0); } static void *streamin13_new(t_floatarg fportno ,t_floatarg xn) @@ -166,13 +169,18 @@ static t_int *streamin13_perform(t_int *w) t_streamin13* x = (t_streamin13*) (w[1]); int offset = 3; int i,j; - t_float *out[x->x_n]; int n = (int)(w[2]); struct timeval timeout; int packsize; int ret; int length; short* cbuf; + +#ifndef NT + t_float *out[x->x_n]; +#else + t_float **out = (t_float**) malloc(x->x_n * sizeof(t_float*)); +#endif #ifndef NT fd_set fdset; @@ -203,7 +211,7 @@ static t_int *streamin13_perform(t_int *w) } } } - + free(out); return (w+offset+1+i); } else { x->x_ndone++; @@ -265,7 +273,10 @@ static t_int *streamin13_perform(t_int *w) default: break; } - } + } +#ifdef NT + free(out); +#endif return (w+offset+1+i); } -- cgit v1.2.1