Mercurial > hg > audiodb
changeset 119:6062e6f1dcc1 endian-neutral
Towards endian-neutrality, part 4.
A little bit of defensive coding around the byte_swap() Do What I Mean
functionality: if the maximum acceptable dimensionality exceeds 16 bits,
then the byte swapping is no longer ambiguous.
author | mas01cr |
---|---|
date | Fri, 12 Oct 2007 12:58:30 +0000 |
parents | c0789661f232 |
children | |
files | audioDB.cpp |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/audioDB.cpp Fri Oct 12 11:52:28 2007 +0000 +++ b/audioDB.cpp Fri Oct 12 12:58:30 2007 +0000 @@ -10,6 +10,10 @@ } #endif +#if (O2_MAXDIM > 0xffff) +#error "fix byte_swap DWIM logic" +#endif + uint32_t uint32_byte_swap(uint32_t arg) { return (((arg & 0xff000000) >> 24) | ((arg & 0xff0000) >> 8) |