fat: Greatly simplify and clean up dosfs_get_file_map().
[haiku.git] / src / build / libroot / byteorder.cpp
blobfdcbf328aee0a50040e8443736d9cf8684a3b5c4
2 #ifdef BUILDING_FS_SHELL
3 # include "compat.h"
4 #else
5 # include <BeOSBuildCompatibility.h>
6 #endif
8 #include <ByteOrder.h>
10 uint16
11 __swap_int16(uint16 value)
13 return (value >> 8) | (value << 8);
16 uint32
17 __swap_int32(uint32 value)
19 return (value >> 24) | ((value & 0xff0000) >> 8) | ((value & 0xff00) << 8)
20 | (value << 24);
23 uint64
24 __swap_int64(uint64 value)
26 return uint64(__swap_int32(uint32(value >> 32)))
27 | (uint64(__swap_int32(uint32(value))) << 32);