aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2013-11-29 18:59:06 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2013-11-29 18:59:06 +0000
commit5ac6474c945133a8415fb3be917859e5d42b6256 (patch)
treeee20c73dfaf23171bd739a6a3d7558db0f451097 /wsutil
parent288efa5128341fab8907f3a2969a0bed95ae65cf (diff)
Rename some of pint.h macros to match common style (bits number on the end).
pntohs -> pntoh16 pntohl -> pntoh32 pletohs -> pletoh16 pletohl -> pletoh32 phtons -> phton16 phtonl -> phton32 svn path=/trunk/; revision=53652
Diffstat (limited to 'wsutil')
-rw-r--r--wsutil/md5.c2
-rw-r--r--wsutil/pint.h14
2 files changed, 8 insertions, 8 deletions
diff --git a/wsutil/md5.c b/wsutil/md5.c
index 0aefa0f0d8..5050a7fdde 100644
--- a/wsutil/md5.c
+++ b/wsutil/md5.c
@@ -64,7 +64,7 @@ static void byteReverse(guint32 *buf, unsigned longs)
{
guint32 t;
do {
- t = pletohl(buf);
+ t = pletoh32(buf);
*buf = t;
buf++;
} while (--longs);
diff --git a/wsutil/pint.h b/wsutil/pint.h
index d7d6972558..ba3b4a1493 100644
--- a/wsutil/pint.h
+++ b/wsutil/pint.h
@@ -31,10 +31,10 @@
/* Pointer versions of g_ntohs and g_ntohl. Given a pointer to a member of a
* byte array, returns the value of the two or four bytes at the pointer.
- * The pletoh[sl] versions return the little-endian representation.
+ * The pletohXX versions return the little-endian representation.
*/
-#define pntohs(p) ((guint16) \
+#define pntoh16(p) ((guint16) \
((guint16)*((const guint8 *)(p)+0)<<8| \
(guint16)*((const guint8 *)(p)+1)<<0))
@@ -42,7 +42,7 @@
(guint32)*((const guint8 *)(p)+1)<<8| \
(guint32)*((const guint8 *)(p)+2)<<0)
-#define pntohl(p) ((guint32)*((const guint8 *)(p)+0)<<24| \
+#define pntoh32(p) ((guint32)*((const guint8 *)(p)+0)<<24| \
(guint32)*((const guint8 *)(p)+1)<<16| \
(guint32)*((const guint8 *)(p)+2)<<8| \
(guint32)*((const guint8 *)(p)+3)<<0)
@@ -78,7 +78,7 @@
(guint64)*((const guint8 *)(p)+7)<<0)
-#define pletohs(p) ((guint16) \
+#define pletoh16(p) ((guint16) \
((guint16)*((const guint8 *)(p)+1)<<8| \
(guint16)*((const guint8 *)(p)+0)<<0))
@@ -86,7 +86,7 @@
(guint32)*((const guint8 *)(p)+1)<<8| \
(guint32)*((const guint8 *)(p)+0)<<0)
-#define pletohl(p) ((guint32)*((const guint8 *)(p)+3)<<24| \
+#define pletoh32(p) ((guint32)*((const guint8 *)(p)+3)<<24| \
(guint32)*((const guint8 *)(p)+2)<<16| \
(guint32)*((const guint8 *)(p)+1)<<8| \
(guint32)*((const guint8 *)(p)+0)<<0)
@@ -125,13 +125,13 @@
* These will work regardless of the byte alignment of the pointer.
*/
-#define phtons(p, v) \
+#define phton16(p, v) \
{ \
((guint8*)(p))[0] = (guint8)((v) >> 8); \
((guint8*)(p))[1] = (guint8)((v) >> 0); \
}
-#define phtonl(p, v) \
+#define phton32(p, v) \
{ \
((guint8*)(p))[0] = (guint8)((v) >> 24); \
((guint8*)(p))[1] = (guint8)((v) >> 16); \