doom

a minimalistic implementation of doom
git clone git://ssnf.xyz/doom
Log | Files | Refs

m_swap.c (252B)


      1 #include "m_swap.h"
      2 
      3 #ifndef __BIG_ENDIAN__
      4 
      5 unsigned short
      6 SwapSHORT(unsigned short x)
      7 {
      8     return (x>>8) | (x<<8);
      9 }
     10 
     11 unsigned long
     12 SwapLONG( unsigned long x)
     13 {
     14     return
     15 	(x >> 24)
     16 	| ((x>>8) & 0xff00)
     17 	| ((x<<8) & 0xff0000)
     18 	| (x<<24);
     19 }
     20 
     21 #endif