diff options
author | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2013-11-29 18:59:06 +0000 |
---|---|---|
committer | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2013-11-29 18:59:06 +0000 |
commit | 5ac6474c945133a8415fb3be917859e5d42b6256 (patch) | |
tree | ee20c73dfaf23171bd739a6a3d7558db0f451097 /wsutil/pint.h | |
parent | 288efa5128341fab8907f3a2969a0bed95ae65cf (diff) | |
download | wireshark-5ac6474c945133a8415fb3be917859e5d42b6256.tar.gz |
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/pint.h')
-rw-r--r-- | wsutil/pint.h | 14 |
1 files changed, 7 insertions, 7 deletions
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); \ |