From 104bdb131b2cb7d0f5d3d5ac17c6e438b98bbcf5 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 23 Jul 2018 02:55:53 +0000 Subject: [PATCH] Fix warning: type qualifiers ignored on cast result type [-Wignored-qualifiers] git-svn-id: https://svn.eduke32.com/eduke32@6949 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/include/pragmas.h | 5 +++-- source/duke3d/src/actors.cpp | 2 +- source/duke3d/src/game.cpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/source/build/include/pragmas.h b/source/build/include/pragmas.h index 25338f618..37843a2ca 100644 --- a/source/build/include/pragmas.h +++ b/source/build/include/pragmas.h @@ -306,8 +306,9 @@ void copybufreverse(const void *S, void *D, int32_t c); static inline int32_t krecipasm(int32_t i) { // Ken did this - float const f = (float const)i; - i = *(int32_t const *)&f; + union { int32_t i; float f; } x; + x.f = (float)i; + i = x.i; return ((reciptable[(i >> 12) & 2047] >> (((i - 0x3f800000) >> 23) & 31)) ^ (i >> 31)); } #endif diff --git a/source/duke3d/src/actors.cpp b/source/duke3d/src/actors.cpp index 7fdc47920..757d3f45c 100644 --- a/source/duke3d/src/actors.cpp +++ b/source/duke3d/src/actors.cpp @@ -308,7 +308,7 @@ SKIPWALLCHECK: { if (pOther->picnum == APLAYER) { - DukePlayer_t *pPlayer = g_player[P_GetP((uspritetype * const)pOther)].ps; + DukePlayer_t *pPlayer = g_player[P_GetP((uspritetype *)pOther)].ps; if (pPlayer->newowner >= 0) G_ClearCameraView(pPlayer); diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 98b4194c9..91e86d598 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -655,7 +655,7 @@ static void G_ReadGLFrame(void) { // Save OpenGL screenshot with Duke3D palette // NOTE: maybe need to move this to the engine... - palette_t *const frame = (palette_t *const)Xcalloc(xdim * ydim, sizeof(palette_t)); + palette_t *const frame = (palette_t *)Xcalloc(xdim * ydim, sizeof(palette_t)); char *const pic = (char *) waloff[TILE_SAVESHOT]; int32_t x, y;