GraphicsMagick: Eliminate warnings about variables which are set...

GraphicsMagick Commits <[email protected]> Sun, 07 Jul 2024 14:20:36 -0500
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.21682.1720380051.7906.graphicsmagick-commit@lists.sourceforge.net>
changeset 01647b4f343c in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=3Dchangeset;nod=
e=3D01647b4f343c
summary: Eliminate warnings about variables which are set but not used.

diffstat:

 ChangeLog                              |  11 ++++++++
 VisualMagick/installer/inc/version.isx |   4 +-
 coders/pcd.c                           |  12 ++++----
 coders/png.c                           |  17 ++++++++++---
 magick/color.c                         |   6 ++--
 magick/version.h                       |   4 +-
 www/ChangeLog.html                     |  17 +++++++++++--
 www/api/color.html                     |  42 +++++++++++++++++------------=
-----
 8 files changed, 72 insertions(+), 41 deletions(-)

diffs (330 lines):

diff -r 804a3a07dbe8 -r 01647b4f343c ChangeLog
--- a/ChangeLog	Fri Jul 05 17:05:11 2024 -0500
+++ b/ChangeLog	Sun Jul 07 14:18:58 2024 -0500
@@ -1,3 +1,14 @@
+2024-07-07  Bob Friesenhahn  <[email protected]>
+
+	* coders/png.c (ReadMNGImage): Eliminate warning: variable
+	'loops_active' set but not used".
+
+	* coders/pcd.c (DecodeImage): Eliminate "warning: variable 'count'
+	set but not used".
+
+	* magick/color.c (IsPaletteImage): Eliminate "warning: variable
+	'index' set but not used".
+
 2024-07-05  Bob Friesenhahn  <[email protected]>
 =

 	* coders/fits.c (ReadFITSImage): Report an error if FITS frames
diff -r 804a3a07dbe8 -r 01647b4f343c VisualMagick/installer/inc/version.isx
--- a/VisualMagick/installer/inc/version.isx	Fri Jul 05 17:05:11 2024 -0500
+++ b/VisualMagick/installer/inc/version.isx	Sun Jul 07 14:18:58 2024 -0500
@@ -10,5 +10,5 @@
 =

 #define public MagickPackageName "GraphicsMagick"
 #define public MagickPackageVersion "1.4"
-#define public MagickPackageVersionAddendum ".020240705"
-#define public MagickPackageReleaseDate "snapshot-20240705"
+#define public MagickPackageVersionAddendum ".020240707"
+#define public MagickPackageReleaseDate "snapshot-20240707"
diff -r 804a3a07dbe8 -r 01647b4f343c coders/pcd.c
--- a/coders/pcd.c	Fri Jul 05 17:05:11 2024 -0500
+++ b/coders/pcd.c	Sun Jul 07 14:18:58 2024 -0500
@@ -214,7 +214,7 @@
   } PCDTable;
 =

   long
-    count,
+    /* count, */
     quantum;
 =

   PCDTable
@@ -326,7 +326,7 @@
   /*
     Recover the Huffman encoded luminance and chrominance deltas.
   */
-  count=3D0;
+  /* count=3D0; */
   length=3D0;
   plane=3D0;
   row=3D0;
@@ -350,20 +350,20 @@
           case 0:
           {
             q=3Dluma+row*(size_t)image->columns;
-            count=3D(long) image->columns;
+            /* count=3D(long) image->columns; */
             break;
           }
           case 2:
           {
             q=3Dchroma1+(row >> 1)*(size_t)image->columns;
-            count=3D(long) (image->columns >> 1);
+            /* count=3D(long) (image->columns >> 1); */
             plane--;
             break;
           }
           case 3:
           {
             q=3Dchroma2+(row >> 1)*(size_t)image->columns;
-            count=3D(long) (image->columns >> 1);
+            /* count=3D(long) (image->columns >> 1); */
             plane--;
             break;
           }
@@ -413,7 +413,7 @@
                         (unsigned char) quantum);
     q++;
     PCDGetBits(r->length);
-    count--;
+    /* count--; */
   }
  decode_image_error:
   /*
diff -r 804a3a07dbe8 -r 01647b4f343c coders/png.c
--- a/coders/png.c	Fri Jul 05 17:05:11 2024 -0500
+++ b/coders/png.c	Sun Jul 07 14:18:58 2024 -0500
@@ -4324,8 +4324,11 @@
     count;
 =

   short
-    loop_level,
-    loops_active =3D 0;
+    loop_level
+#if defined(PNG_DEBUG_LOOPS_ACTIVE)
+    ,loops_active =3D 0
+#endif /* if defined(PNG_DEBUG_LOOPS_ACTIVE) */
+    ;
 =

   volatile short
     skipping_loop;
