diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-27 16:48:17 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-27 16:48:17 +0000 |
commit | 10d0d4eec7e3a292917f43f72afae20341d9ba11 (patch) | |
tree | eb2f62d0756ae38bde76d61c15b9f3ddd3c41941 /util-linux | |
parent | 3ece72dc3f95d195924c760f9ee5059e35908564 (diff) | |
download | busybox-w32-10d0d4eec7e3a292917f43f72afae20341d9ba11.tar.gz busybox-w32-10d0d4eec7e3a292917f43f72afae20341d9ba11.tar.bz2 busybox-w32-10d0d4eec7e3a292917f43f72afae20341d9ba11.zip |
byteswap ops had extra mask ops - removed
Diffstat (limited to 'util-linux')
-rw-r--r-- | util-linux/fdisk.c | 14 | ||||
-rw-r--r-- | util-linux/fdisk_sgi.c | 6 | ||||
-rw-r--r-- | util-linux/fdisk_sun.c | 6 |
3 files changed, 11 insertions, 15 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); | |||
379 | #define SGI_XVM 0x0d | 379 | #define SGI_XVM 0x0d |
380 | #define SGI_ENTIRE_DISK SGI_VOLUME | 380 | #define SGI_ENTIRE_DISK SGI_VOLUME |
381 | #if defined(CONFIG_FEATURE_SGI_LABEL) || defined(CONFIG_FEATURE_SUN_LABEL) | 381 | #if defined(CONFIG_FEATURE_SGI_LABEL) || defined(CONFIG_FEATURE_SUN_LABEL) |
382 | static unsigned short | 382 | static uint16_t |
383 | __swap16(unsigned short x) | 383 | __swap16(uint16_t x) |
384 | { | 384 | { |
385 | return (((uint16_t)(x) & 0xFF) << 8) | (((uint16_t)(x) & 0xFF00) >> 8); | 385 | return (x << 8) | (x >> 8); |
386 | } | 386 | } |
387 | 387 | ||
388 | static uint32_t | 388 | static uint32_t |
389 | __swap32(uint32_t x) | 389 | __swap32(uint32_t x) |
390 | { | 390 | { |
391 | return (((x & 0xFF) << 24) | | 391 | return (x << 24) | |
392 | ((x & 0xFF00) << 8) | | 392 | ((x & 0xFF00) << 8) | |
393 | ((x & 0xFF0000) >> 8) | | 393 | ((x & 0xFF0000) >> 8) | |
394 | ((x & 0xFF000000) >> 24)); | 394 | (x >> 24); |
395 | } | 395 | } |
396 | #endif | 396 | #endif |
397 | 397 | ||
diff --git a/util-linux/fdisk_sgi.c b/util-linux/fdisk_sgi.c index 9d444c0be..548a70bdc 100644 --- a/util-linux/fdisk_sgi.c +++ b/util-linux/fdisk_sgi.c | |||
@@ -84,10 +84,8 @@ typedef struct { | |||
84 | #define SGI_INFO_MAGIC 0x00072959 | 84 | #define SGI_INFO_MAGIC 0x00072959 |
85 | #define SGI_INFO_MAGIC_SWAPPED 0x59290700 | 85 | #define SGI_INFO_MAGIC_SWAPPED 0x59290700 |
86 | 86 | ||
87 | #define SGI_SSWAP16(x) (sgi_other_endian ? __swap16(x) \ | 87 | #define SGI_SSWAP16(x) (sgi_other_endian ? __swap16(x) : (uint16_t)(x)) |
88 | : (uint16_t)(x)) | 88 | #define SGI_SSWAP32(x) (sgi_other_endian ? __swap32(x) : (uint32_t)(x)) |
89 | #define SGI_SSWAP32(x) (sgi_other_endian ? __swap32(x) \ | ||
90 | : (uint32_t)(x)) | ||
91 | 89 | ||
92 | #define sgilabel ((sgi_partition *)MBRbuffer) | 90 | #define sgilabel ((sgi_partition *)MBRbuffer) |
93 | #define sgiparam (sgilabel->devparam) | 91 | #define sgiparam (sgilabel->devparam) |
diff --git a/util-linux/fdisk_sun.c b/util-linux/fdisk_sun.c index 6973fbf30..1e8f2e525 100644 --- a/util-linux/fdisk_sun.c +++ b/util-linux/fdisk_sun.c | |||
@@ -2,10 +2,8 @@ | |||
2 | 2 | ||
3 | #define SUN_LABEL_MAGIC 0xDABE | 3 | #define SUN_LABEL_MAGIC 0xDABE |
4 | #define SUN_LABEL_MAGIC_SWAPPED 0xBEDA | 4 | #define SUN_LABEL_MAGIC_SWAPPED 0xBEDA |
5 | #define SUN_SSWAP16(x) (sun_other_endian ? __swap16(x) \ | 5 | #define SUN_SSWAP16(x) (sun_other_endian ? __swap16(x) : (uint16_t)(x)) |
6 | : (uint16_t)(x)) | 6 | #define SUN_SSWAP32(x) (sun_other_endian ? __swap32(x) : (uint32_t)(x)) |
7 | #define SUN_SSWAP32(x) (sun_other_endian ? __swap32(x) \ | ||
8 | : (uint32_t)(x)) | ||
9 | 7 | ||
10 | /* Copied from linux/major.h */ | 8 | /* Copied from linux/major.h */ |
11 | #define FLOPPY_MAJOR 2 | 9 | #define FLOPPY_MAJOR 2 |