changeset 2572:92b93a12c014

Make some casts explicit instead of implicit, fixes some -pedantic warnings.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 10 Mar 2022 22:36:48 +0200
parents bb44c48cffac
children 21d296803fac
files src/dmimage.c src/dmres.c src/dmtext.h src/dmtext_bm.c tools/fontconv.c tools/libgfx.c
diffstat 6 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/dmimage.c	Wed Mar 02 23:23:05 2022 +0200
+++ b/src/dmimage.c	Thu Mar 10 22:36:48 2022 +0200
@@ -106,7 +106,7 @@
     {
         dmErrorDBGMsg(
             "Error decoding image resource %p '%s' [%d, %d, %d]: %s\n",
-            file, file->filename, width, height, comp, stbi_failure_reason());
+            (void *) file, file->filename, width, height, comp, stbi_failure_reason());
         return NULL;
     }
 
@@ -145,7 +145,7 @@
     {
         dmErrorDBGMsg(
             "Format conversion failed for image resource %p '%s' [%d, %d, %d].\n",
-            file, file->filename, width, height, comp);
+            (void *) file, file->filename, width, height, comp);
     }
 
     return result;
--- a/src/dmres.c	Wed Mar 02 23:23:05 2022 +0200
+++ b/src/dmres.c	Thu Mar 10 22:36:48 2022 +0200
@@ -93,8 +93,8 @@
             dmErrorMsg(
                 "Attempting to dmResourceFree(%p) node that has resfs %d > 0: '%s'.\n"
                 "FOPS=%p, fops->name=%s\n",
-                node, node->refcount, node->filename,
-                node->fops, (node->fops != NULL) ? node->fops->name : "UNDEF");
+                (void *) node, node->refcount, node->filename,
+                (void *) node->fops, (node->fops != NULL) ? node->fops->name : "UNDEF");
         }
         dmUnlockLibMutex(node->lib);
 #endif
--- a/src/dmtext.h	Wed Mar 02 23:23:05 2022 +0200
+++ b/src/dmtext.h	Thu Mar 10 22:36:48 2022 +0200
@@ -88,7 +88,7 @@
     glyph = &font->glyphMap[ch];
     surf->w = glyph->width;
     surf->h = glyph->height;
-    surf->pixels = font->glyphs->pixels + font->gsize * glyph->index;
+    surf->pixels = (Uint8 *) font->glyphs->pixels + font->gsize * glyph->index;
 }
 #endif
 
--- a/src/dmtext_bm.c	Wed Mar 02 23:23:05 2022 +0200
+++ b/src/dmtext_bm.c	Thu Mar 10 22:36:48 2022 +0200
@@ -295,7 +295,7 @@
         glyph->index  = i;
 
         // Read pixel data
-        pixels = font->glyphs->pixels + (i * font->gsize);
+        pixels = (Uint8 *) font->glyphs->pixels + (i * font->gsize);
         for (int y = 0; y < glyph->height; y++)
         {
             if (dmfread(pixels, font->glyphs->format->BytesPerPixel,
--- a/tools/fontconv.c	Wed Mar 02 23:23:05 2022 +0200
+++ b/tools/fontconv.c	Thu Mar 10 22:36:48 2022 +0200
@@ -255,7 +255,7 @@
         DMBitmapGlyph *glyph = &font->glyphMap[index];
         if (glyph->index >= 0)
         {
-            Uint8 *pixels = font->glyphs->pixels + font->gsize * glyph->index;
+            Uint8 *pixels = (Uint8 *) font->glyphs->pixels + font->gsize * glyph->index;
 
             // Each glyph has its table index and w/h stored
             if (!dmf_write_le16(fp, index) ||
--- a/tools/libgfx.c	Wed Mar 02 23:23:05 2022 +0200
+++ b/tools/libgfx.c	Thu Mar 10 22:36:48 2022 +0200
@@ -1115,7 +1115,7 @@
     {
         res = dmError(DMERR_INIT_FAIL,
             "PNG: png_create_info_struct(%p) failed.\n",
-            png_ptr);
+            (void *) png_ptr);
         goto error;
     }
 
@@ -1240,7 +1240,7 @@
     {
         res = dmError(DMERR_INIT_FAIL,
             "PNG: png_create_info_struct(%p) failed.\n",
-            png_ptr);
+            (void *) png_ptr);
         goto error;
     }