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;