diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-27 19:48:17 +0300 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-27 19:48:17 +0300 |
commit | 10d0d4eec7e3a292917f43f72afae20341d9ba11 (patch) | |
tree | eb2f62d0756ae38bde76d61c15b9f3ddd3c41941 /util-linux/fdisk.c | |
parent | 3ece72dc3f95d195924c760f9ee5059e35908564 (diff) |
byteswap ops had extra mask ops - removed
Diffstat (limited to 'util-linux/fdisk.c')
-rw-r--r-- | util-linux/fdisk.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c index 74c7710da..07dac8bad 100644 --- a/util-linux/fdisk.c +++ b/util-linux/fdisk.c @@ -379,19 +379,19 @@ STATIC_OSF void xbsd_print_disklabel(int); #define SGI_XVM 0x0d #define SGI_ENTIRE_DISK SGI_VOLUME #if defined(CONFIG_FEATURE_SGI_LABEL) || defined(CONFIG_FEATURE_SUN_LABEL) -static unsigned short -__swap16(unsigned short x) +static uint16_t +__swap16(uint16_t x) { - return (((uint16_t)(x) & 0xFF) << 8) | (((uint16_t)(x) & 0xFF00) >> 8); + return (x << 8) | (x >> 8); } static uint32_t __swap32(uint32_t x) { - return (((x & 0xFF) << 24) | - ((x & 0xFF00) << 8) | - ((x & 0xFF0000) >> 8) | - ((x & 0xFF000000) >> 24)); + return (x << 24) | + ((x & 0xFF00) << 8) | + ((x & 0xFF0000) >> 8) | + (x >> 24); } #endif |