Marcus Meissner
2de6e0154c
- Use OS byteswapping routines, application already Includes "endian.h" but then goes ahead defining ad-hoc equivalent functionality (0001-Use-OS-byteswapping-macros.patch) OBS-URL: https://build.opensuse.org/request/show/146438 OBS-URL: https://build.opensuse.org/package/show/Base:System/acl?expand=0&rev=28
50 lines
1.6 KiB
Diff
50 lines
1.6 KiB
Diff
From 100baaf89cdcb01a1c8d4b05782d7fba56813f96 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= <crrodriguez@opensuse.org>
|
|
Date: Wed, 26 Dec 2012 15:16:40 -0300
|
|
Subject: [PATCH] Use OS byteswapping macros
|
|
|
|
while the code already includes "endian.h" it goes ahead
|
|
redefining byteswapping routines, thus defeating the very purpose
|
|
of the header.
|
|
---
|
|
libacl/byteorder.h | 25 ++++++++-----------------
|
|
1 file changed, 8 insertions(+), 17 deletions(-)
|
|
|
|
diff --git a/libacl/byteorder.h b/libacl/byteorder.h
|
|
index 05f5d87..65c87f3 100644
|
|
--- a/libacl/byteorder.h
|
|
+++ b/libacl/byteorder.h
|
|
@@ -17,21 +17,12 @@
|
|
|
|
#include <endian.h>
|
|
|
|
-#if __BYTE_ORDER == __BIG_ENDIAN
|
|
-# define cpu_to_le16(w16) le16_to_cpu(w16)
|
|
-# define le16_to_cpu(w16) ((u_int16_t)((u_int16_t)(w16) >> 8) | \
|
|
- (u_int16_t)((u_int16_t)(w16) << 8))
|
|
-# define cpu_to_le32(w32) le32_to_cpu(w32)
|
|
-# define le32_to_cpu(w32) ((u_int32_t)( (u_int32_t)(w32) >>24) | \
|
|
- (u_int32_t)(((u_int32_t)(w32) >> 8) & 0xFF00) | \
|
|
- (u_int32_t)(((u_int32_t)(w32) << 8) & 0xFF0000) | \
|
|
- (u_int32_t)( (u_int32_t)(w32) <<24))
|
|
-#elif __BYTE_ORDER == __LITTLE_ENDIAN
|
|
-# define cpu_to_le16(w16) ((u_int16_t)(w16))
|
|
-# define le16_to_cpu(w16) ((u_int16_t)(w16))
|
|
-# define cpu_to_le32(w32) ((u_int32_t)(w32))
|
|
-# define le32_to_cpu(w32) ((u_int32_t)(w32))
|
|
-#else
|
|
-# error unknown endianess?
|
|
-#endif
|
|
+# define cpu_to_le16(w16) htole16(w16)
|
|
+
|
|
+# define le16_to_cpu(w16) le16toh(w16)
|
|
+
|
|
+# define cpu_to_le32(w32) htole32(w32)
|
|
+
|
|
+# define le32_to_cpu(w32) le32toh(w32)
|
|
+
|
|
|
|
--
|
|
1.8.0.2
|
|
|