@@ -5251,7 +5254,9 @@
               if (length >=3D 5) /* To do: check spec, if empty LOOP is al=
lowed */
                 {
                   loop_level=3Dchunk[0]; /* 1 byte */
+#if defined(PNG_DEBUG_LOOPS_ACTIVE)
                   loops_active++;
+#endif /* if defined(PNG_DEBUG_LOOPS_ACTIVE) */
                   mng_info->loop_active[loop_level]=3D1;  /* mark loop act=
ive */
                   /*
                     Record starting point.
@@ -5330,7 +5335,7 @@
                   continue;
                 }
               loop_level=3Dchunk[0];
-#if 0
+#if defined(PNG_DEBUG_LOOPS_ACTIVE)
               if (logging)
                 (void) LogMagickEvent(CoderEvent,GetMagickModule(),
                                       "ENDL: loop_level =3D %d,"
@@ -5341,7 +5346,7 @@
                                       (int) loop_level, (int) mng_info->lo=
op_active[loop_level],
                                       (int) loop_level, mng_info->loop_cou=
nt[loop_level],
                                       (int) loop_level, mng_info->loop_ite=
ration[loop_level]);
-#endif
+#endif /* if defined(PNG_DEBUG_LOOPS_ACTIVE) */
               if (skipping_loop > 0)
                 {
                   if (skipping_loop =3D=3D loop_level)
@@ -5350,7 +5355,9 @@
                         Found end of zero-iteration loop.
                       */
                       skipping_loop=3D(-1);
+#if defined(PNG_DEBUG_LOOPS_ACTIVE)
                       loops_active--;
+#endif /* if defined(PNG_DEBUG_LOOPS_ACTIVE) */
                       mng_info->loop_active[loop_level]=3D0;
                     }
                 }
@@ -5371,7 +5378,9 @@
                           /*
                             Finished loop.
                           */
+#if defined(PNG_DEBUG_LOOPS_ACTIVE)
                           loops_active--;
+#endif /* if defined(PNG_DEBUG_LOOPS_ACTIVE) */
                           mng_info->loop_active[loop_level]=3D0;
                           last_level=3D(-1);
                           for (i=3D0; i < loop_level; i++)
diff -r 804a3a07dbe8 -r 01647b4f343c magick/color.c
--- a/magick/color.c	Fri Jul 05 17:05:11 2024 -0500
+++ b/magick/color.c	Sun Jul 07 14:18:58 2024 -0500
@@ -864,7 +864,7 @@
     i;
 =

   unsigned long
-    index,
+    /* index, */
     level;
 =

   unsigned int
@@ -901,7 +901,7 @@
         Start at the root and proceed level by level.
       */
       node_info=3Dcube_info->root;
-      index=3DMaxTreeDepth-1;
+      /* index=3DMaxTreeDepth-1; */
       for (level=3D1; level < MaxTreeDepth; level++)
       {
         id=3DColorToNodeId(p->red,p->green,p->blue,level);
@@ -918,7 +918,7 @@
               }
           }
         node_info=3Dnode_info->child[id];
-        index--;
+        /* index--; */
       }
       for (i=3D0; i < (long) node_info->number_unique; i++)
         if (ColorMatch(p,&node_info->list[i].pixel))
diff -r 804a3a07dbe8 -r 01647b4f343c magick/version.h
--- a/magick/version.h	Fri Jul 05 17:05:11 2024 -0500
+++ b/magick/version.h	Sun Jul 07 14:18:58 2024 -0500
@@ -38,8 +38,8 @@
 #define MagickLibVersion  0x282500
 #define MagickLibVersionText  "1.4"
 #define MagickLibVersionNumber 28,25,0
