summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/libmad/huffman.c
Side-by-side diff
Diffstat (limited to 'core/multimedia/opieplayer/libmad/huffman.c') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/libmad/huffman.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/core/multimedia/opieplayer/libmad/huffman.c b/core/multimedia/opieplayer/libmad/huffman.c
index 5ea6547..684409e 100644
--- a/core/multimedia/opieplayer/libmad/huffman.c
+++ b/core/multimedia/opieplayer/libmad/huffman.c
@@ -2,3 +2,3 @@
* libmad - MPEG audio decoder library
- * Copyright (C) 2000-2001 Robert Leslie
+ * Copyright (C) 2000-2004 Underbit Technologies, Inc.
*
@@ -36,9 +36,15 @@
-# if defined(__GNUC__)
-# define PTR(offs, bits) { ptr: { 0, bits, offs } }
-# define V(v, w, x, y, hlen) { value: { 1, hlen, v, w, x, y } }
+# if defined(__GNUC__) || \
+ (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901)
+# define PTR(offs, bits) { .ptr = { 0, bits, offs } }
+# define V(v, w, x, y, hlen) { .value = { 1, hlen, v, w, x, y } }
# else
# define PTR(offs, bits) { { 0, bits, offs } }
-# define V(v, w, x, y, hlen) { { 1, hlen, (v << 0) | (w << 1) | \
- (x << 2) | (y << 3) } }
+# if defined(WORDS_BIGENDIAN)
+# define V(v, w, x, y, hlen) { { 1, hlen, (v << 11) | (w << 10) | \
+ (x << 9) | (y << 8) } }
+# else
+# define V(v, w, x, y, hlen) { { 1, hlen, (v << 0) | (w << 1) | \
+ (x << 2) | (y << 3) } }
+# endif
# endif
@@ -108,8 +114,13 @@ union huffquad const hufftabB[] = {
-# if defined(__GNUC__)
-# define PTR(offs, bits) { ptr: { 0, bits, offs } }
-# define V(x, y, hlen) { value: { 1, hlen, x, y } }
+# if defined(__GNUC__) || \
+ (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901)
+# define PTR(offs, bits) { .ptr = { 0, bits, offs } }
+# define V(x, y, hlen) { .value = { 1, hlen, x, y } }
# else
# define PTR(offs, bits) { { 0, bits, offs } }
-# define V(x, y, hlen) { { 1, hlen, (x << 0) | (y << 4) } }
+# if defined(WORDS_BIGENDIAN)
+# define V(x, y, hlen) { { 1, hlen, (x << 8) | (y << 4) } }
+# else
+# define V(x, y, hlen) { { 1, hlen, (x << 0) | (y << 4) } }
+# endif
# endif