|
From: Martin H. <err...@mp...> - 2005-08-06 16:47:31
|
Steve, sorry for for finding another issue so soon! It never rains,
and then it floods...
testlo fails on big endian machines with:
FAILED types[9] == 'c' && argv[9]->c == 'X' at testlo.c:578
Some debugging showed that:
argv[9]->c = ''
argv[9]->i = 88
Root cause of this lo_message_add_char(), which does an implicit
cast to an int.
The patch below removes this cast. With it testlo runs without errors
on machines of any endianness.
I have not tried sending messages between machines with different
endian types yet, but will probably get round to that soon.
--
Martin
---------------------------------------------------------------------------
Index: liblo-0.18/src/message.c
===================================================================
--- liblo-0.18.orig/src/message.c 2005-03-02 19:15:47.000000000 +0000
+++ liblo-0.18/src/message.c 2005-08-06 17:25:46.132357793 +0100
@@ -158,7 +158,7 @@
lo_pcast32 b;
int32_t *nptr = lo_message_add_data(m, sizeof(int32_t));
- b.i = a;
+ b.c = a;
lo_message_add_typechar(m, LO_CHAR);
*nptr = lo_htoo32(b.nl);
@@ -420,7 +420,7 @@
break;
case LO_CHAR:
- printf("'%c'", (char)val32.i);
+ printf("'%c'", (char)val32.c);
break;
case LO_MIDI:
Index: liblo-0.18/src/lo_types_internal.h
===================================================================
--- liblo-0.18.orig/src/lo_types_internal.h 2005-03-02 19:15:47.000000000 +0000
+++ liblo-0.18/src/lo_types_internal.h 2005-08-06 17:24:12.235506802 +0100
@@ -84,6 +84,7 @@
typedef union {
int32_t i;
float f;
+ char c;
uint32_t nl;
} lo_pcast32;
|