Update of /cvsroot/pure-data/externals/mrpeach/osc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29694
Modified Files:
packOSC.c
Log Message:
Modified OSC_writeFloatArg for strict aliasing
Index: packOSC.c
===================================================================
RCS file: /cvsroot/pure-data/externals/mrpeach/osc/packOSC.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** packOSC.c 1 Sep 2007 16:39:26 -0000 1.9
--- packOSC.c 20 Oct 2007 04:45:43 -0000 1.10
***************
*** 1120,1124 ****
static int OSC_writeFloatArg(OSCbuf *buf, float arg)
{
! int4byte *intp;
if(OSC_CheckOverflow(buf, 4))return 1;
--- 1120,1129 ----
static int OSC_writeFloatArg(OSCbuf *buf, float arg)
{
! union intfloat32
! {
! int i;
! float f;
! };
! union intfloat32 if32;
if(OSC_CheckOverflow(buf, 4))return 1;
***************
*** 1127,1132 ****
/* Pretend arg is a long int so we can use htonl() */
! intp = ((int4byte *) &arg);
! *((int4byte *) buf->bufptr) = htonl(*intp);
buf->bufptr += 4;
--- 1132,1138 ----
/* Pretend arg is a long int so we can use htonl() */
! if32.f = arg;
!
! *((int4byte *) buf->bufptr) = htonl(if32.i);
buf->bufptr += 4;