d < w - x - VNC_TIGHT_DETECT_SUBROW_WIDTH; d++) { \
pix = ((uint##bpp##_t *)buf)[(y+d)*w+x+d]; \
if (endian) { \
- pix = bswap_##bpp(pix); \
+ pix = bswap##bpp(pix); \
} \
for (c = 0; c < 3; c++) { \
left[c] = (int)(pix >> shift[c] & max[c]); \
dx++) { \
pix = ((uint##bpp##_t *)buf)[(y+d)*w+x+d+dx]; \
if (endian) { \
- pix = bswap_##bpp(pix); \
+ pix = bswap##bpp(pix); \
} \
sum = 0; \
for (c = 0; c < 3; c++) { \
for (x = 0; x < w; x++) { \
pix = *buf; \
if (endian) { \
- pix = bswap_##bpp(pix); \
+ pix = bswap##bpp(pix); \
} \
diff = 0; \
for (c = 0; c < 3; c++) { \
<< shift[c]; \
} \
if (endian) { \
- diff = bswap_##bpp(diff); \
+ diff = bswap##bpp(diff); \
} \
*buf++ = diff; \
} \
/*
* Check if a rectangle is all of the same color. If needSameColor is
* set to non-zero, then also check that its color equals to the
- * *colorPtr value. The result is 1 if the test is successfull, and in
+ * *colorPtr value. The result is 1 if the test is successful, and in
* that case new color will be stored in *colorPtr.
*/
static int send_full_color_rect(VncState *vs, int x, int y, int w, int h)
{
int stream = 0;
- size_t bytes;
+ ssize_t bytes;
#ifdef CONFIG_VNC_PNG
if (tight_can_send_png_rect(vs, w, h)) {
static int send_mono_rect(VncState *vs, int x, int y,
int w, int h, uint32_t bg, uint32_t fg)
{
- size_t bytes;
+ ssize_t bytes;
int stream = 1;
int level = tight_conf[vs->tight.compression].mono_zlib_level;
{
int stream = 3;
int level = tight_conf[vs->tight.compression].gradient_zlib_level;
- size_t bytes;
+ ssize_t bytes;
if (vs->clientds.pf.bytes_per_pixel == 1)
return send_full_color_rect(vs, x, y, w, h);
int stream = 2;
int level = tight_conf[vs->tight.compression].idx_zlib_level;
int colors;
- size_t bytes;
+ ssize_t bytes;
#ifdef CONFIG_VNC_PNG
if (tight_can_send_png_rect(vs, w, h)) {
png_structp png_ptr;
png_infop info_ptr;
png_colorp png_palette = NULL;
- size_t offset;
int level = tight_png_conf[vs->tight.compression].png_zlib_level;
int filters = tight_png_conf[vs->tight.compression].png_filters;
uint8_t *buf;
png_set_PLTE(png_ptr, info_ptr, png_palette, palette_size(palette));
- offset = vs->tight.tight.offset;
if (vs->clientds.pf.bytes_per_pixel == 4) {
tight_encode_indexed_rect32(vs->tight.tight.buffer, w * h, palette);
} else {
} else {
ret = send_palette_rect(vs, x, y, w, h, palette);
}
+ } else {
+ ret = 0;
}
return ret;
}
colors = tight_fill_palette(vs, x, y, w * h, &fg, &bg, &palette);
#ifdef CONFIG_VNC_JPEG
- if (vs->tight.quality != -1) {
+ if (vs->tight.quality != (uint8_t)-1) {
ret = send_sub_rect_jpeg(vs, x, y, w, h, bg, fg, colors, palette);
} else {
ret = send_sub_rect_nojpeg(vs, x, y, w, h, bg, fg, colors, palette);