changeset 2456:f5f8001490ae

Remove the unused "BOOL info" argument from dmWriteImage().
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 15 Apr 2020 14:21:38 +0300
parents ac42dccc6b7c
children 16426e9dc238
files tools/gfxconv.c
diffstat 1 files changed, 26 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/tools/gfxconv.c	Wed Apr 15 14:20:11 2020 +0300
+++ b/tools/gfxconv.c	Wed Apr 15 14:21:38 2020 +0300
@@ -1467,7 +1467,7 @@
 
 
 int dmWriteImage(const char *filename, DMImage *pimage,
-    DMImageWriteSpec *spec, const DMImageFormat *fmt, BOOL info)
+    DMImageWriteSpec *spec, const DMImageFormat *fmt)
 {
     int res = DMERR_OK;
 
@@ -1479,14 +1479,11 @@
             fmt->name);
     }
 
-    if (info)
-    {
-        dmMsg(1, "Outputting '%s' image %d x %d -> %d x %d [%d x %d]\n",
-            fmt->name,
-            pimage->width, pimage->height,
-            pimage->width * spec->scaleX, pimage->height * spec->scaleY,
-            spec->scaleX, spec->scaleY);
-    }
+    dmMsg(1, "Outputting '%s' image %d x %d -> %d x %d [%d x %d]\n",
+        fmt->name,
+        pimage->width, pimage->height,
+        pimage->width * spec->scaleX, pimage->height * spec->scaleY,
+        spec->scaleX, spec->scaleY);
 
     // Perform color remapping
     DMImage *image = pimage;
@@ -1548,15 +1545,12 @@
                 for (int i = 0; prefix[i]; i++)
                     prefix[i] = isalnum(prefix[i]) ? tolower(prefix[i]) : '_';
 
-                if (info)
-                {
-                    dmMsg(2, "%d bitplanes, %s planes output.\n",
-                        spec->nplanes,
-                        spec->planar ? "planar/interleaved" : "non-interleaved");
-                    dmMsg(2, "%s datafile '%s', ID prefix '%s'.\n",
-                        fmt->fmtid == DM_IMGFMT_ARAW ? "ARAW" : "RAW",
-                        hdrFilename, prefix);
-                }
+                dmMsg(2, "%d bitplanes, %s planes output.\n",
+                    spec->nplanes,
+                    spec->planar ? "planar/interleaved" : "non-interleaved");
+                dmMsg(2, "%s datafile '%s', ID prefix '%s'.\n",
+                    fmt->fmtid == DM_IMGFMT_ARAW ? "ARAW" : "RAW",
+                    hdrFilename, prefix);
 
                 res = dmWriteIFFMasterRAWHeaderFile(
                     hdrFilename, filename, prefix, image, spec);
@@ -1575,20 +1569,16 @@
     if (res == DMERR_OK)
     {
         DMResource *fp;
-
-        if (info)
+        char *str;
+        switch (spec->pixfmt)
         {
-            char *str;
-            switch (spec->pixfmt)
-            {
-                case DM_PIXFMT_PALETTE   : str = "indexed/paletted"; break;
-                case DM_PIXFMT_RGB       : str = "24bit RGB"; break;
-                case DM_PIXFMT_RGBA      : str = "32bit RGBA"; break;
-                case DM_PIXFMT_GRAYSCALE : str = "grayscale"; break;
-                default                  : str = "???"; break;
-            }
-            dmMsg(1, "Using %s output.\n", str);
+            case DM_PIXFMT_PALETTE   : str = "indexed/paletted"; break;
+            case DM_PIXFMT_RGB       : str = "24bit RGB"; break;
+            case DM_PIXFMT_RGBA      : str = "32bit RGBA"; break;
+            case DM_PIXFMT_GRAYSCALE : str = "grayscale"; break;
+            default                  : str = "???"; break;
         }
+        dmMsg(1, "Using %s output.\n", str);
 
         if ((res = dmf_open_stdio(filename, "wb", &fp)) != DMERR_OK)
         {
@@ -1947,7 +1937,8 @@
                 }
 
                 ret = dmWriteImage(outFilename, outImage, &optSpec,
-                    &dmImageFormatList[optOutFormat], TRUE);
+                    &dmImageFormatList[optOutFormat]);
+
                 if (ret != DMERR_OK)
                 {
                     dmErrorMsg("Error writing output image '%s': %s.\n",
@@ -1972,7 +1963,8 @@
         if (!optSequential)
         {
             ret = dmWriteImage(optOutFilename, outImage, &optSpec,
-                &dmImageFormatList[optOutFormat], TRUE);
+                &dmImageFormatList[optOutFormat]);
+
             if (ret != DMERR_OK)
             {
                 dmError(ret, "Error writing output image '%s': %s.\n",
@@ -2394,7 +2386,7 @@
                     {
                         case FFMT_IMAGE:
                             res = dmWriteImage(optOutFilename, outImage, &optSpec,
-                                &dmImageFormatList[optOutFormat], TRUE);
+                                &dmImageFormatList[optOutFormat]);
                             break;
 
                         case FFMT_CHAR:
@@ -2466,7 +2458,7 @@
                 {
                     case FFMT_IMAGE:
                         res = dmWriteImage(optOutFilename, inImage, &optSpec,
-                            &dmImageFormatList[optOutFormat], TRUE);
+                            &dmImageFormatList[optOutFormat]);
                         break;
 
                     case FFMT_PALETTE: