From ec9960cb49988a010b76b537f7fd4f7391a208a5 Mon Sep 17 00:00:00 2001 From: Martin Peach Date: Thu, 16 Dec 2010 05:35:47 +0000 Subject: Fixed problems when bundle depth is exceeded. Placed global defines in packingOSC.h. Thanks to zmoelnig for pointing this out in tracker id 3136648. svn path=/trunk/externals/mrpeach/; revision=14663 --- osc/packOSC.c | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) (limited to 'osc/packOSC.c') diff --git a/osc/packOSC.c b/osc/packOSC.c index b2d1086..728b83a 100644 --- a/osc/packOSC.c +++ b/osc/packOSC.c @@ -33,22 +33,8 @@ The OSC webpage is http://cnmat.cnmat.berkeley.edu/OpenSoundControl #define SC_BUFFER_SIZE 64000 -#include "m_pd.h" -#include -#include -#include +#include "packingOSC.h" -#ifdef _WIN32 -#include -#include -#else -#include -#include -#endif - -#ifdef unix -#include -#endif /* This is from OSC-client.h :*/ /* @@ -92,14 +78,6 @@ The OSC webpage is http://cnmat.cnmat.berkeley.edu/OpenSoundControl to dereference a pointer to an 8 byte int that's not 8-byte aligned. */ -/* You may have to redefine this typedef if ints on your system - aren't 4 bytes. */ -typedef unsigned int uint4; -typedef struct -{ - uint4 seconds; - uint4 fraction; -} OSCTimeTag; /* Return the time tag 0x0000000000000001, indicating to the receiving device that it should process the message immediately. */ @@ -321,8 +299,8 @@ static void packOSC_openbundle(t_packOSC *x) result = OSC_openBundle(x->x_oscbuf, OSCTT_Immediately()); else result = OSC_openBundle(x->x_oscbuf, OSCTT_CurrentTimePlusOffset((uint4)x->x_timeTagOffset)); - if (result != 0) return; - x->x_bundle = 1; + if (result != 0) x->x_bundle = 0; + else x->x_bundle = 1; outlet_float(x->x_bdpthout, (float)x->x_oscbuf->bundleDepth); } @@ -1074,7 +1052,7 @@ static int OSC_closeBundle(OSCbuf *buf) if (buf->bundleDepth == 0) { /* This handles EMPTY, ONE_MSG, ARGS, and DONE */ - post("packOSC: Can't close bundle; no bundle is open!"); + post("packOSC: Can't close bundle: no bundle is open!"); return 5; } -- cgit v1.2.1