#endif
#include "qemu/bswap.h"
-#include "qapi/qmp/qint.h"
#include "vnc.h"
#include "vnc-enc-tight.h"
#include "vnc-palette.h"
*/
static void tight_pack24(VncState *vs, uint8_t *buf, size_t count, size_t *ret)
{
- uint32_t *buf32;
+ uint8_t *buf8;
uint32_t pix;
int rshift, gshift, bshift;
- buf32 = (uint32_t *)buf;
+ buf8 = buf;
if (1 /* FIXME */) {
rshift = vs->client_pf.rshift;
}
while (count--) {
- pix = *buf32++;
+ pix = ldl_he_p(buf8);
*buf++ = (char)(pix >> rshift);
*buf++ = (char)(pix >> gshift);
*buf++ = (char)(pix >> bshift);
+ buf8 += 4;
}
}
}
#endif
- bytes = ((w + 7) / 8) * h;
+ bytes = DIV_ROUND_UP(w, 8) * h;
vnc_write_u8(vs, (stream | VNC_TIGHT_EXPLICIT_FILTER) << 4);
vnc_write_u8(vs, VNC_TIGHT_FILTER_PALETTE);