From 3d3348c2b8fdd6b31c687f8f6e3224d6345fc1a5 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 8 Apr 2019 06:27:31 +0000 Subject: [PATCH] SW: Fix -fpermissive function pointer type errors git-svn-id: https://svn.eduke32.com/eduke32@7523 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/sw/src/save.cpp | 7 ++++++- source/sw/src/text.cpp | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/source/sw/src/save.cpp b/source/sw/src/save.cpp index 655051b2c..dc938eb23 100644 --- a/source/sw/src/save.cpp +++ b/source/sw/src/save.cpp @@ -171,7 +171,7 @@ int SaveSymDataInfo(MFILE_WRITE fil, void *ptr) return 0; } -int SaveSymCodeInfo(MFILE_WRITE fil, void *ptr) +static int SaveSymCodeInfo_raw(MFILE_WRITE fil, void *ptr) { savedcodesym sym; @@ -192,6 +192,11 @@ int SaveSymCodeInfo(MFILE_WRITE fil, void *ptr) return 0; } +template +static int SaveSymCodeInfo(MFILE_WRITE fil, T * ptr) +{ + return SaveSymCodeInfo_raw(fil, (void *)ptr); +} int LoadSymDataInfo(MFILE_READ fil, void **ptr) { diff --git a/source/sw/src/text.cpp b/source/sw/src/text.cpp index 75baae318..9d5faaf10 100644 --- a/source/sw/src/text.cpp +++ b/source/sw/src/text.cpp @@ -171,7 +171,7 @@ PutStringTimer(PLAYERp pp, short x, short y, const char *string, short seconds) extern unsigned short xlatfont[]; long kill_tics; short id, ac; - void *func; + PANEL_SPRITE_FUNCp func; offset = x; @@ -200,7 +200,7 @@ PutStringTimer(PLAYERp pp, short x, short y, const char *string, short seconds) if (c > asc_Space && c < 127) { nsp = pSpawnFullViewSprite(pp, ac, PRI_FRONT_MAX, offset, y); - nsp->PanelSpriteFunc = (PANEL_SPRITE_FUNCp)func; + nsp->PanelSpriteFunc = func; nsp->kill_tics = kill_tics; nsp->ID = id; offset += tilesiz[ac].x;