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

View file

@ -322,6 +322,7 @@ int vnc_negotiate(FAR struct vnc_session_s *session)
rfb_putbe32(serverinit->namelen, 0);
pixelfmt = &serverinit->format;
pixelfmt->bpp = RFB_BITSPERPIXEL;
pixelfmt->depth = RFB_PIXELDEPTH;
pixelfmt->bigendian = 0;

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; \