1 short swapshort(short x)
2 { return (signed short) (((unsigned short) x)>>8)|(((unsigned short) x)<<8);
6 #define ulx ((unsigned long) x)
7 return (signed long) (((ulx & 0xFF000000)>>24)|((ulx &0xFF0000)>>8)|((ulx & 0xFF00)<<8)|((ulx & 0xFF)<<24));
9 union doubleconv {double d;
12 double swapdouble(double x)
13 { union doubleconv tmp1,tmp2;
16 for (i=0,j=7;i<8;tmp2.b[j--]=tmp1.b[i++]);