From 6db4ac3b019287c7882eae9634268b531fbd5118 Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 19 May 2019 03:54:17 +0000 Subject: [PATCH] const correctness that I didn't have another commit to squash into git-svn-id: https://svn.eduke32.com/eduke32@7648 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/gamedef.h | 2 +- source/duke3d/src/gameexec.cpp | 10 +++++----- source/duke3d/src/gameexec.h | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/source/duke3d/src/gamedef.h b/source/duke3d/src/gamedef.h index 3761db455..976f74400 100644 --- a/source/duke3d/src/gamedef.h +++ b/source/duke3d/src/gamedef.h @@ -77,7 +77,7 @@ enum #if !defined LUNATIC extern intptr_t const * insptr; -extern void VM_ScriptInfo(intptr_t const *ptr, int range); +void VM_ScriptInfo(intptr_t const * const ptr, int const range); #endif extern hashtable_t h_gamefuncs; diff --git a/source/duke3d/src/gameexec.cpp b/source/duke3d/src/gameexec.cpp index 3d75b77b4..b89ba0ff0 100644 --- a/source/duke3d/src/gameexec.cpp +++ b/source/duke3d/src/gameexec.cpp @@ -77,7 +77,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop = false); #endif #if !defined LUNATIC -void VM_ScriptInfo(intptr_t const *ptr, int range) +void VM_ScriptInfo(intptr_t const * const ptr, int const range) { if (!apScript || !ptr || g_currentEvent == -1) return; @@ -202,7 +202,7 @@ static FORCE_INLINE int32_t VM_EventInlineInternal__(int const &eventNum, int co } #endif -// the idea here is that the compiler inlines the call to VM_OnEvent_Internal__() and gives us a set of +// the idea here is that the compiler inlines the call to VM_EventInlineInternal__() and gives us a set of // functions which are optimized further based on distance/return having values known at compile time int32_t VM_ExecuteEvent(int const nEventID, int const spriteNum, int const playerNum, int const nDist, int32_t const nReturn) @@ -312,7 +312,7 @@ bool A_Dodge(spritetype * const pSprite) return 0; } -int A_GetFurthestAngle(int spriteNum, int angDiv) +int A_GetFurthestAngle(int const spriteNum, int const angDiv) { auto const pSprite = (uspriteptr_t)&sprite[spriteNum]; @@ -6221,7 +6221,7 @@ badindex: } // NORECURSE -void A_LoadActor(int32_t spriteNum) +void A_LoadActor(int const spriteNum) { vm.spriteNum = spriteNum; // Sprite ID vm.pSprite = &sprite[spriteNum]; // Pointer to sprite structure @@ -6252,7 +6252,7 @@ void A_LoadActor(int32_t spriteNum) } #endif -void VM_UpdateAnim(int spriteNum, int32_t *pData) +void VM_UpdateAnim(int const spriteNum, int32_t * const pData) { #if !defined LUNATIC size_t const actionofs = AC_ACTION_ID(pData); diff --git a/source/duke3d/src/gameexec.h b/source/duke3d/src/gameexec.h index efbdc2a72..6e349bc91 100644 --- a/source/duke3d/src/gameexec.h +++ b/source/duke3d/src/gameexec.h @@ -85,7 +85,7 @@ extern int32_t g_tw; extern int32_t g_errorLineNum; extern int32_t g_currentEvent; -void A_LoadActor(int32_t spriteNum); +void A_LoadActor(int const spriteNum); #endif extern uint32_t g_eventCalls[MAXEVENTS], g_actorCalls[MAXTILES]; @@ -93,7 +93,7 @@ extern double g_eventTotalMs[MAXEVENTS], g_actorTotalMs[MAXTILES], g_actorMinMs[ void A_Execute(int spriteNum, int playerNum, int playerDist); void A_Fall(int spriteNum); -int A_GetFurthestAngle(int spriteNum, int angDiv); +int A_GetFurthestAngle(int const spriteNum, int const angDiv); void A_GetZLimits(int spriteNum); int __fastcall G_GetAngleDelta(int currAngle, int newAngle); void G_RestoreMapState(); @@ -137,7 +137,7 @@ int32_t VM_ResetPlayer2(int32_t snum, int32_t flags); int32_t VM_CheckSquished2(int32_t i, int32_t snum); #endif -void VM_UpdateAnim(int spriteNum, int32_t *pData); +void VM_UpdateAnim(int const spriteNum, int32_t * const pData); #ifdef __cplusplus }