changeset 2263:891acec47aa0

Rename variables.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 17 Jun 2019 01:42:00 +0300
parents f92d4f056587
children e25fa516b53a
files tools/lib64util.c tools/lib64util.h
diffstat 2 files changed, 20 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/tools/lib64util.c	Mon Jun 17 00:57:02 2019 +0300
+++ b/tools/lib64util.c	Mon Jun 17 01:42:00 2019 +0300
@@ -100,9 +100,9 @@
 }
 
 
-void argShowC64Formats(FILE *fp, const BOOL rw)
+void argShowC64Formats(FILE *fh, const BOOL rw)
 {
-    fprintf(fp,
+    fprintf(fh,
         "Available C64 bitmap formats (-f <frmt>):\n"
         " frmt %s| Type            | Description\n"
         "------%s+-----------------+-------------------------------------\n",
@@ -115,31 +115,31 @@
         const DMC64ImageFormat *fmt = dmC64ImageFormatsSorted[i];
         char buf[64];
 
-        fprintf(fp, "%-6s",
+        fprintf(fh, "%-6s",
             fmt->fext);
 
         if (rw)
         {
-            fprintf(fp, "| %c%c ",
+            fprintf(fh, "| %c%c ",
                 (fmt->flags & DM_FMT_RD) ? 'R' : ' ',
                 (fmt->flags & DM_FMT_WR) ? 'W' : ' '
                 );
         }
 
-        fprintf(fp,
+        fprintf(fh,
             "| %-15s | %s%s\n",
-            dmC64GetImageTypeString(buf, sizeof(buf), fmt->format->type, FALSE),
+            dmC64GetImageTypeString(buf, sizeof(buf), fmt->format->mode, FALSE),
             fmt->name,
             fmt->flags & DM_FMT_BROKEN ? " [BROKEN]" : "");
     }
 
-    fprintf(fp, "%d formats supported.\n", ndmC64ImageFormats);
+    fprintf(fh, "%d formats supported.\n", ndmC64ImageFormats);
 }
 
 
-void argShowC64PaletteHelp(FILE *fp)
+void argShowC64PaletteHelp(FILE *fh)
 {
-    fprintf(fp,
+    fprintf(fh,
         "\n"
         "Available C64 palettes (-p <name>):\n"
         "-----------------------------------\n");
@@ -147,12 +147,12 @@
     for (int n = 0; n < ndmC64DefaultPalettes; n++)
     {
         DMC64Palette *pal = &dmC64DefaultPalettes[n];
-        fprintf(fp,
+        fprintf(fh,
             "%-10s | %s\n",
             pal->name, pal->desc);
     }
 
-    fprintf(fp,
+    fprintf(fh,
         "\n"
         "Instead one of the internal palettes, you can\n"
         "also specify an external palette file.\n"
@@ -165,12 +165,12 @@
         const DMPaletteFormat *fmt = &dmPaletteFormatList[n];
         if (fmt->flags & DM_FMT_RD)
         {
-            fprintf(fp,
+            fprintf(fh,
                 "%-6s | %s\n",
                 fmt->fext, fmt->name);
         }
     }
-    fprintf(fp, "\n");
+    fprintf(fh, "\n");
 }
 
 
@@ -200,7 +200,7 @@
 
 int dmHandleExternalPalette(const char *filename, DMPalette **ppal)
 {
-    DMResource *fp = NULL;
+    DMResource *fh = NULL;
     const DMImageFormat *ifmt = NULL;
     const DMPaletteFormat *pfmt = NULL;
     DMImage *inImage = NULL;
@@ -217,7 +217,7 @@
         goto done;
     }
 
-    if ((res = dmf_open_memio(NULL, filename, dataBuf, dataSize, &fp)) != DMERR_OK)
+    if ((res = dmf_open_memio(NULL, filename, dataBuf, dataSize, &fh)) != DMERR_OK)
     {
         dmErrorMsg("Could not create MemIO handle for input.\n");
         goto done;
@@ -229,7 +229,7 @@
         dmMsg(1, "Probed image format %s (%s)\n",
             ifmt->name, ifmt->fext);
 
-        res = ifmt->read(fp, &inImage);
+        res = ifmt->read(fh, &inImage);
         if (res != DMERR_OK)
         {
             dmErrorMsg("Could not read image file: %s\n",
@@ -252,7 +252,7 @@
         dmMsg(1, "Probed palette format %s (%s)\n",
             pfmt->name, pfmt->fext);
 
-        res = pfmt->read(fp, ppal);
+        res = pfmt->read(fh, ppal);
     }
     else
     {
@@ -262,7 +262,7 @@
     }
 
 done:
-    dmf_close(fp);
+    dmf_close(fh);
     dmImageFree(inImage);
     dmFree(dataBuf);
 
--- a/tools/lib64util.h	Mon Jun 17 00:57:02 2019 +0300
+++ b/tools/lib64util.h	Mon Jun 17 01:42:00 2019 +0300
@@ -24,8 +24,8 @@
 char *    dmC64GetImageTypeString(char *buf, const size_t len, const int type, const BOOL lng);
 void      dmC64ImageDump(FILE *fh, const DMC64Image *img, const DMC64ImageFormat *fmt, const char *indent);
 
-void      argShowC64PaletteHelp(FILE *fp);
-void      argShowC64Formats(FILE *fp, const BOOL rw);
+void      argShowC64PaletteHelp(FILE *fh);
+void      argShowC64Formats(FILE *fh, const BOOL rw);
 BOOL      argHandleC64PaletteOption(char *optArg, DMC64Palette **ppal, char **palFile);
 
 int       dmHandleExternalPalette(const char *filename, DMPalette **ppal);