[poppler] fofi/FoFiTrueType.cc poppler/Annot.cc poppler/SplashOutputDev.cc splash/Splash.cc utils/HtmlOutputDev.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Sun Sep 17 00:01:40 UTC 2017


 fofi/FoFiTrueType.cc       |    2 ++
 poppler/Annot.cc           |    4 ++--
 poppler/SplashOutputDev.cc |    8 ++++++++
 splash/Splash.cc           |    2 ++
 utils/HtmlOutputDev.cc     |    9 ++++-----
 5 files changed, 18 insertions(+), 7 deletions(-)

New commits:
commit 4a4e291246f238731429729e10633ee1f627eb77
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Sep 17 01:58:36 2017 +0200

    Make newer gcc happy about fallthrough
    
    on HtmlOutputDev.cc fixes a leak when printHtml is false

diff --git a/fofi/FoFiTrueType.cc b/fofi/FoFiTrueType.cc
index f1a15e00..58f604aa 100644
--- a/fofi/FoFiTrueType.cc
+++ b/fofi/FoFiTrueType.cc
@@ -1307,8 +1307,10 @@ Guint FoFiTrueType::computeTableChecksum(Guchar *data, int length) {
     switch (length & 3) {
     case 3:
       word |= (data[i+2] & 0xff) <<  8;
+      // fallthrough
     case 2:
       word |= (data[i+1] & 0xff) << 16;
+      // fallthrough
     case 1:
       word |= (data[i  ] & 0xff) << 24;
       break;
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index db9a5715..1474c2cf 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -4681,7 +4681,7 @@ void AnnotWidget::drawBorder() {
         appearBuf->appendf(" {0:.2f}", dash[i]);
       }
       appearBuf->append("] 0 d\n");
-      // fall through to the solid case
+      // fallthrough
     case AnnotBorder::borderSolid:
     case AnnotBorder::borderUnderlined:
       appearBuf->appendf("{0:.2f} w\n", w);
@@ -4713,7 +4713,7 @@ void AnnotWidget::drawBorder() {
         appearBuf->appendf(" {0:.2f}", dash[i]);
       }
       appearBuf->append("] 0 d\n");
-      // fall through to the solid case
+      // fallthrough
     case AnnotBorder::borderSolid:
       appearBuf->appendf("{0:.2f} w\n", w);
       setColor(aColor, gFalse);
diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc
index 4f4128fd..dc5b6871 100644
--- a/poppler/SplashOutputDev.cc
+++ b/poppler/SplashOutputDev.cc
@@ -128,6 +128,7 @@ static inline void convertGfxColor(SplashColorPtr dest,
     break;
     case splashModeXBGR8:
       color[3] = 255;
+      // fallthrough
     case splashModeBGR8:
     case splashModeRGB8:
       colorSpace->getRGB(src, &rgb);
@@ -175,6 +176,7 @@ static inline void convertGfxShortColor(SplashColorPtr dest,
     break;
     case splashModeXBGR8:
       dest[3] = 255;
+      // fallthrough
     case splashModeBGR8:
     case splashModeRGB8:
     {
@@ -1016,6 +1018,7 @@ static void splashOutBlendHue(SplashColorPtr src, SplashColorPtr dest,
     break;
   case splashModeXBGR8:
     src[3] = 255;
+    // fallthrough
   case splashModeRGB8:
   case splashModeBGR8:
     setSat(src[0], src[1], src[2], getSat(dest[0], dest[1], dest[2]),
@@ -1066,6 +1069,7 @@ static void splashOutBlendSaturation(SplashColorPtr src, SplashColorPtr dest,
     break;
   case splashModeXBGR8:
     src[3] = 255;
+    // fallthrough
   case splashModeRGB8:
   case splashModeBGR8:
     setSat(dest[0], dest[1], dest[2], getSat(src[0], src[1], src[2]),
@@ -1113,6 +1117,7 @@ static void splashOutBlendColor(SplashColorPtr src, SplashColorPtr dest,
     break;
   case splashModeXBGR8:
     src[3] = 255;
+    // fallthrough
   case splashModeRGB8:
   case splashModeBGR8:
     setLum(src[0], src[1], src[2], getLum(dest[0], dest[1], dest[2]),
@@ -1157,6 +1162,7 @@ static void splashOutBlendLuminosity(SplashColorPtr src, SplashColorPtr dest,
     break;
   case splashModeXBGR8:
     src[3] = 255;
+    // fallthrough
   case splashModeRGB8:
   case splashModeBGR8:
     setLum(dest[0], dest[1], dest[2], getLum(src[0], src[1], src[2]),
@@ -1570,6 +1576,7 @@ void SplashOutputDev::startPage(int pageNum, GfxState *state, XRef *xrefA) {
     break;
   case splashModeXBGR8:
     color[3] = 255;
+    // fallthrough
   case splashModeRGB8:
   case splashModeBGR8:
     color[0] = color[1] = color[2] = 0;
@@ -4428,6 +4435,7 @@ void SplashOutputDev::setSoftMask(GfxState *state, double *bbox,
 	break;
       case splashModeXBGR8:
 	color[3] = 255;
+	// fallthrough
       case splashModeRGB8:
       case splashModeBGR8:
 	transpGroupStack->blendingColorSpace->getRGB(backdropColor, &rgb);
diff --git a/splash/Splash.cc b/splash/Splash.cc
index aba7814f..83bd2e39 100644
--- a/splash/Splash.cc
+++ b/splash/Splash.cc
@@ -580,12 +580,14 @@ void Splash::pipeRun(SplashPipe *pipe) {
 #endif
 	case splashModeXBGR8:
 	  cSrcNonIso[3] = 255;
+      // fallthrough
 	case splashModeRGB8:
 	case splashModeBGR8:
 	  cSrcNonIso[2] = clip255(pipe->cSrc[2] +
 				  ((pipe->cSrc[2] - cDest[2]) * t) / 255);
 	  cSrcNonIso[1] = clip255(pipe->cSrc[1] +
 				  ((pipe->cSrc[1] - cDest[1]) * t) / 255);
+      // fallthrough
 	case splashModeMono1:
 	case splashModeMono8:
 	  cSrcNonIso[0] = clip255(pipe->cSrc[0] +
diff --git a/utils/HtmlOutputDev.cc b/utils/HtmlOutputDev.cc
index ac80dc18..7f933f0c 100644
--- a/utils/HtmlOutputDev.cc
+++ b/utils/HtmlOutputDev.cc
@@ -1656,10 +1656,9 @@ GooString* HtmlOutputDev::getLinkDest(AnnotLink *link){
 	  return file;
 	  }
       case actionLaunch:
-	  {
-	  LinkLaunch *ha=(LinkLaunch *) link->getAction();
-	  GooString* file=new GooString(ha->getFileName()->getCString());
-	  if (printHtml) { 
+	  if (printHtml) {
+	      LinkLaunch *ha=(LinkLaunch *) link->getAction();
+	      GooString* file=new GooString(ha->getFileName()->getCString());
 	      p=file->getCString()+file->getLength()-4;
 	      if (!strcmp(p, ".pdf") || !strcmp(p, ".PDF")){
 		  file->del(file->getLength()-4,4);
@@ -1670,7 +1669,7 @@ GooString* HtmlOutputDev::getLinkDest(AnnotLink *link){
 	      return file;      
   
 	  }
-	  }
+	  // fallthrough
       default:
 	  return new GooString();
   }


More information about the poppler mailing list