aboutsummaryrefslogtreecommitdiff
path: root/net/tcpsend.c
diff options
context:
space:
mode:
authorMartin Peach <mrpeach@users.sourceforge.net>2008-01-21 14:09:14 +0000
committerMartin Peach <mrpeach@users.sourceforge.net>2008-01-21 14:09:14 +0000
commitcd51834534c5f505faf46499b5928c145d2b9ceb (patch)
treef305a0124d50b6c858c3c13aa1c994c16e90072d /net/tcpsend.c
parent1495d42a69dfdf567e17ff942efb3632ab3b91c4 (diff)
Applied W.Ritsch's patch to fix sign error with input > 127
svn path=/trunk/externals/mrpeach/; revision=9154
Diffstat (limited to 'net/tcpsend.c')
-rwxr-xr-xnet/tcpsend.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/net/tcpsend.c b/net/tcpsend.c
index 67d2c1b..fcfb3f5 100755
--- a/net/tcpsend.c
+++ b/net/tcpsend.c
@@ -113,20 +113,21 @@ static void tcpsend_disconnect(t_tcpsend *x)
static void tcpsend_send(t_tcpsend *x, t_symbol *s, int argc, t_atom *argv)
{
#define BYTE_BUF_LEN 65536 // arbitrary maximum similar to max IP packet size
- static char byte_buf[BYTE_BUF_LEN];
- int i, j, d;
- char c;
- float f, e;
- char *bp;
- int length, sent;
- int result;
- static double lastwarntime;
- static double pleasewarn;
- double timebefore;
- double timeafter;
- int late;
- char fpath[FILENAME_MAX];
- FILE *fptr;
+ static char byte_buf[BYTE_BUF_LEN];
+ int i, j;
+ unsigned int d;
+ unsigned char c;
+ float f, e;
+ char *bp;
+ int length, sent;
+ int result;
+ static double lastwarntime;
+ static double pleasewarn;
+ double timebefore;
+ double timeafter;
+ int late;
+ char fpath[FILENAME_MAX];
+ FILE *fptr;
#ifdef DEBUG
post("s: %s", s->s_name);
@@ -137,7 +138,7 @@ static void tcpsend_send(t_tcpsend *x, t_symbol *s, int argc, t_atom *argv)
if (argv[i].a_type == A_FLOAT)
{
f = argv[i].a_w.w_float;
- d = (int)f;
+ d = (unsigned int)f;
e = f - d;
if (e != 0)
{