Commit 648d39ff authored by Niels Möller's avatar Niels Möller
Browse files

Fixed WRITE_UINT32 and READ_UINT32 macros.

Rev: src/lsh_types.h:1.7
parent 945414fc
......@@ -43,16 +43,16 @@
/* Reads a 32-bit integer, in network byte order */
#define READ_UINT32(p) \
((((UINT32) (p)[0]) << 24) \
| (((UINT32) (p)[0]) << 16) \
| (((UINT32) (p)[0]) << 8) \
| ((UINT32) (p)[0]))
| (((UINT32) (p)[1]) << 16) \
| (((UINT32) (p)[2]) << 8) \
| ((UINT32) (p)[3]))
#define WRITE_UINT32(p, i) \
do { \
(p)[0] = ((i) >> 24) & 0xff; \
(p)[0] = ((i) >> 16) & 0xff; \
(p)[0] = ((i) >> 8) & 0xff; \
(p)[0] = (i) & 0xff; \
(p)[1] = ((i) >> 16) & 0xff; \
(p)[2] = ((i) >> 8) & 0xff; \
(p)[3] = (i) & 0xff; \
} while(0)
#define MIN(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