Skip to content

Commit ef93f8e

Browse files
authored
[GEN][ZH] Fix compile warnings from the use of deprecated register keywords (#806)
1 parent 47e08d0 commit ef93f8e

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

Dependencies/Utility/Utility/CppMacros.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,9 @@
3737
#else
3838
#define CPP_11(code)
3939
#endif
40+
41+
#if __cplusplus >= 201703L
42+
#define REGISTER
43+
#else
44+
#define REGISTER register
45+
#endif

Generals/Code/Libraries/Source/WWVegas/WW3D2/intersec.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include "camera.h"
4141
#include "scene.h"
4242
#include "intersec.inl"
43+
#include "Utility/CppMacros.h"
4344

4445

4546
//////////////////////////////////////////////////////////////////////
@@ -190,7 +191,7 @@ bool IntersectionClass::Intersect_Box(Vector3 &Box_Min, Vector3 &Box_Max, Inters
190191
float distance[PLANE_COUNT];
191192
float candidate_plane[PLANE_COUNT];
192193

193-
register Vector3 *intersection = &FinalResult->Intersection;
194+
REGISTER Vector3 *intersection = &FinalResult->Intersection;
194195

195196
// Find candidate planes and determine if the ray is outside the box
196197
for (counter = 0; counter < PLANE_COUNT; counter++) {

GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252

5353
#include "Common/UnitTimings.h" //Contains the DO_UNIT_TIMINGS define jba.
5454

55+
#include "Utility/CppMacros.h"
5556

5657
#define no_INTENSE_DEBUG
5758

@@ -2641,7 +2642,7 @@ void PathfindZoneManager::calculateZones( PathfindCell **map, PathfindLayer laye
26412642
// // DEBUG_ASSERTCRASH(map[i][j].getZone() != 0, ("Cleared the zone."));
26422643
// }
26432644
// }
2644-
register UnsignedInt maxZone = m_maxZone;
2645+
REGISTER UnsignedInt maxZone = m_maxZone;
26452646
j=globalBounds.lo.y;
26462647
while( j <= globalBounds.hi.y )
26472648
{
@@ -2754,7 +2755,7 @@ void PathfindZoneManager::calculateZones( PathfindCell **map, PathfindLayer laye
27542755
//FLATTEN HIERARCHICAL ZONES
27552756
{
27562757
i = 1;
2757-
register Int zone;
2758+
REGISTER Int zone;
27582759
while ( i < maxZone )
27592760
{ // Flatten hierarchical zones.
27602761
zone = m_hierarchicalZones[i];

GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/intersec.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include "camera.h"
4141
#include "scene.h"
4242
#include "intersec.inl"
43+
#include "Utility/CppMacros.h"
4344

4445

4546
//////////////////////////////////////////////////////////////////////
@@ -190,7 +191,7 @@ bool IntersectionClass::Intersect_Box(Vector3 &Box_Min, Vector3 &Box_Max, Inters
190191
float distance[PLANE_COUNT];
191192
float candidate_plane[PLANE_COUNT];
192193

193-
register Vector3 *intersection = &FinalResult->Intersection;
194+
REGISTER Vector3 *intersection = &FinalResult->Intersection;
194195

195196
// Find candidate planes and determine if the ray is outside the box
196197
for (counter = 0; counter < PLANE_COUNT; counter++) {

0 commit comments

Comments
 (0)