Add a *ton* of const and constexpr around the codebase. (#1864)

* Add a *ton* of const and constexpr around the codebase.

This makes the codebase compile without strings being cast to non-const char*. I also went through and added constexpr where appropriate for tons of static data.

* Make process definitions const too

Might as well
This commit is contained in:
Pieter-Jan Briers
2026-05-28 07:12:16 +02:00
committed by GitHub
parent db39a9c7f3
commit 5d68762590
954 changed files with 4693 additions and 4682 deletions
+4 -4
View File
@@ -44,12 +44,12 @@ static cXyz l_chainOffset(0.0f, 105.0f, 30.0f);
static cXyz l_smokeSetOffset(0.0f, 0.0f, -200.0f);
static cull_box const l_cull_box = {
static DUSK_CONSTEXPR cull_box const l_cull_box = {
{-250.0f, 0.0f, -450.0f},
{250.0f, 250.0f, 400.0f},
};
static char* l_arcName = "P_Cblock";
static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "P_Cblock";
static f32 l_side_co_offset[12] = {
-255.0f, 0.0f, -30.0f, -135.0f,
@@ -394,7 +394,7 @@ static const u32 dummy3[3] = {
AUDIO_INSTANCES;
static actor_method_class l_daObjCBlk_Method = {
static DUSK_CONST actor_method_class l_daObjCBlk_Method = {
(process_method_func)daObjCBlk_Create,
(process_method_func)daObjCBlk_Delete,
(process_method_func)daObjCBlk_Execute,
@@ -402,7 +402,7 @@ static actor_method_class l_daObjCBlk_Method = {
(process_method_func)daObjCBlk_Draw,
};
actor_process_profile_definition g_profile_Obj_ChainBlock = {
DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_ChainBlock = {
/* Layer ID */ fpcLy_CURRENT_e,
/* List ID */ 3,
/* List Prio */ fpcPi_CURRENT_e,