mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-26 14:41:25 +00:00
client/server: warning fixes (gcc 4.6.0)
gcc 4.6.0 added "[-Werror=unused-but-set-variable]", this and the next few fixes tend to that. Mostly harmless.
This commit is contained in:
parent
d3b22d86f0
commit
46c70521d5
@ -3050,8 +3050,8 @@ void Platform::init()
|
||||
{
|
||||
#ifdef USE_OGL
|
||||
int err, ev;
|
||||
#endif // USE_OGL
|
||||
int threads_enable;
|
||||
#endif // USE_OGL
|
||||
int major, minor;
|
||||
Bool pixmaps;
|
||||
|
||||
@ -3059,8 +3059,11 @@ void Platform::init()
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
|
||||
#ifdef USE_OGL
|
||||
threads_enable = XInitThreads();
|
||||
|
||||
#else
|
||||
XInitThreads();
|
||||
#endif
|
||||
|
||||
if (!(x_display = XOpenDisplay(NULL))) {
|
||||
THROW("open X display failed");
|
||||
|
||||
@ -174,10 +174,9 @@ static void do_jpeg_encode(JpegEncoder *jpeg, uint8_t *lines, unsigned int num_l
|
||||
{
|
||||
uint8_t *lines_end;
|
||||
uint8_t *RGB24_line;
|
||||
int stride, width, height;
|
||||
int stride, width;
|
||||
JSAMPROW row_pointer[1];
|
||||
width = jpeg->cur_image.width;
|
||||
height = jpeg->cur_image.height;
|
||||
stride = jpeg->cur_image.stride;
|
||||
|
||||
if (jpeg->cur_image.type != JPEG_IMAGE_TYPE_RGB24) {
|
||||
|
||||
@ -236,7 +236,7 @@ static SpiceClipRects *red_get_clip_rects(RedMemSlotInfo *slots, int group_id,
|
||||
RedDataChunk chunks;
|
||||
QXLClipRects *qxl;
|
||||
SpiceClipRects *red;
|
||||
QXLRect *start, *end;
|
||||
QXLRect *start;
|
||||
uint8_t *data;
|
||||
bool free_data;
|
||||
size_t size;
|
||||
@ -254,7 +254,6 @@ static SpiceClipRects *red_get_clip_rects(RedMemSlotInfo *slots, int group_id,
|
||||
red->num_rects = qxl->num_rects;
|
||||
|
||||
start = (QXLRect*)data;
|
||||
end = (QXLRect*)(data + size);
|
||||
for (i = 0; i < red->num_rects; i++) {
|
||||
red_get_rect_ptr(red->rects + i, start++);
|
||||
}
|
||||
|
||||
@ -4512,7 +4512,6 @@ static void red_add_surface_image(RedWorker *worker, int surface_id)
|
||||
{
|
||||
SpiceRect area;
|
||||
RedSurface *surface;
|
||||
ImageItem *item;
|
||||
|
||||
surface = &worker->surfaces[surface_id];
|
||||
|
||||
@ -4526,7 +4525,7 @@ static void red_add_surface_image(RedWorker *worker, int surface_id)
|
||||
|
||||
/* not allowing lossy compression because probably, especially if it is a primary surface,
|
||||
it combines both "picture-like" areas with areas that are more "artificial"*/
|
||||
item = red_add_surface_area_image(worker, surface_id, &area, NULL, FALSE);
|
||||
red_add_surface_area_image(worker, surface_id, &area, NULL, FALSE);
|
||||
display_channel_push(worker);
|
||||
}
|
||||
|
||||
@ -4659,15 +4658,12 @@ static void red_display_reset_compress_buf(DisplayChannel *display_channel)
|
||||
in the channel (2) to the Drawable*/
|
||||
static RedGlzDrawable *red_display_get_glz_drawable(DisplayChannel *channel, Drawable *drawable)
|
||||
{
|
||||
RedSurface *surface;
|
||||
RedGlzDrawable *ret;
|
||||
|
||||
if (drawable->red_glz_drawable) {
|
||||
return drawable->red_glz_drawable;
|
||||
}
|
||||
|
||||
surface = &channel->base.worker->surfaces[drawable->surface_id];
|
||||
|
||||
ret = spice_new(RedGlzDrawable, 1);
|
||||
|
||||
ret->display_channel = channel;
|
||||
@ -5921,15 +5917,11 @@ static FillBitsType fill_bits(DisplayChannel *display_channel, SpiceMarshaller *
|
||||
global dictionary (in cases of multiple monitors) */
|
||||
if (!red_compress_image(display_channel, &image, &simage->u.bitmap,
|
||||
drawable, can_lossy, &comp_send_data)) {
|
||||
uint32_t y;
|
||||
uint32_t stride;
|
||||
SpicePalette *palette;
|
||||
|
||||
red_display_add_image_to_pixmap_cache(display_channel, simage, &image, FALSE);
|
||||
|
||||
*bitmap = simage->u.bitmap;
|
||||
y = bitmap->y;
|
||||
stride = bitmap->stride;
|
||||
bitmap->flags = bitmap->flags & SPICE_BITMAP_FLAGS_TOP_DOWN;
|
||||
|
||||
palette = bitmap->palette;
|
||||
@ -7734,11 +7726,7 @@ static inline int red_send_stream_data(DisplayChannel *display_channel, Drawable
|
||||
|
||||
static inline void send_qxl_drawable(DisplayChannel *display_channel, Drawable *item)
|
||||
{
|
||||
RedChannel *channel;
|
||||
|
||||
ASSERT(display_channel);
|
||||
channel = &display_channel->base;
|
||||
|
||||
if (item->stream && red_send_stream_data(display_channel, item)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -344,6 +344,7 @@ static int reds_ssl_write(void *ctx, void *buf, size_t size)
|
||||
|
||||
if (return_code < 0) {
|
||||
ssl_error = SSL_get_error(ssl, return_code);
|
||||
(void)ssl_error;
|
||||
}
|
||||
|
||||
return (return_code);
|
||||
@ -359,6 +360,7 @@ static int reds_ssl_read(void *ctx, void *buf, size_t size)
|
||||
|
||||
if (return_code < 0) {
|
||||
ssl_error = SSL_get_error(ssl, return_code);
|
||||
(void)ssl_error;
|
||||
}
|
||||
|
||||
return (return_code);
|
||||
@ -376,6 +378,7 @@ static int reds_ssl_writev(void *ctx, const struct iovec *vector, int count)
|
||||
n = SSL_write(ssl, vector[i].iov_base, vector[i].iov_len);
|
||||
if (n <= 0) {
|
||||
ssl_error = SSL_get_error(ssl, n);
|
||||
(void)ssl_error;
|
||||
if (return_code <= 0) {
|
||||
return n;
|
||||
} else {
|
||||
@ -2508,9 +2511,7 @@ static int spice_server_char_device_add_interface(SpiceServer *s,
|
||||
{
|
||||
SpiceCharDeviceInstance* char_device =
|
||||
SPICE_CONTAINEROF(sin, SpiceCharDeviceInstance, base);
|
||||
SpiceCharDeviceInterface* sif;
|
||||
|
||||
sif = SPICE_CONTAINEROF(char_device->base.sif, SpiceCharDeviceInterface, base);
|
||||
red_printf("CHAR_DEVICE %s", char_device->subtype);
|
||||
if (strcmp(char_device->subtype, SUBTYPE_VDAGENT) == 0) {
|
||||
if (vdagent) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user