diff options
Diffstat (limited to 'dumpOSC.c')
-rw-r--r-- | dumpOSC.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -156,6 +156,12 @@ static int unixinitudp(int chan); #endif
+/* 32 bit "pointer cast" union */
+typedef union {
+ float f;
+ long i;
+} ls_pcast32;
+
static int initudp(int chan);
static void closeudp(int sockfd);
@@ -810,12 +816,12 @@ static void dumpOSC_PrintTypeTaggedArgs(t_dumpOSC *x, void *v, int n) { break;
case 'f': {
- int i = ntohl(*((int *) p));
- t_float *floatp = ((t_float *) (&i));
+ long i = ntohl(*((long *) p));
+ ls_pcast32 *pc = (ls_pcast32 *)(&i);
#ifdef DEBUG
- post("float: %f", *floatp);
+ post("float: %f", (*pc).f);
#endif
- SETFLOAT(mya+myargc,*floatp);
+ SETFLOAT(mya+myargc, (*pc).f);
myargc++;
p += 4;
|