summaryrefslogtreecommitdiffstats
path: root/server/red_worker.c
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2012-03-13 16:05:12 +0000
committerDaniel P. Berrange <berrange@redhat.com>2012-04-25 09:42:15 +0100
commiteeb2b65a7d5d79af3588ca5cf7e00c4ffd645ea7 (patch)
tree3ba6079525a2419504275516c819cd03a82e0f87 /server/red_worker.c
parent456634a63ea6f409a5444e4aeeaaef1b7262034d (diff)
downloadspice-eeb2b65a7d5d79af3588ca5cf7e00c4ffd645ea7.tar.gz
spice-eeb2b65a7d5d79af3588ca5cf7e00c4ffd645ea7.tar.xz
spice-eeb2b65a7d5d79af3588ca5cf7e00c4ffd645ea7.zip
Mark some variables as volatile
When using setjmp/longjmp the state of local variables can be undefined in certain scenarios: [quote man(longjmp)] The values of automatic variables are unspecified after a call to longjmp() if they meet all the following criteria: · they are local to the function that made the correspond‐ ing setjmp(3) call; · their values are changed between the calls to setjmp(3) and longjmp(); and · they are not declared as volatile. [/quote] * server/red_worker.c: Mark some vars as volatile Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'server/red_worker.c')
-rw-r--r--server/red_worker.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/red_worker.c b/server/red_worker.c
index 87118b66..32d390d7 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -5926,9 +5926,9 @@ static int red_jpeg_compress_image(DisplayChannelClient *dcc, SpiceImage *dest,
LzData *lz_data = &worker->lz_data;
JpegEncoderContext *jpeg = worker->jpeg;
LzContext *lz = worker->lz;
- JpegEncoderImageType jpeg_in_type;
+ volatile JpegEncoderImageType jpeg_in_type;
int jpeg_size = 0;
- int has_alpha = FALSE;
+ volatile int has_alpha = FALSE;
int alpha_lz_size = 0;
int comp_head_filled;
int comp_head_left;
@@ -6066,7 +6066,7 @@ static inline int red_quic_compress_image(DisplayChannelClient *dcc, SpiceImage
RedWorker *worker = display_channel->common.worker;
QuicData *quic_data = &worker->quic_data;
QuicContext *quic = worker->quic;
- QuicImageType type;
+ volatile QuicImageType type;
int size, stride;
#ifdef COMPRESS_STAT