# HG changeset patch # User Matti Hamalainen # Date 1646944608 -7200 # Node ID 92b93a12c014d9a1840651f509d1744495053ae9 # Parent bb44c48cffac284f0d4d7d64b7b0a9fbd50f0959 Make some casts explicit instead of implicit, fixes some -pedantic warnings. diff -r bb44c48cffac -r 92b93a12c014 src/dmimage.c --- 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; diff -r bb44c48cffac -r 92b93a12c014 src/dmres.c --- 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 diff -r bb44c48cffac -r 92b93a12c014 src/dmtext.h --- 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 diff -r bb44c48cffac -r 92b93a12c014 src/dmtext_bm.c --- 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, diff -r bb44c48cffac -r 92b93a12c014 tools/fontconv.c --- 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) || diff -r bb44c48cffac -r 92b93a12c014 tools/libgfx.c --- 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; }