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>
This commit is contained in:
Daniel P. Berrange 2012-03-13 16:05:12 +00:00
parent 456634a63e
commit eeb2b65a7d

View File

@ -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