From 4f0e3adfbb523e17035dadfbb010dcd12ad97e21 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 12 Jun 2020 16:49:35 +0200 Subject: [PATCH] - removed pointless constexpr declaration on numeric constants. --- source/common/scripting/core/dictionary.cpp | 2 +- source/core/inputstate.h | 4 ++-- source/duke3d/src/premap.cpp | 4 ++-- source/exhumed/src/player.cpp | 2 +- source/rr/src/player.cpp | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/source/common/scripting/core/dictionary.cpp b/source/common/scripting/core/dictionary.cpp index 753ac66fe..6d2b1d092 100644 --- a/source/common/scripting/core/dictionary.cpp +++ b/source/common/scripting/core/dictionary.cpp @@ -29,7 +29,7 @@ void Dictionary::Serialize(FSerializer &arc) { Super::Serialize(arc); - constexpr char key[] { "dictionary" }; + static const char key[] = "dictionary"; if (arc.isWriting()) { diff --git a/source/core/inputstate.h b/source/core/inputstate.h index 274047125..f61b75305 100644 --- a/source/core/inputstate.h +++ b/source/core/inputstate.h @@ -179,8 +179,8 @@ public: extern InputState inputState; -constexpr int analogExtent = 32767; // used as a divisor for scaling joystick input. -constexpr float joyaxesScale = (float)analogExtent * 0.75f; // used as a multiplier for scaling joystick input. +const int analogExtent = 32767; // used as a divisor for scaling joystick input. +const float joyaxesScale = (float)analogExtent * 0.75f; // used as a multiplier for scaling joystick input. void CONTROL_GetInput(ControlInfo* info); int32_t handleevents(void); diff --git a/source/duke3d/src/premap.cpp b/source/duke3d/src/premap.cpp index d55f60eb7..472a21cf8 100644 --- a/source/duke3d/src/premap.cpp +++ b/source/duke3d/src/premap.cpp @@ -407,8 +407,8 @@ static void G_DoLoadScreen(const char *statustext, int percent) if (percent != -1) { int const width = scale(scale(xdim-1, 288, 320), percent, 100); - int constexpr tile = 929; - int constexpr bits = 2+8+16; + int const tile = 929; + int const bits = 2+8+16; rotatesprite(31<<16 , 145<<16, 65536, 0, tile, 15, 0, bits, 0, 0, width, ydim-1); rotatesprite(159<<16, 145<<16, 65536, 0, tile, 15, 0, bits, 0, 0, width, ydim-1); diff --git a/source/exhumed/src/player.cpp b/source/exhumed/src/player.cpp index d9fd939dc..ff24f2108 100644 --- a/source/exhumed/src/player.cpp +++ b/source/exhumed/src/player.cpp @@ -188,7 +188,7 @@ void PlayerInterruptKeys() int const playerRunning = G_CheckAutorun(buttonMap.ButtonDown(gamefunc_Run)); int const turnAmount = playerRunning ? 12 : 8; int const keyMove = playerRunning ? 12 : 6; - constexpr int const analogTurnAmount = 12; + int const analogTurnAmount = 12; if (buttonMap.ButtonDown(gamefunc_Strafe)) { diff --git a/source/rr/src/player.cpp b/source/rr/src/player.cpp index 3248c0d8b..e2250df16 100644 --- a/source/rr/src/player.cpp +++ b/source/rr/src/player.cpp @@ -3254,7 +3254,7 @@ void P_GetInput(int const playerNum) int const playerRunning = G_CheckAutorun(buttonMap.ButtonDown(gamefunc_Run)); int const turnAmount = playerRunning ? (NORMALTURN << 1) : NORMALTURN; - constexpr int analogTurnAmount = (NORMALTURN << 1); + int const analogTurnAmount = (NORMALTURN << 1); int const keyMove = playerRunning ? (NORMALKEYMOVE << 1) : NORMALKEYMOVE; input_t input {}; @@ -3668,7 +3668,7 @@ void P_GetInputMotorcycle(int playerNum) // JBF: Run key behaviour is selectable int const playerRunning = G_CheckAutorun(buttonMap.ButtonDown(gamefunc_Run)); - constexpr int analogTurnAmount = (NORMALTURN << 1); + int const analogTurnAmount = (NORMALTURN << 1); int const keyMove = playerRunning ? (NORMALKEYMOVE << 1) : NORMALKEYMOVE; input_t input {}; @@ -3918,7 +3918,7 @@ void P_GetInputBoat(int playerNum) // JBF: Run key behaviour is selectable int const playerRunning = G_CheckAutorun(buttonMap.ButtonDown(gamefunc_Run)); - constexpr int analogTurnAmount = (NORMALTURN << 1); + int const analogTurnAmount = (NORMALTURN << 1); int const keyMove = playerRunning ? (NORMALKEYMOVE << 1) : NORMALKEYMOVE; input_t input {}; @@ -4159,7 +4159,7 @@ void P_DHGetInput(int const playerNum) int const playerCrouch = sub_299D8(); int const playerJump = buttonMap.ButtonDown(gamefunc_Jump) && !(pPlayer->cursectnum >= 0 && sector[pPlayer->cursectnum].hitag == 2003); int const turnAmount = playerCrouch ? 2 : (playerRunning ? 16 : 8); - constexpr int analogTurnAmount = 16; + int const analogTurnAmount = 16; int const keyMove = playerCrouch ? 3 : (playerRunning ? 24 : 12); input_t input {};