# HG changeset patch # User mas01cr # Date 1192193910 0 # Node ID 6062e6f1dcc1ec546e7e27652802d1edc8aa945a # Parent c0789661f2328c35a12c318168d893843e6d0c67 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. diff -r c0789661f232 -r 6062e6f1dcc1 audioDB.cpp --- 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) |