Bug 91427 - endianness portability
Summary: endianness portability
Status: NEW
Alias: None
Product: libcanberra
Classification: Unclassified
Component: Unspecified (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Lennart Poettering
QA Contact:
Depends on:
Reported: 2015-07-22 11:18 UTC by Patrick Welche
Modified: 2015-07-22 11:18 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Description Patrick Welche 2015-07-22 11:18:16 UTC
I'm looking at this bit of code in src/oss.c:

        case CA_SAMPLE_S16RE:
                val = AFMT_S16_BE;
                val = AFMT_S16_LE;

To my untrained eye, using _BE in a little endian case and _LE in a big endian case seems odd. (Maybe add a comment to the code explaining why it should be that way around?)

The portability issue is the number of underscores in __LITTLE_ENDIAN. In configure.ac, you already have AC_C_BIGENDIAN, so why not test for WORDS_BIGENDIAN like you do in alsa.c instead?

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.