From 58c4fa1061d07d35805bbb5cc8af7b36129d4509 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Thu, 10 Oct 2019 16:07:55 +0200 Subject: JPEG image handler: drop a use of "volatile" The reading code protects a local variable with volatile. In this case the only possible reason to apply volatile seems to be protecting the variable across the subsequent setjmp/longjmp. However, the variable is never accessed after the longjmp (the function returns). So, drop the volatile. Change-Id: Ibecb11a9edcc6027b2fd52b555287ad53375a5d0 Reviewed-by: Allan Sandfeld Jensen Reviewed-by: Edward Welbourne --- src/plugins/imageformats/jpeg/qjpeghandler.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp index 1f1675e490..a09e6dfd5a 100644 --- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp +++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp @@ -248,13 +248,12 @@ static bool ensureValidImage(QImage *dest, struct jpeg_decompress_struct *info, static bool read_jpeg_image(QImage *outImage, QSize scaledSize, QRect scaledClipRect, - QRect clipRect, volatile int inQuality, + QRect clipRect, int quality, Rgb888ToRgb32Converter converter, j_decompress_ptr info, struct my_error_mgr* err ) { if (!setjmp(err->setjmp_buffer)) { // -1 means default quality. - int quality = inQuality; if (quality < 0) quality = 75; -- cgit v1.2.3