Package: gnusound
Severity: important
Tags: patch
Hi,
gnusound currently fails to build on m68k and the basic problem is that
float32_to_le() incorrectly attempts to convert a big endian float to a
little endian float. I guess on other big endian ports the value is
silently converted to an integer, but the result is equally wrong.
I attached a patch which converts the float value correctly and lets
m68k build gnusound successfully.
bye, Roman
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: m68k
Shell: /bin/sh linked to /bin/dash
Kernel: Linux 2.6.18-m68k-amiga
Locale: LANG=de_DE.UTF-8, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
diff -ur gnusound-0.7.4.org/src/emergency.c gnusound-0.7.4/src/emergency.c
--- gnusound-0.7.4.org/src/emergency.c 2005-06-19 17:44:26.000000000 +0200
+++ gnusound-0.7.4/src/emergency.c 2006-10-17 17:51:50.000000000 +0200
@@ -449,9 +449,16 @@
#if __BYTE_ORDER == __LITTLE_ENDIAN
#elif __BYTE_ORDER == __BIG_ENDIAN
int i;
+ union {
+ float f;
+ int32_t i;
+ } u;
- for(i = 0; i < count; i++)
- buf[i] = bswap_32(buf[i]);
+ for(i = 0; i < count; i++) {
+ u.f = buf[i];
+ u.i = bswap_32(u.i);
+ buf[i] = u.f;
+ }
#else
# error "Unsupported endian"
#endif