Add swapin() function, and SWAPIN macro that calls it, to do byte swapping