aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Teterin <mi@FreeBSD.org>2023-07-02 03:53:29 +0000
committerMikhail Teterin <mi@FreeBSD.org>2023-07-02 03:53:29 +0000
commit755553f960e1581eff26f9b09b1e1be5c175f97e (patch)
tree1597143d297d062d8ed4d6f9ec347d058250f8fd
parent51dd797385c018b263244308081205555178295d (diff)
downloadports-755553f960e1581eff26f9b09b1e1be5c175f97e.tar.gz
ports-755553f960e1581eff26f9b09b1e1be5c175f97e.zip
graphics/libfpx: eliminate a few more compiler-warnings
If only the original developers of this code had modern compilers... Notified by: pkg-fallout
-rw-r--r--graphics/libfpx/files/patch-warnings52
1 files changed, 52 insertions, 0 deletions
diff --git a/graphics/libfpx/files/patch-warnings b/graphics/libfpx/files/patch-warnings
index 30a022bd5b09..58fa951cc605 100644
--- a/graphics/libfpx/files/patch-warnings
+++ b/graphics/libfpx/files/patch-warnings
@@ -28,3 +28,55 @@ together object files compiled after #include-ing the ejpeg.h header.
-
-JPEGEXPORT
-int No_JPEG_Header_Flag;
+
+padP and padWid are not used. That they are being assigned a value
+-- multiple times -- is why earlier compilers didn't warn about it.
+But modern clang raises a "set but not used" warning...
+--- fpx/filter.cpp 2013-09-02 11:45:00.000000000 -0400
++++ fpx/filter.cpp 2023-07-01 23:41:19.701483000 -0400
+@@ -354,10 +354,8 @@
+ goto RETURN;
+
+- unsigned char *padP, *tmpP, *dstP;
+- long x, y,
+- padWid = (width + (2 * pad)); // Width of padded line in Pixels
++ unsigned char *tmpP, *dstP;
++ long x, y;
+
+ for (y = 0; y < height; y++) {
+- padP = srcComp[k] +(((y + pad) * padWid) * sizeof( Pixel)) + (pad * sizeof( Pixel));
+ tmpP = tempcomp[k] + ((y * width) * sizeof( Pixel));
+ dstP = dstComp[k] + ((y * width) * sizeof( Pixel));
+@@ -367,5 +365,4 @@
+ sum = pixVal + (long)(beta*(double)(pixVal - (long)*dstP) + 0.5);
+ *dstP = (unsigned char)CLAMP(sum, 0, 255);
+- padP += sizeof( Pixel);
+ tmpP += sizeof( Pixel);
+ dstP += sizeof( Pixel);
+
+More set, but unused variables:
+--- ri_image/pr_level.cpp 2013-09-02 11:45:00.000000000 -0400
++++ ri_image/pr_level.cpp 2023-07-01 23:48:29.094528000 -0400
+@@ -1518,5 +1518,4 @@
+ // Declare and init some variables before the main loop...
+ int heightOfBuffer, widthOfBuffer; // Width and height to be written for each bloc
+- int yBloc = 0; // Top coordinate in the resolution level
+ int topInBuffer = 0; // Top coordinate in the buffer
+ PTile* tile = tiles; // Pointer to the current bloc of the resolution level
+@@ -1525,5 +1524,4 @@
+ for (short hBloc = 0; hBloc < nbTilesH; ++hBloc) {
+
+- int xBloc = 0; // Left coordinate in the resolution level
+ int leftInBuffer = 0; // Left coordinate in the buffer
+
+@@ -1607,10 +1605,8 @@
+ }
+
+- xBloc += tile->width; // Increment left coordinate in the resolution level
+ leftInBuffer += widthOfBuffer; // Increment left coordinate in the buffer
+ ++tile; // Next tile
+ }
+
+- yBloc += tile->height; // Increment top coordinate in the resolution level
+ topInBuffer += heightOfBuffer; // Increment top coordinate in the buffer
+ }