aboutsummaryrefslogtreecommitdiff
path: root/streamin13~.c
diff options
context:
space:
mode:
authorDaniel Heckenberg <dheck@users.sourceforge.net>2003-03-09 11:10:53 +0000
committerDaniel Heckenberg <dheck@users.sourceforge.net>2003-03-09 11:10:53 +0000
commita2d37998c5ea1c5712cb15d9d9ad885371ee4b5d (patch)
tree989e6f7306ad5beaf44756c0c45cbade9957805d /streamin13~.c
parent23da6252985418ada3083303f3847817a23044fb (diff)
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
Diffstat (limited to 'streamin13~.c')
-rw-r--r--streamin13~.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/streamin13~.c b/streamin13~.c
index 41422ee..f827694 100644
--- a/streamin13~.c
+++ b/streamin13~.c
@@ -14,7 +14,7 @@
#include <unistd.h>
#define SOCKET_ERROR -1
#else
-#include <winsock.h>
+#include <winsock2.h>
#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);
}