[PATCH] Fix constant folding and poor optimization in byte swapping code

2007-02-16 Thread Trent Piepho
Constant folding does not work for the swabXX() byte swapping functions, and the C versions optimize poorly. Attempting to initialize a global variable to swab16(0x1234) or put something like "case swab32(42):" in a switch statement will not compile. It can work, swab.h just isn't doing it

[PATCH] Fix constant folding and poor optimization in byte swapping code

2007-02-16 Thread Trent Piepho
Constant folding does not work for the swabXX() byte swapping functions, and the C versions optimize poorly. Attempting to initialize a global variable to swab16(0x1234) or put something like case swab32(42): in a switch statement will not compile. It can work, swab.h just isn't doing it