Bug / typo in gri_wavfile.cc (gr_wavfile_source)

Hello All,

I think there is a typo / bug in gri_wavfile.cc that prevents it from
working properly with big-endian machines.

Please see patch below.

Index: gnuradio-core/src/lib/io/gri_wavfile.cc

— gnuradio-core/src/lib/io/gri_wavfile.cc (revision 8162)
+++ gnuradio-core/src/lib/io/gri_wavfile.cc (working copy)
@@ -71,7 +71,7 @@
static inline int16_t
host_to_wav(int16_t x)
{

  • return bswap_32(x);
  • return bswap_16(x);
    }

static inline uint32_t
@@ -89,7 +89,7 @@
static inline int16_t
wav_to_host(int16_t x)
{

  • return bswap_32(x);
  • return bswap_16(x);
    }

#else

Tim

On Wed, Apr 9, 2008 at 7:38 AM, Tim M. [email protected] wrote:

I think there is a typo / bug in gri_wavfile.cc that prevents it from
working properly with big-endian machines.

Good catch. We had noted the failure of the QA code on big-endian
machines but hadn’t had time to track it down.

Could you try editing
gnuradio-core/src/python/gnuradio/gr/qa_wavefile.py and remove the
leading ‘x’ from line 43? This will reenable the QA check (which
passes on little-endian machines.)


Johnathan C.
Corgan Enterprises LLC
http://corganenterprises.com/

On Wed, Apr 9, 2008 at 10:47 AM, Johnathan C. <
[email protected]> wrote:

leading ‘x’ from line 43? This will reenable the QA check (which
passes on little-endian machines.)

removed the x (xtest -> test)
QA check test passed

Tim M. wrote:

removed the x (xtest -> test)
QA check test passed

What is your processor/OS combination?

On Wed, Apr 9, 2008 at 8:23 AM, Tim M. [email protected] wrote:

removed the x (xtest → test)
QA check test passed

Fixed in trunk revision r8163.


Johnathan C.
Corgan Enterprises LLC
http://corganenterprises.com/

On Wed, Apr 9, 2008 at 11:20 AM, Johnathan C. <
[email protected]> wrote:

Tim M. wrote:

removed the x (xtest -> test)
QA check test passed

What is your processor/OS combination?

PS3 / Linux