Ok I realized it was specifying the struct in the union, which isnt ansi .. I fixed it via these changes.. At the top of huffquad and huffpair union put
unsigned short data;
then the macros become
# define V(v, w, x, y, hlen) { (unsigned short)((y << 7) | (x << 6) | (w << 5) | (v << 4) | (hlen << 1) | 1 ) } # define PTR(offs, bits) { (unsigned short)((offs << 4) | (bits << 1)) }
and
#define V(x, y, hlen) { (unsigned short)((y << 8) | (x << 4) | (hlen << 1) | 1 ) } #define PTR(offs, bits) { (unsigned short)((offs << 4) | (bits << 1)) }
simple enuff cheers Brett
-----Original Message----- From: mad-dev-admin@lists.mars.org
[mailto:mad-dev-admin@lists.mars.org]
On Behalf Of Brett Paterson Sent: Monday, 15 October 2001 7:43 PM To: mad-dev@lists.mars.org Subject: RE: [mad-dev] hang in huff code
<Slaps head>.. oh yeah I forgot about that! I did chop that out to
make
it compile but I guess I busted it in the process.
I did this.. //# define PTR(offs, bits) { ptr: { 0, bits, offs } } # define PTR(offs, bits) { { 0, bits, offs } }
which I guess is obviously wrong .. I havent seen that extension
before,
would you have an alternative macro that could do whatever it is supposed to do?
Brett
-----Original Message----- From: mad-dev-admin@lists.mars.org
[mailto:mad-dev-admin@lists.mars.org]
On Behalf Of Rob Leslie Sent: Monday, 15 October 2001 7:31 PM To: mad-dev@lists.mars.org Subject: Re: [mad-dev] hang in huff code
Brett Paterson wrote:
It decodes the header correctly, then when decoding the data in
the
(stereo mp3) file, it goes into an infinite loop inside mad_frame_decode.
Maybe I didnt set the project up properly, all I did was create a
new
project in devstudio, add all the mad files, then defined FPM_DEFAULT,OPT_SPEED in my project. Is there anything else I should be doing?
The problem is in huffman.c. Currently, this uses a GNU extension to initialize a union member other than the first. I'm surprised you
were
able to compile this file without making changes to it.
I'll be releasing a new version of MAD soon which makes the code
more
portable to non-GCC compilers. It will also include MSVC++ project files.
Until then, you'll need to find a workaround for the union
initializations
in huffman.c.
Cheers, -rob