From 8d8fd61ed005004d04b125f0d90614c048004ce6 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 5 Jun 2017 10:05:29 +0000 Subject: [PATCH] Remove the register keyword, since it is deprecated in C++11 and removed in C++17. git-svn-id: https://svn.eduke32.com/eduke32@6143 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/include/m32script.h | 8 +-- source/build/src/wiibits.cpp | 4 +- source/duke3d/src/gamedef.cpp | 2 +- source/duke3d/src/gamestructures.cpp | 80 ++++++++++++++-------------- source/duke3d/src/m32def.cpp | 2 +- source/duke3d/src/m32exec.cpp | 6 +-- source/duke3d/src/m32structures.cpp | 2 +- source/duke3d/src/m32vars.cpp | 16 +++--- 8 files changed, 60 insertions(+), 60 deletions(-) diff --git a/source/build/include/m32script.h b/source/build/include/m32script.h index 0c498d502..8639fa390 100644 --- a/source/build/include/m32script.h +++ b/source/build/include/m32script.h @@ -40,7 +40,7 @@ extern char *apStrings[MAXQUOTES+1], *apXStrings[MAXQUOTES+1]; extern int32_t g_numQuoteRedefinitions; extern int32_t VM_Execute(int32_t once); -extern void VM_OnEvent(register int32_t iEventID, register int32_t iActor); +extern void VM_OnEvent(int32_t iEventID, int32_t iActor); extern void VM_ScriptInfo(void); extern void VM_Disasm(ofstype beg, int32_t size); @@ -49,9 +49,9 @@ extern int32_t Gv_NewVar(const char *pszLabel, intptr_t lValue, uint32_t dwFlags extern int32_t Gv_NewArray(const char *pszLabel, void *arrayptr, int32_t asize, uint32_t dwFlags); extern void Gv_Init(void); -extern int32_t __fastcall Gv_GetVarX(register int32_t id); -extern void __fastcall Gv_SetVarX(register int32_t id, register int32_t lValue); -extern int32_t __fastcall Gv_GetVarN(register int32_t id); // 'N' for "no side-effects"... vars and locals only! +extern int32_t __fastcall Gv_GetVarX(int32_t id); +extern void __fastcall Gv_SetVarX(int32_t id, int32_t lValue); +extern int32_t __fastcall Gv_GetVarN(int32_t id); // 'N' for "no side-effects"... vars and locals only! extern void SetGamePalette(int32_t); diff --git a/source/build/src/wiibits.cpp b/source/build/src/wiibits.cpp index 31fd47dc5..98b7dc7f2 100644 --- a/source/build/src/wiibits.cpp +++ b/source/build/src/wiibits.cpp @@ -454,8 +454,8 @@ extern void __wrap_c_default_exceptionhandler(frame_context *pCtx); static void _cpu_print_stack(void *pc,void *lr,void *r1) { - register u32 i = 0; - register frame_rec_t l,p = (frame_rec_t)lr; + u32 i = 0; + frame_rec_t l,p = (frame_rec_t)lr; l = p; p = (frame_rec_t)r1; diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index bc8bcf413..b068485e2 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -2135,7 +2135,7 @@ static inline uint32_t C_Pow2IntLogBase2(int32_t const v) 0xFF00FF00, 0xFFFF0000 }; - register uint32_t r = (v & b[0]) != 0; + uint32_t r = (v & b[0]) != 0; for (bssize_t i = 4; i > 0; i--) r |= ((v & b[i]) != 0) << i; diff --git a/source/duke3d/src/gamestructures.cpp b/source/duke3d/src/gamestructures.cpp index 3b0526494..bf215e7f4 100644 --- a/source/duke3d/src/gamestructures.cpp +++ b/source/duke3d/src/gamestructures.cpp @@ -24,28 +24,28 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // I got a 3-4 fps gain by inlining these... #ifndef gamevars_c_ -int32_t __fastcall VM_GetUserdef(register int32_t labelNum); -void __fastcall VM_SetUserdef(register int32_t const labelNum, register int32_t const iSet); -int32_t __fastcall VM_GetActiveProjectile(register int32_t const spriteNum, register int32_t labelNum); -void __fastcall VM_SetActiveProjectile(register int32_t const spriteNum, register int32_t const labelNum, register int32_t const iSet); -int32_t __fastcall VM_GetPlayer(register int32_t const playerNum, register int32_t labelNum, register int32_t const lParm2); -void __fastcall VM_SetPlayer(register int32_t const playerNum, register int32_t const labelNum, register int32_t const lParm2, register int32_t const iSet); -int32_t __fastcall VM_GetPlayerInput(register int32_t const playerNum, register int32_t labelNum); -void __fastcall VM_SetPlayerInput(register int32_t const playerNum, register int32_t const labelNum, register int32_t const iSet); -int32_t __fastcall VM_GetWall(register int32_t const wallNum, register int32_t labelNum); -void __fastcall VM_SetWall(register int32_t const wallNum, register int32_t const labelNum, register int32_t const iSet); -int32_t __fastcall VM_GetSector(register int32_t const sectNum, register int32_t labelNum); -void __fastcall VM_SetSector(register int32_t const sectNum, register int32_t const labelNum, register int32_t iSet); -int32_t __fastcall VM_GetSprite(register int32_t const spriteNum, register int32_t labelNum, register int32_t const lParm2); -void __fastcall VM_SetSprite(register int32_t const spriteNum, register int32_t const labelNum, register int32_t const lParm2, register int32_t const iSet); -int32_t __fastcall VM_GetTsprite(register int32_t const spriteNum, register int32_t labelNum); -void __fastcall VM_SetTsprite(register int32_t const spriteNum, register int32_t const labelNum, register int32_t const iSet); -int32_t __fastcall VM_GetProjectile(register int32_t const tileNum, register int32_t labelNum); -void __fastcall VM_SetProjectile(register int32_t const tileNum, register int32_t const labelNum, register int32_t const iSet); -int32_t __fastcall VM_GetTileData(register int32_t const tileNum, register int32_t labelNum); -int32_t __fastcall VM_GetPalData(register int32_t const palNum, register int32_t labelNum); +int32_t __fastcall VM_GetUserdef(int32_t labelNum); +void __fastcall VM_SetUserdef(int32_t const labelNum, int32_t const iSet); +int32_t __fastcall VM_GetActiveProjectile(int32_t const spriteNum, int32_t labelNum); +void __fastcall VM_SetActiveProjectile(int32_t const spriteNum, int32_t const labelNum, int32_t const iSet); +int32_t __fastcall VM_GetPlayer(int32_t const playerNum, int32_t labelNum, int32_t const lParm2); +void __fastcall VM_SetPlayer(int32_t const playerNum, int32_t const labelNum, int32_t const lParm2, int32_t const iSet); +int32_t __fastcall VM_GetPlayerInput(int32_t const playerNum, int32_t labelNum); +void __fastcall VM_SetPlayerInput(int32_t const playerNum, int32_t const labelNum, int32_t const iSet); +int32_t __fastcall VM_GetWall(int32_t const wallNum, int32_t labelNum); +void __fastcall VM_SetWall(int32_t const wallNum, int32_t const labelNum, int32_t const iSet); +int32_t __fastcall VM_GetSector(int32_t const sectNum, int32_t labelNum); +void __fastcall VM_SetSector(int32_t const sectNum, int32_t const labelNum, int32_t iSet); +int32_t __fastcall VM_GetSprite(int32_t const spriteNum, int32_t labelNum, int32_t const lParm2); +void __fastcall VM_SetSprite(int32_t const spriteNum, int32_t const labelNum, int32_t const lParm2, int32_t const iSet); +int32_t __fastcall VM_GetTsprite(int32_t const spriteNum, int32_t labelNum); +void __fastcall VM_SetTsprite(int32_t const spriteNum, int32_t const labelNum, int32_t const iSet); +int32_t __fastcall VM_GetProjectile(int32_t const tileNum, int32_t labelNum); +void __fastcall VM_SetProjectile(int32_t const tileNum, int32_t const labelNum, int32_t const iSet); +int32_t __fastcall VM_GetTileData(int32_t const tileNum, int32_t labelNum); +int32_t __fastcall VM_GetPalData(int32_t const palNum, int32_t labelNum); #else -int32_t __fastcall VM_GetUserdef(register int32_t labelNum) +int32_t __fastcall VM_GetUserdef(int32_t labelNum) { switch (labelNum) { @@ -175,7 +175,7 @@ int32_t __fastcall VM_GetUserdef(register int32_t labelNum) return labelNum; } -void __fastcall VM_SetUserdef(register int32_t const labelNum, register int32_t const iSet) +void __fastcall VM_SetUserdef(int32_t const labelNum, int32_t const iSet) { switch (labelNum) { @@ -292,7 +292,7 @@ void __fastcall VM_SetUserdef(register int32_t const labelNum, register int32_t } } -int32_t __fastcall VM_GetActiveProjectile(register int32_t const spriteNum, register int32_t labelNum) +int32_t __fastcall VM_GetActiveProjectile(int32_t const spriteNum, int32_t labelNum) { if (EDUKE32_PREDICT_FALSE((unsigned)spriteNum >= MAXSPRITES)) { @@ -341,7 +341,7 @@ int32_t __fastcall VM_GetActiveProjectile(register int32_t const spriteNum, regi return labelNum; } -void __fastcall VM_SetActiveProjectile(register int32_t const spriteNum, register int32_t const labelNum, register int32_t const iSet) +void __fastcall VM_SetActiveProjectile(int32_t const spriteNum, int32_t const labelNum, int32_t const iSet) { if (EDUKE32_PREDICT_FALSE((unsigned)spriteNum >= MAXSPRITES)) { @@ -388,7 +388,7 @@ void __fastcall VM_SetActiveProjectile(register int32_t const spriteNum, registe } } -int32_t __fastcall VM_GetPlayer(register int32_t const playerNum, register int32_t labelNum, register int32_t const lParm2) +int32_t __fastcall VM_GetPlayer(int32_t const playerNum, int32_t labelNum, int32_t const lParm2) { if (EDUKE32_PREDICT_FALSE((unsigned)playerNum >= (unsigned)g_mostConcurrentPlayers)) { @@ -572,7 +572,7 @@ int32_t __fastcall VM_GetPlayer(register int32_t const playerNum, register int32 return labelNum; } -void __fastcall VM_SetPlayer(register int32_t const playerNum, register int32_t const labelNum, register int32_t const lParm2, register int32_t const iSet) +void __fastcall VM_SetPlayer(int32_t const playerNum, int32_t const labelNum, int32_t const lParm2, int32_t const iSet) { if (EDUKE32_PREDICT_FALSE((unsigned)playerNum >= (unsigned)g_mostConcurrentPlayers)) @@ -767,7 +767,7 @@ void __fastcall VM_SetPlayer(register int32_t const playerNum, register int32_t } } -int32_t __fastcall VM_GetPlayerInput(register int32_t const playerNum, register int32_t labelNum) +int32_t __fastcall VM_GetPlayerInput(int32_t const playerNum, int32_t labelNum) { if (EDUKE32_PREDICT_FALSE((unsigned)playerNum >= (unsigned)g_mostConcurrentPlayers)) { @@ -791,7 +791,7 @@ int32_t __fastcall VM_GetPlayerInput(register int32_t const playerNum, register return labelNum; } -void __fastcall VM_SetPlayerInput(register int32_t const playerNum, register int32_t const labelNum, register int32_t const iSet) +void __fastcall VM_SetPlayerInput(int32_t const playerNum, int32_t const labelNum, int32_t const iSet) { if (EDUKE32_PREDICT_FALSE((unsigned)playerNum >= (unsigned)g_mostConcurrentPlayers)) { @@ -815,7 +815,7 @@ void __fastcall VM_SetPlayerInput(register int32_t const playerNum, register int -int32_t __fastcall VM_GetWall(register int32_t const wallNum, register int32_t labelNum) +int32_t __fastcall VM_GetWall(int32_t const wallNum, int32_t labelNum) { if (EDUKE32_PREDICT_FALSE((unsigned)wallNum >= (unsigned)numwalls)) { @@ -852,7 +852,7 @@ int32_t __fastcall VM_GetWall(register int32_t const wallNum, register int32_t l return labelNum; } -void __fastcall VM_SetWall(register int32_t const wallNum, register int32_t const labelNum, register int32_t const iSet) +void __fastcall VM_SetWall(int32_t const wallNum, int32_t const labelNum, int32_t const iSet) { if (EDUKE32_PREDICT_FALSE((unsigned)wallNum >= (unsigned)numwalls)) { @@ -888,7 +888,7 @@ void __fastcall VM_SetWall(register int32_t const wallNum, register int32_t cons return; } -int32_t __fastcall VM_GetSector(register int32_t const sectNum, register int32_t labelNum) +int32_t __fastcall VM_GetSector(int32_t const sectNum, int32_t labelNum) { if (EDUKE32_PREDICT_FALSE((unsigned)sectNum >= (unsigned)numsectors)) { @@ -946,7 +946,7 @@ int32_t __fastcall VM_GetSector(register int32_t const sectNum, register int32_t return labelNum; } -void __fastcall VM_SetSector(register int32_t const sectNum, register int32_t const labelNum, register int32_t iSet) +void __fastcall VM_SetSector(int32_t const sectNum, int32_t const labelNum, int32_t iSet) { if (EDUKE32_PREDICT_FALSE((unsigned)sectNum >= (unsigned)numsectors)) { @@ -1002,7 +1002,7 @@ void __fastcall VM_SetSector(register int32_t const sectNum, register int32_t co } } -void __fastcall VM_SetSprite(register int32_t const spriteNum, register int32_t const labelNum, register int32_t const lParm2, register int32_t const iSet) +void __fastcall VM_SetSprite(int32_t const spriteNum, int32_t const labelNum, int32_t const lParm2, int32_t const iSet) { if (EDUKE32_PREDICT_FALSE((unsigned)spriteNum >= MAXSPRITES)) { @@ -1079,7 +1079,7 @@ void __fastcall VM_SetSprite(register int32_t const spriteNum, register int32_t } -int32_t __fastcall VM_GetSprite(register int32_t const spriteNum, register int32_t labelNum, register int32_t const lParm2) +int32_t __fastcall VM_GetSprite(int32_t const spriteNum, int32_t labelNum, int32_t const lParm2) { if (EDUKE32_PREDICT_FALSE((unsigned)spriteNum >= MAXSPRITES)) { @@ -1159,7 +1159,7 @@ int32_t __fastcall VM_GetSprite(register int32_t const spriteNum, register int32 return labelNum; } -int32_t __fastcall VM_GetTsprite(register int32_t const spriteNum, register int32_t labelNum) +int32_t __fastcall VM_GetTsprite(int32_t const spriteNum, int32_t labelNum) { if (EDUKE32_PREDICT_FALSE((unsigned)spriteNum >= MAXSPRITES)) { @@ -1208,7 +1208,7 @@ int32_t __fastcall VM_GetTsprite(register int32_t const spriteNum, register int3 return labelNum; } -void __fastcall VM_SetTsprite(register int32_t const spriteNum, register int32_t const labelNum, register int32_t const iSet) +void __fastcall VM_SetTsprite(int32_t const spriteNum, int32_t const labelNum, int32_t const iSet) { if (EDUKE32_PREDICT_FALSE((unsigned)spriteNum >= MAXSPRITES)) { @@ -1254,7 +1254,7 @@ void __fastcall VM_SetTsprite(register int32_t const spriteNum, register int32_t } } -int32_t __fastcall VM_GetProjectile(register int32_t const tileNum, register int32_t labelNum) +int32_t __fastcall VM_GetProjectile(int32_t const tileNum, int32_t labelNum) { if (EDUKE32_PREDICT_FALSE((unsigned)tileNum >= MAXTILES)) { @@ -1308,7 +1308,7 @@ int32_t __fastcall VM_GetProjectile(register int32_t const tileNum, register int return labelNum; } -void __fastcall VM_SetProjectile(register int32_t const tileNum, register int32_t const labelNum, register int32_t const iSet) +void __fastcall VM_SetProjectile(int32_t const tileNum, int32_t const labelNum, int32_t const iSet) { if (EDUKE32_PREDICT_FALSE((unsigned)tileNum >= MAXTILES)) { @@ -1359,7 +1359,7 @@ void __fastcall VM_SetProjectile(register int32_t const tileNum, register int32_ } } -int32_t __fastcall VM_GetTileData(register int32_t const tileNum, register int32_t labelNum) +int32_t __fastcall VM_GetTileData(int32_t const tileNum, int32_t labelNum) { if (EDUKE32_PREDICT_FALSE((unsigned)tileNum >= MAXTILES)) { @@ -1386,7 +1386,7 @@ int32_t __fastcall VM_GetTileData(register int32_t const tileNum, register int32 return labelNum; } -int32_t __fastcall VM_GetPalData(register int32_t const palNum, register int32_t labelNum) +int32_t __fastcall VM_GetPalData(int32_t const palNum, int32_t labelNum) { if (EDUKE32_PREDICT_FALSE((unsigned)palNum >= MAXPALOOKUPS)) { diff --git a/source/duke3d/src/m32def.cpp b/source/duke3d/src/m32def.cpp index e66f99522..db856b10a 100644 --- a/source/duke3d/src/m32def.cpp +++ b/source/duke3d/src/m32def.cpp @@ -1529,7 +1529,7 @@ static inline uint32_t C_Pow2IntLogBase2(int32_t v) static const uint32_t b[] = {0xAAAAAAAA, 0xCCCCCCCC, 0xF0F0F0F0, 0xFF00FF00, 0xFFFF0000 }; - register uint32_t r = (v & b[0]) != 0; + uint32_t r = (v & b[0]) != 0; int32_t i = 4; for (; i > 0; i--) diff --git a/source/duke3d/src/m32exec.cpp b/source/duke3d/src/m32exec.cpp index 29ff15fbc..381b262bd 100644 --- a/source/duke3d/src/m32exec.cpp +++ b/source/duke3d/src/m32exec.cpp @@ -122,7 +122,7 @@ void M32_PostScriptExec(void) } } -void VM_OnEvent(register int32_t iEventID, register int32_t spriteNum) +void VM_OnEvent(int32_t iEventID, int32_t spriteNum) { if (iEventID < 0 || iEventID >= MAXEVENTS) { @@ -201,7 +201,7 @@ static int32_t G_GetAngleDelta(int32_t a,int32_t na) return na-a; } -static inline void __fastcall VM_DoConditional(register int32_t condition) +static inline void __fastcall VM_DoConditional(int32_t condition) { if (condition) { @@ -308,7 +308,7 @@ static int CheckArray(int aidx) int32_t VM_Execute(int32_t once) { - register int32_t tw = *insptr; + int32_t tw = *insptr; // jump directly into the loop, saving us from the checks during the first iteration goto skip_check; diff --git a/source/duke3d/src/m32structures.cpp b/source/duke3d/src/m32structures.cpp index a821babbd..7752abdc0 100644 --- a/source/duke3d/src/m32structures.cpp +++ b/source/duke3d/src/m32structures.cpp @@ -279,7 +279,7 @@ readonly: static int32_t __fastcall VM_AccessSprite(int32_t how, int32_t lVar1, int32_t labelNum, int32_t lVar2) { int32_t lValue; - register int32_t i = (how&ACCESS_USEVARS) ? vm.spriteNum : lVar1; + int32_t i = (how&ACCESS_USEVARS) ? vm.spriteNum : lVar1; if ((how&ACCESS_USEVARS) && lVar1 != M32_THISACTOR_VAR_ID) i = Gv_GetVarX(lVar1); diff --git a/source/duke3d/src/m32vars.cpp b/source/duke3d/src/m32vars.cpp index f8bdbd497..fd4c1da2f 100644 --- a/source/duke3d/src/m32vars.cpp +++ b/source/duke3d/src/m32vars.cpp @@ -214,7 +214,7 @@ int32_t Gv_NewVar(const char *pszLabel, intptr_t lValue, uint32_t dwFlags) return 1; } -int32_t __fastcall Gv_GetVarN(register int32_t id) // 'N' for "no side-effects"... vars and locals only! +int32_t __fastcall Gv_GetVarN(int32_t id) // 'N' for "no side-effects"... vars and locals only! { if (id == M32_THISACTOR_VAR_ID) return vm.spriteNum; @@ -255,9 +255,9 @@ int32_t __fastcall Gv_GetVarN(register int32_t id) // 'N' for "no side-effects" } } -int32_t __fastcall Gv_GetVarX(register int32_t id) +int32_t __fastcall Gv_GetVarX(int32_t id) { - register int32_t negateResult = !!(id&M32_FLAG_NEGATE); + int32_t negateResult = !!(id&M32_FLAG_NEGATE); if (id == M32_THISACTOR_VAR_ID) return vm.spriteNum; @@ -285,7 +285,7 @@ int32_t __fastcall Gv_GetVarX(register int32_t id) { case M32_FLAG_ARRAY: { - register int32_t index; + int32_t index; index = (int32_t)((id>>16)&0xffff); if (!(id&M32_FLAG_CONSTANTINDEX)) @@ -321,7 +321,7 @@ int32_t __fastcall Gv_GetVarX(register int32_t id) } case M32_FLAG_STRUCT: { - register int32_t index, memberid; + int32_t index, memberid; index = (id>>16)&0x7fff; if (!(id&M32_FLAG_CONSTANTINDEX)) @@ -381,13 +381,13 @@ int32_t __fastcall Gv_GetVarX(register int32_t id) } -void __fastcall Gv_SetVarX(register int32_t id, register int32_t lValue) +void __fastcall Gv_SetVarX(int32_t id, int32_t lValue) { switch (id&M32_VARTYPE_MASK) { case M32_FLAG_ARRAY: { - register int32_t index; + int32_t index; index = (id>>16)&0xffff; if (!(id&M32_FLAG_CONSTANTINDEX)) @@ -427,7 +427,7 @@ void __fastcall Gv_SetVarX(register int32_t id, register int32_t lValue) } case M32_FLAG_STRUCT: { - register int32_t index, memberid; + int32_t index, memberid; index = (id>>16)&0x7fff; if (!(id&M32_FLAG_CONSTANTINDEX))