From b68f206969e14c03a9c7deac2a45d84375a6fafa Mon Sep 17 00:00:00 2001 From: Marco Antonio Jaguaribe Costa Date: Sat, 7 Oct 2023 08:29:59 -0300 Subject: [PATCH] remove annoying warning on MSVC 19.37.32822 `register` keyword does exactly nothing: https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5033?view=msvc-170 --- Tactical/BinaryHeap.hpp | 6 +++--- Tactical/DisplayCover.cpp | 16 ++++++++-------- Tactical/Items.cpp | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Tactical/BinaryHeap.hpp b/Tactical/BinaryHeap.hpp index 8d1697fe..c4b5df1b 100644 --- a/Tactical/BinaryHeap.hpp +++ b/Tactical/BinaryHeap.hpp @@ -102,7 +102,7 @@ public: return (returnHeap); } - int moveUp(register int index, KEY newKey) + int moveUp(int index, KEY newKey) { while (index > 1) { int current2 = index>>1;//divided by 2 @@ -120,7 +120,7 @@ public: int moveDown(int index, KEY currentKey) { - register int current2 = index+index; + int current2 = index+index; while (current2 < heapCount) { if (current2+1 < heapCount) { //choose child to possibly move @@ -314,7 +314,7 @@ insert: int findData(const T data) const { - register int current; + int current; for (current = heapCount-1; current > 0; --current) { if (BinaryHeap[current].data == data) { break; diff --git a/Tactical/DisplayCover.cpp b/Tactical/DisplayCover.cpp index 3d35841d..7d1a3676 100644 --- a/Tactical/DisplayCover.cpp +++ b/Tactical/DisplayCover.cpp @@ -373,7 +373,7 @@ BOOLEAN HasAdjTile( const INT32& ubX, const INT32& ubY, const INT32& ubZ ) void AddCoverObjectsToViewArea() { - register INT32 ubX, ubY, ubZ; + INT32 ubX, ubY, ubZ; BOOLEAN fChanged = FALSE; BOOLEAN fNightTime = NightTime( ); @@ -406,7 +406,7 @@ void RemoveCoverObjectsFromViewArea() return; // Go through the whole gCoverViewArea when removing cover objects. Otherwise we don't clean up tiles that are not in the viewport which results in an annoying visual bug. - register INT32 ubX, ubY, ubZ; + INT32 ubX, ubY, ubZ; BOOLEAN fChanged = FALSE; for ( ubX = 0; ubX < COVER_X_CELLS; ++ubX ) @@ -669,8 +669,8 @@ static void CalculateCoverFromEnemies() void CalculateCover() { - register INT32 ubX, ubY; - register INT8 ubZ; + INT32 ubX, ubY; + INT8 ubZ; SOLDIERTYPE* pSoldier; if (gusSelectedSoldier == NOBODY) @@ -1144,7 +1144,7 @@ void AddMinesObjectsToViewArea() if ( gsMaxCellY < 0 ) return; - register INT32 ubX, ubY, ubZ; + INT32 ubX, ubY, ubZ; BOOLEAN fChanged = FALSE; BOOLEAN fNightTime = NightTime( ); @@ -1503,7 +1503,7 @@ void AddTraitObjectsToViewArea() if ( gsMaxCellY < 0 ) return; - register INT32 ubX, ubY, ubZ; + INT32 ubX, ubY, ubZ; BOOLEAN fChanged = FALSE; BOOLEAN fNightTime = NightTime( ); @@ -1657,7 +1657,7 @@ void AddTrackerObjectsToViewArea( ) if ( gsMaxCellY < 0 ) return; - register INT32 ubX, ubY, ubZ; + INT32 ubX, ubY, ubZ; BOOLEAN fChanged = FALSE; BOOLEAN fNightTime = NightTime(); @@ -1731,7 +1731,7 @@ void CalculateFortify( ) if ( gsMaxCellY < 0 ) return; - register INT32 ubX, ubY, ubZ; + INT32 ubX, ubY, ubZ; BOOLEAN fChanged = FALSE; BOOLEAN fNightTime = NightTime( ); diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index 8212c736..e61c326c 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -15271,7 +15271,7 @@ BOOLEAN HasItemFlag( UINT16 usItem, UINT64 aFlag ) // Flugente: get first item number that has this flag. Use with caution, as we search in all items BOOLEAN GetFirstItemWithFlag( UINT16* pusItem, UINT64 aFlag ) { - register UINT16 i; + UINT16 i; for ( i = 1; i < gMAXITEMS_READ; ++i ) { if ( HasItemFlag(i, aFlag) ) @@ -15537,7 +15537,7 @@ BOOLEAN GetFirstClothesItemWithSpecificData( UINT16* pusItem, PaletteRepID aPalV UINT32 bestclothestype = 999999; UINT16 bestitem = 0; - register UINT16 i; + UINT16 i; for ( i = 1; i < gMAXITEMS_READ; ++i ) { if ( Item[i].clothestype > 0 )