VNC: Fix some big-endian access macros

This commit is contained in:
Gregory Nutt
2016-04-19 09:11:14 -06:00
parent f3515a242d
commit fc809d5df0
2 changed files with 6 additions and 3 deletions
+5 -3
View File
@@ -1029,7 +1029,9 @@ struct rfb_palettendx_s
/* Data Access Helpers ******************************************************/
/* All multiple byte integers (other than pixel values themselves) are in
* big endian order (most significant byte first).
* big endian order (most significant byte first). The following do not
* depend on the endianness of the target nor that they depend on any data
* alignment.
*/
/* void rfb_putbe16(FAR uint8_t *dest, uint16_t value) */
@@ -1037,7 +1039,7 @@ struct rfb_palettendx_s
#define rfb_putbe16(d,v) \
do \
{ \
FAR uint32_t *dest = (d); \
FAR uint8_t *dest = (d); \
*dest++ = ((uint16_t)(v) >> 8); \
*dest = ((uint16_t)(v) & 0xff); \
} \
@@ -1054,7 +1056,7 @@ struct rfb_palettendx_s
#define rfb_putbe32(d,v) \
do \
{ \
FAR uint32_t *dest = (d); \
FAR uint8_t *dest = (d); \
*dest++ = ((uint32_t)(v) >> 24); \
*dest++ = ((uint32_t)(v) >> 16) & 0xff; \
*dest++ = ((uint32_t)(v) >> 8) & 0xff; \