aboutsummaryrefslogtreecommitdiffstats
path: root/epan/pint.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-07-29 20:50:39 +0000
committerGuy Harris <guy@alum.mit.edu>2003-07-29 20:50:39 +0000
commit98450e967dd8de08aba60296ec67546eb8d7a522 (patch)
tree2a0cdcfa56c4af37c982cd9d25841ad0d1c503f0 /epan/pint.h
parent98909d90454cf36a6c657bcd29023613f4b90e92 (diff)
Use GLib's macros for converting from host byte order to little-endian.
svn path=/trunk/; revision=8098
Diffstat (limited to 'epan/pint.h')
-rw-r--r--epan/pint.h17
1 files changed, 3 insertions, 14 deletions
diff --git a/epan/pint.h b/epan/pint.h
index 200963da95..353ad31f48 100644
--- a/epan/pint.h
+++ b/epan/pint.h
@@ -2,7 +2,7 @@
* Definitions for extracting and translating integers safely and portably
* via pointers.
*
- * $Id: pint.h,v 1.7 2002/11/27 22:41:00 guy Exp $
+ * $Id: pint.h,v 1.8 2003/07/29 20:50:39 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -74,18 +74,7 @@
(((x)&0x00FF)<<8))
/* Turn host-byte-order values into little-endian values. */
-#ifdef WORDS_BIGENDIAN
-#define htoles(s) ((guint16) \
- ((guint16)((s) & 0x00FF)<<8| \
- (guint16)((s) & 0xFF00)>>8))
-
-#define htolel(l) ((guint32)((l) & 0x000000FF)<<24| \
- (guint32)((l) & 0x0000FF00)<<8| \
- (guint32)((l) & 0x00FF0000)>>8| \
- (guint32)((l) & 0xFF000000)>>24)
-#else
-#define htoles(s) (s)
-#define htolel(l) (l)
-#endif
+#define htoles(s) GUINT16_TO_LE(s)
+#define htolel(l) GUINT32_TO_LE(l)
#endif /* PINT_H */