-#define MagickChangeDate   "20240705"
-#define MagickReleaseDate  "snapshot-20240705"
+#define MagickChangeDate   "20240707"
+#define MagickReleaseDate  "snapshot-20240707"
 =

 /*
   The MagickLibInterfaceNewest and MagickLibInterfaceOldest defines
diff -r 804a3a07dbe8 -r 01647b4f343c www/ChangeLog.html
--- a/www/ChangeLog.html	Fri Jul 05 17:05:11 2024 -0500
+++ b/www/ChangeLog.html	Sun Jul 07 14:18:58 2024 -0500
@@ -36,8 +36,19 @@
 </ul>
 </div>
 =

-<div class=3D"document" id=3D"graphicsmagick-changelog">
+<main id=3D"graphicsmagick-changelog">
 <h1 class=3D"title">GraphicsMagick ChangeLog</h1>
+<p>2024-07-07  Bob Friesenhahn  &lt;<a class=3D"reference external" href=
=3D"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us">bfriesen=
<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&=
#46;</span>us</a>&gt;</p>
+<blockquote>
+<ul class=3D"simple">
+<li><p>coders/png.c (ReadMNGImage): Eliminate warning: variable
+'loops_active' set but not used&quot;.</p></li>
+<li><p>coders/pcd.c (DecodeImage): Eliminate &quot;warning: variable 'coun=
t'
+set but not used&quot;.</p></li>
+<li><p>magick/color.c (IsPaletteImage): Eliminate &quot;warning: variable
+'index' set but not used&quot;.</p></li>
+</ul>
+</blockquote>
 <p>2024-07-05  Bob Friesenhahn  &lt;<a class=3D"reference external" href=
=3D"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us">bfriesen=
<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&=
#46;</span>us</a>&gt;</p>
 <blockquote>
 <ul class=3D"simple">
@@ -855,7 +866,7 @@
 <li><p>tiff/libtiff/tiffconf.h: Fix path to webp/types.h.</p></li>
 </ul>
 </blockquote>
-</div>
+</main>
 =

 =

 <hr class=3D"docutils">
@@ -863,6 +874,6 @@
     <p><a href=3D"Copyright.html">Copyright</a> =A9 GraphicsMagick Group 2=
002 - 2024<!--SPONSOR_LOGO--></p>
 </div>
 =

-</div>
+</main>
 </body>
 </html>
diff -r 804a3a07dbe8 -r 01647b4f343c www/api/color.html
--- a/www/api/color.html	Fri Jul 05 17:05:11 2024 -0500
+++ b/www/api/color.html	Sun Jul 07 14:18:58 2024 -0500
@@ -36,7 +36,7 @@
 </ul>
 </div>
 =

-<div class=3D"document" id=3D"color">
+<main id=3D"color">
 <h1 class=3D"title">color</h1>
 <p class=3D"subtitle" id=3D"color-related-functions">Color related functio=
ns</p>
 <div class=3D"contents topic" id=3D"contents">
@@ -47,14 +47,14 @@
 <li><p><a class=3D"reference internal" href=3D"#ispaletteimage" id=3D"id7"=
>IsPaletteImage</a></p></li>
 </ul>
 </div>
-<div class=3D"section" id=3D"getcolorhistogram">
+<section id=3D"getcolorhistogram">
 <h1><a class=3D"toc-backref" href=3D"#id5">GetColorHistogram</a></h1>
-<div class=3D"section" id=3D"synopsis">
+<section id=3D"synopsis">
 <h2>Synopsis</h2>
 <pre class=3D"literal-block">HistogramColorPacket *GetColorHistogram( cons=
t <a class=3D"reference external" href=3D"../api/types.html#image">Image</a=
> *, unsigned long *colors,
                                          <a class=3D"reference external" h=
ref=3D"../api/types.html#exceptioninfo">ExceptionInfo</a> *);</pre>
-</div>
-<div class=3D"section" id=3D"description">
+</section>
+<section id=3D"description">
 <h2>Description</h2>
 <p>Method GetColorHistogram returns an array of HistogramColorPacket struc=
tures
 which specify the number of times each unique color occurs in the image.
@@ -76,16 +76,16 @@
 <dd><p>Return any errors or warnings in this structure.</p>
 </dd>
 </dl>
-</div>
-</div>
-<div class=3D"section" id=3D"getnumbercolors">
+</section>
+</section>
+<section id=3D"getnumbercolors">
 <h1><a class=3D"toc-backref" href=3D"#id6">GetNumberColors</a></h1>
-<div class=3D"section" id=3D"id1">
+<section id=3D"id1">
 <h2>Synopsis</h2>
 <pre class=3D"literal-block">unsigned long GetNumberColors( const <a class=
=3D"reference external" href=3D"../api/types.html#image">Image</a> *image, =
FILE *file,
                                <a class=3D"reference external" href=3D"../=
api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
-</div>
-<div class=3D"section" id=3D"id2">
+</section>
+<section id=3D"id2">
 <h2>Description</h2>
 <p>Method GetNumberColors returns the number of unique colors in an image.=
</p>
 <p>The format of the GetNumberColors method is:</p>
@@ -102,15 +102,15 @@
 <dd><p>Return any errors or warnings in this structure.</p>
 </dd>
 </dl>
-</div>
-</div>
-<div class=3D"section" id=3D"ispaletteimage">
+</section>
+</section>
+<section id=3D"ispaletteimage">
 <h1><a class=3D"toc-backref" href=3D"#id7">IsPaletteImage</a></h1>
-<div class=3D"section" id=3D"id3">
+<section id=3D"id3">
 <h2>Synopsis</h2>
 <pre class=3D"literal-block">MagickBool IsPaletteImage( const <a class=3D"=
reference external" href=3D"../api/types.html#image">Image</a> *image, <a c=
lass=3D"reference external" href=3D"../api/types.html#exceptioninfo">Except=
ionInfo</a> *exception );</pre>
-</div>
-<div class=3D"section" id=3D"id4">
+</section>
+<section id=3D"id4">
 <h2>Description</h2>
 <p>Method IsPaletteImage returns True if the image is PseudoClass and has =
256
 unique colors or less.</p>
@@ -129,9 +129,9 @@
 <dd><p>Return any errors or warnings in this structure.</p>
 </dd>
 </dl>
-</div>
-</div>
-</div>
+</section>
+</section>
+</main>
 =

 =

 <hr class=3D"docutils">
@@ -139,6 +139,6 @@
     <p><a href=3D"../Copyright.html">Copyright</a> =A9 GraphicsMagick Grou=
p 2002 - 2024<!--SPONSOR_LOGO--></p>
 </div>
 =

-</div>
+</main>
 </body>
 </html>