Skip to content

Commit 244935b

Browse files
authored
refactor: Rename CONSTEXPR to constexpr (#1567)
1 parent bb39cc7 commit 244935b

File tree

15 files changed

+22
-26
lines changed

15 files changed

+22
-26
lines changed

Core/GameEngineDevice/Source/StdDevice/Common/StdBIGFile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ File* StdBIGFile::openFile( const Char *filename, Int access )
8686
// whoever is opening this file wants write access, so copy the file to the local disk
8787
// and return that file pointer.
8888

89-
CONSTEXPR size_t bufferSize = 0;
89+
constexpr size_t bufferSize = 0;
9090
File *localFile = TheLocalFileSystem->openFile(filename, access, bufferSize);
9191
if (localFile != NULL) {
9292
ramFile->copyDataToFile(localFile);

Core/GameEngineDevice/Source/Win32Device/Common/Win32BIGFile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ File* Win32BIGFile::openFile( const Char *filename, Int access )
8686
// whoever is opening this file wants write access, so copy the file to the local disk
8787
// and return that file pointer.
8888

89-
CONSTEXPR size_t bufferSize = 0;
89+
constexpr size_t bufferSize = 0;
9090
File *localFile = TheLocalFileSystem->openFile(filename, access, bufferSize);
9191
if (localFile != NULL) {
9292
ramFile->copyDataToFile(localFile);

Dependencies/Utility/Utility/CppMacros.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,8 @@
3838

3939
#if __cplusplus >= 201103L
4040
#define CPP_11(code) code
41-
#define CONSTEXPR constexpr
4241
#else
4342
#define CPP_11(code)
44-
#define CONSTEXPR
45-
#endif
46-
47-
#if __cplusplus < 201103L
48-
#define static_assert(expr, msg)
43+
#define static_assert(expr, msg)
44+
#define constexpr
4945
#endif

Generals/Code/GameEngine/Include/Common/GlobalData.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ enum AIDebugOptions CPP_11(: Int);
5252

5353
// PUBLIC /////////////////////////////////////////////////////////////////////////////////////////
5454

55-
CONSTEXPR const Int MAX_GLOBAL_LIGHTS = 3;
56-
CONSTEXPR const Int SIMULATE_REPLAYS_SEQUENTIAL = -1;
55+
constexpr const Int MAX_GLOBAL_LIGHTS = 3;
56+
constexpr const Int SIMULATE_REPLAYS_SEQUENTIAL = -1;
5757

5858
//-------------------------------------------------------------------------------------------------
5959
class CommandLineData

Generals/Code/GameEngine/Include/Common/SparseMatchFinder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ class SparseMatchFinder
202202
//-------------------------------------------------------------------------------------------------
203203
SparseMatchFinder& operator=(const SparseMatchFinder& other)
204204
{
205-
if CONSTEXPR ((FLAGS & SparseMatchFinderFlags_NoCopy) == 0)
205+
if constexpr ((FLAGS & SparseMatchFinderFlags_NoCopy) == 0)
206206
{
207207
if (this != &other)
208208
{

Generals/Code/GameEngine/Source/Common/Recorder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
#include "Common/CRCDebug.h"
4848
#include "Common/version.h"
4949

50-
CONSTEXPR const char s_genrep[] = "GENREP";
51-
CONSTEXPR const UnsignedInt replayBufferBytes = 8192;
50+
constexpr const char s_genrep[] = "GENREP";
51+
constexpr const UnsignedInt replayBufferBytes = 8192;
5252

5353
Int REPLAY_CRC_INTERVAL = 100;
5454

Generals/Code/GameEngine/Source/GameClient/Input/Mouse.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ void Mouse::initCapture()
10721072
// ------------------------------------------------------------------------------------------------
10731073
Bool Mouse::canCapture() const
10741074
{
1075-
CONSTEXPR const CursorCaptureBlockReasonInt noGameBits = CursorCaptureBlockReason_NoGame | CursorCaptureBlockReason_Paused;
1075+
constexpr const CursorCaptureBlockReasonInt noGameBits = CursorCaptureBlockReason_NoGame | CursorCaptureBlockReason_Paused;
10761076

10771077
switch (m_cursorCaptureMode)
10781078
{

Generals/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ static Bool scrollDir[4] = { false, false, false, false };
7373
// The multiplier of 2 was logically chosen because originally the Scroll Factor did practically not affect the RMB scroll speed
7474
// and because the default Scroll Factor is/was 0.5, it needs to be doubled to get to a neutral 1x multiplier.
7575

76-
CONSTEXPR const Real SCROLL_MULTIPLIER = 2.0f;
77-
CONSTEXPR const Real SCROLL_AMT = 100.0f * SCROLL_MULTIPLIER;
76+
constexpr const Real SCROLL_MULTIPLIER = 2.0f;
77+
constexpr const Real SCROLL_AMT = 100.0f * SCROLL_MULTIPLIER;
7878

7979
static const Int edgeScrollSize = 3;
8080

Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,7 @@ void W3DView::scrollBy( Coord2D *delta )
16561656
// if we haven't moved, ignore
16571657
if( delta && (delta->x != 0 || delta->y != 0) )
16581658
{
1659-
CONSTEXPR const Real SCROLL_RESOLUTION = 250.0f;
1659+
constexpr const Real SCROLL_RESOLUTION = 250.0f;
16601660

16611661
Vector3 world, worldStart, worldEnd;
16621662
Vector2 start, end;

GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ enum AIDebugOptions CPP_11(: Int);
5353

5454
// PUBLIC /////////////////////////////////////////////////////////////////////////////////////////
5555

56-
CONSTEXPR const Int MAX_GLOBAL_LIGHTS = 3;
57-
CONSTEXPR const Int SIMULATE_REPLAYS_SEQUENTIAL = -1;
56+
constexpr const Int MAX_GLOBAL_LIGHTS = 3;
57+
constexpr const Int SIMULATE_REPLAYS_SEQUENTIAL = -1;
5858

5959
//-------------------------------------------------------------------------------------------------
6060
class CommandLineData

0 commit comments

Comments
 (0)