[poppler] 3 commits - cmake/modules qt5/src splash/Splash.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 21 18:11:11 UTC 2019


 cmake/modules/PopplerMacros.cmake |    4 ++--
 qt5/src/poppler-page.cc           |    6 +++---
 splash/Splash.cc                  |   12 ++++++------
 3 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit f4733c31389fe7fd3ef70af86df4eee865ba3660
Author: Albert Astals Cid <aacid at kde.org>
Date:   Fri Jun 21 19:46:51 2019 +0200

    Enable shadow warning by default
    
    It's always a bad idea having multiple variables with the same name, so complain if that happens

diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
index 3b1d2a41..4474ff3d 100644
--- a/cmake/modules/PopplerMacros.cmake
+++ b/cmake/modules/PopplerMacros.cmake
@@ -110,13 +110,13 @@ if(CMAKE_COMPILER_IS_GNUCXX)
   set(_warn "${_warn} -Wmissing-declarations")
   set(_warn "${_warn} -Wundef")
   set(_warn "${_warn} -Wzero-as-null-pointer-constant")
+  set(_warn "${_warn} -Wshadow")
   if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0.0")
     set(_warn "${_warn} -Wsuggest-override")
   endif()
 
   # set extra warnings
   set(_warnx "${_warnx} -Wconversion")
-  set(_warnx "${_warnx} -Wshadow")
   set(_warnx "${_warnx} -Wuseless-cast")
 
   set(DEFAULT_COMPILE_WARNINGS "${_warn}")
@@ -158,10 +158,10 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
   set(_warn "${_warn} -Wmissing-declarations")
   set(_warn "${_warn} -Wundef")
   set(_warn "${_warn} -Wzero-as-null-pointer-constant")
+  set(_warn "${_warn} -Wshadow")
 
   # set extra warnings
   set(_warnx "${_warnx} -Wconversion")
-  set(_warnx "${_warnx} -Wshadow")
 
   set(DEFAULT_COMPILE_WARNINGS "${_warn}")
   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
commit 5c22d88ecdd540dbec5d559d8659c02d54662303
Author: Albert Astals Cid <aacid at kde.org>
Date:   Fri Jun 21 20:05:56 2019 +0200

    qt5: rename variable to fix shadow warning

diff --git a/qt5/src/poppler-page.cc b/qt5/src/poppler-page.cc
index 3e750620..4676dcd8 100644
--- a/qt5/src/poppler-page.cc
+++ b/qt5/src/poppler-page.cc
@@ -517,7 +517,7 @@ QImage Page::renderToImage(double xres, double yres, int x, int y, int w, int h,
   return renderToImage(xres, yres, x, y, w, h, rotate, partialUpdateCallback, shouldDoPartialUpdateCallback, nullptr, payload);
 }
 
-QImage Page::renderToImage(double xres, double yres, int x, int y, int w, int h, Rotation rotate, RenderToImagePartialUpdateFunc partialUpdateCallback, ShouldRenderToImagePartialQueryFunc shouldDoPartialUpdateCallback, ShouldAbortQueryFunc shouldAbortRenderCallback, const QVariant &payload) const
+QImage Page::renderToImage(double xres, double yres, int xPos, int yPos, int w, int h, Rotation rotate, RenderToImagePartialUpdateFunc partialUpdateCallback, ShouldRenderToImagePartialQueryFunc shouldDoPartialUpdateCallback, ShouldAbortQueryFunc shouldAbortRenderCallback, const QVariant &payload) const
 {
   int rotation = (int)rotate * 90;
   QImage img;
@@ -593,7 +593,7 @@ QImage Page::renderToImage(double xres, double yres, int x, int y, int w, int h,
 
       OutputDevCallbackHelper *abortHelper = &splash_output;
       m_page->parentDoc->doc->displayPageSlice(&splash_output, m_page->index + 1, xres, yres,
-                                               rotation, false, true, false, x, y, w, h,
+                                               rotation, false, true, false, xPos, yPos, w, h,
                                                shouldAbortRenderCallback ? shouldAbortRenderInternalCallback : nullAbortCallBack, abortHelper,
                                                (hideAnnotations) ? annotDisplayDecideCbk : nullAnnotCallBack,
                                                nullptr, true);
@@ -617,7 +617,7 @@ QImage Page::renderToImage(double xres, double yres, int x, int y, int w, int h,
       QPainter painter(&tmpimg);
       QImageDumpingArthurOutputDev arthur_output(&painter, &tmpimg);
       arthur_output.setCallbacks(partialUpdateCallback, shouldDoPartialUpdateCallback, shouldAbortRenderCallback, payload);
-      renderToArthur(&arthur_output, &painter, m_page, xres, yres, x, y, w, h, rotate, DontSaveAndRestore);
+      renderToArthur(&arthur_output, &painter, m_page, xres, yres, xPos, yPos, w, h, rotate, DontSaveAndRestore);
       painter.end();
       img = tmpimg;
       break;
commit 56582f515667074ea5d53b7eae1f9451756bb697
Author: Albert Astals Cid <aacid at kde.org>
Date:   Fri Jun 21 20:02:27 2019 +0200

    Splash: Rename local variable to fix shadow warning

diff --git a/splash/Splash.cc b/splash/Splash.cc
index dea728dd..654608cf 100644
--- a/splash/Splash.cc
+++ b/splash/Splash.cc
@@ -367,20 +367,20 @@ void Splash::pipeRun(SplashPipe *pipe) {
 #ifdef SPLASH_CMYK
     if (bitmap->mode == splashModeCMYK8 || bitmap->mode == splashModeDeviceN8) {
       if (state->fillOverprint && state->overprintMode && pipe->pattern->isCMYK()) {
-        unsigned int mask = 15;
+        unsigned int overprintMask = 15;
         if (pipe->cSrcVal[0] == 0) {
-          mask &= ~1;
+          overprintMask &= ~1;
         }
         if (pipe->cSrcVal[1] == 0) {
-          mask &= ~2;
+          overprintMask &= ~2;
         }
         if (pipe->cSrcVal[2] == 0) {
-          mask &= ~4;
+          overprintMask &= ~4;
         }
         if (pipe->cSrcVal[3] == 0) {
-          mask &= ~8;
+          overprintMask &= ~8;
         }
-        state->overprintMask = mask;
+        state->overprintMask = overprintMask;
       }
     }
 #endif


More information about the poppler mailing list