- did a test compile as C++20 and fixed all warnings that got emitted.

This commit is contained in:
Christoph Oelckers 2022-07-15 09:17:50 +02:00
parent d310487ad4
commit 595975fcc7
6 changed files with 10 additions and 16 deletions

View file

@ -39,10 +39,7 @@
#undef OPAQUE
#endif
enum
{
OPAQUE = 65536,
};
constexpr int OPAQUE = 65536;
enum ETexMode
{

View file

@ -64,7 +64,7 @@ CUSTOM_CVAR(Int, con_scaletext, 0, CVAR_ARCHIVE) // Scale notify text at high r
if (self < 0) self = 0;
}
enum { NOTIFYFADETIME = 6 };
constexpr int NOTIFYFADETIME = 6;
CUSTOM_CVAR(Int, con_notifylines, 4, CVAR_GLOBALCONFIG | CVAR_ARCHIVE)
{

View file

@ -57,15 +57,15 @@ typedef enum
#endif
#endif
// State updates, number of tics / second.
constexpr int TICRATE = 35;
// Global constants that were defines.
enum
{
// The maximum number of players, multiplayer/networking.
MAXPLAYERS = 8,
// State updates, number of tics / second.
TICRATE = 35,
// Amount of damage done by a telefrag.
TELEFRAG_DAMAGE = 1000000
};

View file

@ -43,10 +43,7 @@ struct FBlockmap
// mapblocks are used to check movement
// against lines and things
enum
{
MAPBLOCKUNITS = 128
};
static constexpr int MAPBLOCKUNITS = 128;
inline int GetBlockX(double xpos)
{

View file

@ -92,8 +92,8 @@ namespace swrenderer
private:
void RenderSprite(DPSprite *pspr, AActor *owner, float bobx, float boby, double wx, double wy, double ticfrac, int lightlevel, FDynamicColormap *basecolormap, bool foggy);
enum { BASEXCENTER = 160 };
enum { BASEYCENTER = 100 };
static constexpr int BASEXCENTER = 160;
static constexpr int BASEYCENTER = 100;
TArray<HWAccelPlayerSprite> AcceleratedSprites;
sector_t tempsec;

View file

@ -173,8 +173,8 @@ class FNodeBuilder
fixed64_t MinX, MinY, MaxX, MaxY;
int BlocksWide, BlocksTall;
enum { BLOCK_SHIFT = 8 + FRACBITS };
enum { BLOCK_SIZE = 1 << BLOCK_SHIFT };
static constexpr int BLOCK_SHIFT = 8 + FRACBITS;
static constexpr int BLOCK_SIZE = 1 << BLOCK_SHIFT;
int InsertVertex (FPrivVert &vert);
inline int GetBlock (fixed64_t x, fixed64_t y)