diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2013-05-15 09:36:40 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2013-05-15 09:36:40 +0200 |
commit | aa94130f744ae229e5392eb4e303a9805a9963fb (patch) | |
tree | 4be8e2ce2bc7f88e3748b956ae1fe0fb09cb6b06 | |
parent | 414db791d0dc79905e5afe20e503941b8f9778cc (diff) | |
download | busybox-w32-aa94130f744ae229e5392eb4e303a9805a9963fb.tar.gz busybox-w32-aa94130f744ae229e5392eb4e303a9805a9963fb.tar.bz2 busybox-w32-aa94130f744ae229e5392eb4e303a9805a9963fb.zip |
volume_id_internal.h: drop unoptimized byteswap routines
function old new delta
volume_id_probe_hfs_hfsplus 802 627 -175
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | util-linux/volume_id/volume_id_internal.h | 52 |
1 files changed, 16 insertions, 36 deletions
diff --git a/util-linux/volume_id/volume_id_internal.h b/util-linux/volume_id/volume_id_internal.h index 3f02bd50d..d3c6a6101 100644 --- a/util-linux/volume_id/volume_id_internal.h +++ b/util-linux/volume_id/volume_id_internal.h | |||
@@ -96,44 +96,24 @@ void FAST_FUNC free_volume_id(struct volume_id *id); | |||
96 | /* size of seek buffer, FAT cluster is 32k max */ | 96 | /* size of seek buffer, FAT cluster is 32k max */ |
97 | #define SEEK_BUFFER_SIZE 0x10000 | 97 | #define SEEK_BUFFER_SIZE 0x10000 |
98 | 98 | ||
99 | #define bswap16(x) (uint16_t) ( \ | ||
100 | (((uint16_t)(x) & 0x00ffu) << 8) | \ | ||
101 | (((uint16_t)(x) & 0xff00u) >> 8)) | ||
102 | |||
103 | #define bswap32(x) (uint32_t) ( \ | ||
104 | (((uint32_t)(x) & 0xff000000u) >> 24) | \ | ||
105 | (((uint32_t)(x) & 0x00ff0000u) >> 8) | \ | ||
106 | (((uint32_t)(x) & 0x0000ff00u) << 8) | \ | ||
107 | (((uint32_t)(x) & 0x000000ffu) << 24)) | ||
108 | |||
109 | #define bswap64(x) (uint64_t) ( \ | ||
110 | (((uint64_t)(x) & 0xff00000000000000ull) >> 56) | \ | ||
111 | (((uint64_t)(x) & 0x00ff000000000000ull) >> 40) | \ | ||
112 | (((uint64_t)(x) & 0x0000ff0000000000ull) >> 24) | \ | ||
113 | (((uint64_t)(x) & 0x000000ff00000000ull) >> 8) | \ | ||
114 | (((uint64_t)(x) & 0x00000000ff000000ull) << 8) | \ | ||
115 | (((uint64_t)(x) & 0x0000000000ff0000ull) << 24) | \ | ||
116 | (((uint64_t)(x) & 0x000000000000ff00ull) << 40) | \ | ||
117 | (((uint64_t)(x) & 0x00000000000000ffull) << 56)) | ||
118 | |||
119 | #if BB_LITTLE_ENDIAN | 99 | #if BB_LITTLE_ENDIAN |
120 | #define le16_to_cpu(x) (x) | 100 | # define le16_to_cpu(x) (uint16_t)(x) |
121 | #define le32_to_cpu(x) (x) | 101 | # define le32_to_cpu(x) (uint32_t)(x) |
122 | #define le64_to_cpu(x) (x) | 102 | # define le64_to_cpu(x) (uint64_t)(x) |
123 | #define be16_to_cpu(x) bswap16(x) | 103 | # define be16_to_cpu(x) (uint16_t)(bswap_16(x)) |
124 | #define be32_to_cpu(x) bswap32(x) | 104 | # define be32_to_cpu(x) (uint32_t)(bswap_32(x)) |
125 | #define cpu_to_le16(x) (x) | 105 | # define cpu_to_le16(x) (uint16_t)(x) |
126 | #define cpu_to_le32(x) (x) | 106 | # define cpu_to_le32(x) (uint32_t)(x) |
127 | #define cpu_to_be32(x) bswap32(x) | 107 | # define cpu_to_be32(x) (uint32_t)(bswap_32(x)) |
128 | #else | 108 | #else |
129 | #define le16_to_cpu(x) bswap16(x) | 109 | # define le16_to_cpu(x) (uint16_t)(bswap_16(x)) |
130 | #define le32_to_cpu(x) bswap32(x) | 110 | # define le32_to_cpu(x) (uint32_t)(bswap_32(x)) |
131 | #define le64_to_cpu(x) bswap64(x) | 111 | # define le64_to_cpu(x) (uint64_t)(bb_bswap_64(x)) |
132 | #define be16_to_cpu(x) (x) | 112 | # define be16_to_cpu(x) (uint16_t)(x) |
133 | #define be32_to_cpu(x) (x) | 113 | # define be32_to_cpu(x) (uint32_t)(x) |
134 | #define cpu_to_le16(x) bswap16(x) | 114 | # define cpu_to_le16(x) (uint16_t)(bswap_16(x)) |
135 | #define cpu_to_le32(x) bswap32(x) | 115 | # define cpu_to_le32(x) (uint32_t)(bswap_32(x)) |
136 | #define cpu_to_be32(x) (x) | 116 | # define cpu_to_be32(x) (uint32_t)(x) |
137 | #endif | 117 | #endif |
138 | 118 | ||
139 | /* volume_id_set_uuid(id,buf,fmt) assumes size of uuid buf | 119 | /* volume_id_set_uuid(id,buf,fmt) assumes size of uuid buf |