mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 09:49:21 +08:00
VNC: Fix some big-endian access macros
This commit is contained in:
parent
f3515a242d
commit
fc809d5df0
2 changed files with 6 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -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; \
|
||||
|
|
Loading…
Reference in a new issue