Commit 47ecadbf authored by Niels Möller's avatar Niels Möller
Browse files

* src/lsh_types.h (WRITE_UINT16): Added READ_UINT16 and

WRITE_UINT16 macros.

Rev: src/lsh_types.h:1.38
parent 39624947
......@@ -121,6 +121,17 @@ do { \
(p)[3] = (i) & 0xff; \
} while(0)
/* Same, for 16-bit quantities */
#define READ_UINT16(p) \
((((UINT32) (p)[0]) << 16) \
| ((UINT32) (p)[1]))
#define WRITE_UINT16(p, i) \
do { \
(p)[0] = ((i) >> 8) & 0xff; \
(p)[1] = (i) & 0xff; \
} while(0)
/* Useful macros. */
#define MIN(a, b) (((a)>(b)) ? (b) : (a))
#define MAX(a, b) (((a)<(b)) ? (b) : (a))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment