aboutsummaryrefslogtreecommitdiff
path: root/dumpOSC.c
diff options
context:
space:
mode:
Diffstat (limited to 'dumpOSC.c')
-rw-r--r--dumpOSC.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/dumpOSC.c b/dumpOSC.c
index 6fc4da6..cf90da5 100644
--- a/dumpOSC.c
+++ b/dumpOSC.c
@@ -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;