Commit 304c92c6 authored by Robert Schmidt's avatar Robert Schmidt

Fixes in conversions.h

parent f6fe86c6
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
/* Convert an integer on 16 bits to the given bUFFER */ /* Convert an integer on 16 bits to the given bUFFER */
#define INT16_TO_BUFFER(x, buf) \ #define INT16_TO_BUFFER(x, buf) \
do { \ do { \
(buf)[0] = (x >> 8) & 0xff; \ (buf)[0] = ((x) >> 8) & 0xff; \
(buf)[1] = (x) & 0xff; \ (buf)[1] = (x) & 0xff; \
} while(0) } while(0)
...@@ -84,8 +84,8 @@ do { \ ...@@ -84,8 +84,8 @@ do { \
/* Convert an integer on 24 bits to the given bUFFER */ /* Convert an integer on 24 bits to the given bUFFER */
#define INT24_TO_BUFFER(x, buf) \ #define INT24_TO_BUFFER(x, buf) \
do { \ do { \
(buf)[0] = (x >> 16) & 0xff;\ (buf)[0] = ((x) >> 16) & 0xff;\
(buf)[1] = (x >> 8) & 0xff; \ (buf)[1] = ((x) >> 8) & 0xff; \
(buf)[2] = (x) & 0xff; \ (buf)[2] = (x) & 0xff; \
} while(0) } while(0)
...@@ -101,9 +101,9 @@ do { \ ...@@ -101,9 +101,9 @@ do { \
/* Convert an integer on 32 bits to the given bUFFER */ /* Convert an integer on 32 bits to the given bUFFER */
#define INT32_TO_BUFFER(x, buf) \ #define INT32_TO_BUFFER(x, buf) \
do { \ do { \
(buf)[0] = (x >> 24) & 0xff;\ (buf)[0] = ((x) >> 24) & 0xff;\
(buf)[1] = (x >> 16) & 0xff;\ (buf)[1] = ((x) >> 16) & 0xff;\
(buf)[2] = (x >> 8) & 0xff; \ (buf)[2] = ((x) >> 8) & 0xff; \
(buf)[3] = (x) & 0xff; \ (buf)[3] = (x) & 0xff; \
} while(0) } while(0)
......
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