[Scummvm-git-logs] scummvm master -> 245d189830e58946f4c0c3c747de67e8f8aa559c

bluegr noreply at scummvm.org
Tue Nov 26 17:31:31 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
245d189830 ULTIMA: Make more static data read only


Commit: 245d189830e58946f4c0c3c747de67e8f8aa559c
    https://github.com/scummvm/scummvm/commit/245d189830e58946f4c0c3c747de67e8f8aa559c
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2024-11-26T19:31:27+02:00

Commit Message:
ULTIMA: Make more static data read only

Changed paths:
    engines/ultima/nuvie/actors/actor.cpp
    engines/ultima/nuvie/actors/md_actor.cpp
    engines/ultima/nuvie/core/anim_manager.cpp
    engines/ultima/nuvie/core/anim_manager.h
    engines/ultima/nuvie/core/magic.cpp
    engines/ultima/nuvie/core/tile_manager.cpp
    engines/ultima/nuvie/gui/gui_font.h
    engines/ultima/nuvie/gui/gui_load_image.cpp
    engines/ultima/nuvie/gui/gui_load_image.h
    engines/ultima/nuvie/gui/the_font.h
    engines/ultima/nuvie/gui/widgets/command_bar.cpp
    engines/ultima/nuvie/gui/widgets/command_bar.h
    engines/ultima/nuvie/keybinding/keys.cpp
    engines/ultima/nuvie/misc/u6_misc.cpp
    engines/ultima/nuvie/misc/u6_misc.h
    engines/ultima/nuvie/script/script_actor.cpp
    engines/ultima/ultima1/core/resources.cpp
    engines/ultima/ultima4/core/config.cpp
    engines/ultima/ultima4/core/config.h
    engines/ultima/ultima4/core/debugger.cpp
    engines/ultima/ultima4/game/codex.cpp
    engines/ultima/ultima4/game/item.cpp
    engines/ultima/ultima4/gfx/imagemgr.cpp
    engines/ultima/ultima4/gfx/screen.cpp
    engines/ultima/ultima4/map/mapmgr.cpp
    engines/ultima/ultima4/map/tileanim.cpp
    engines/ultima/ultima4/map/tileset.cpp
    engines/ultima/ultima8/audio/cru_music_process.cpp
    engines/ultima/ultima8/audio/cru_music_process.h
    engines/ultima/ultima8/games/cru_game.cpp
    engines/ultima/ultima8/gumps/paperdoll_gump.cpp
    engines/ultima/ultima8/gumps/weasel_gump.cpp
    engines/ultima/ultima8/misc/encoding.cpp
    engines/ultima/ultima8/misc/encoding.h
    engines/ultima/ultima8/usecode/regret_intrinsics.h
    engines/ultima/ultima8/usecode/remorse_intrinsics.h
    engines/ultima/ultima8/usecode/u8_intrinsics.h
    engines/ultima/ultima8/usecode/uc_machine.cpp
    engines/ultima/ultima8/usecode/uc_machine.h
    engines/ultima/ultima8/world/actors/attack_process.cpp
    engines/ultima/ultima8/world/actors/attack_process.h
    engines/ultima/ultima8/world/actors/pathfinder_process.cpp
    engines/ultima/ultima8/world/actors/pathfinder_process.h
    engines/ultima/ultima8/world/fire_type.cpp
    engines/ultima/ultima8/world/fire_type.h


diff --git a/engines/ultima/nuvie/actors/actor.cpp b/engines/ultima/nuvie/actors/actor.cpp
index 06682298e48..1bf5228039a 100644
--- a/engines/ultima/nuvie/actors/actor.cpp
+++ b/engines/ultima/nuvie/actors/actor.cpp
@@ -43,7 +43,7 @@
 namespace Ultima {
 namespace Nuvie {
 
-uint8 walk_frame_tbl[4] = {0, 1, 2, 1};
+extern const uint8 walk_frame_tbl[4] = {0, 1, 2, 1};
 
 class ActorManager;
 
diff --git a/engines/ultima/nuvie/actors/md_actor.cpp b/engines/ultima/nuvie/actors/md_actor.cpp
index 4525a93369e..8d9e165e07f 100644
--- a/engines/ultima/nuvie/actors/md_actor.cpp
+++ b/engines/ultima/nuvie/actors/md_actor.cpp
@@ -29,7 +29,7 @@ namespace Nuvie {
 
 #define MD_DOWNWARD_FACING_FRAME_N 9
 
-extern uint8 walk_frame_tbl[4];
+extern const uint8 walk_frame_tbl[4];
 
 MDActor::MDActor(Map *m, ObjManager *om, GameClock *c) : WOUActor(m, om, c) {
 }
diff --git a/engines/ultima/nuvie/core/anim_manager.cpp b/engines/ultima/nuvie/core/anim_manager.cpp
index c26e55ed173..3ed2994b05a 100644
--- a/engines/ultima/nuvie/core/anim_manager.cpp
+++ b/engines/ultima/nuvie/core/anim_manager.cpp
@@ -43,7 +43,7 @@ namespace Nuvie {
 #define MESG_ANIM_DONE      ANIM_CB_DONE
 
 static float get_relative_degrees(sint16 sx, sint16 sy, float angle_up = 0);
-struct tossanim_tile_shifts_s tossanim_tile_shifts[] = {
+const struct tossanim_tile_shifts_s tossanim_tile_shifts[] = {
 	{ TILE_U6_BOLT, 4 },
 	{ TILE_U6_ARROW, 4 },
 	{ 0, 0}
diff --git a/engines/ultima/nuvie/core/anim_manager.h b/engines/ultima/nuvie/core/anim_manager.h
index 2c2a8c68903..9ba3d91de5c 100644
--- a/engines/ultima/nuvie/core/anim_manager.h
+++ b/engines/ultima/nuvie/core/anim_manager.h
@@ -325,7 +325,7 @@ struct tossanim_tile_shifts_s {
 	uint16 tile_num;
 	sint8 shift; // plus or minus vertical position
 };
-extern struct tossanim_tile_shifts_s tossanim_tile_shifts[];
+extern const struct tossanim_tile_shifts_s tossanim_tile_shifts[];
 
 /* a line of fire */
 typedef struct {
diff --git a/engines/ultima/nuvie/core/magic.cpp b/engines/ultima/nuvie/core/magic.cpp
index efab0417f69..2e9ea224057 100644
--- a/engines/ultima/nuvie/core/magic.cpp
+++ b/engines/ultima/nuvie/core/magic.cpp
@@ -63,8 +63,8 @@ namespace Nuvie {
  * Mani ......... Life/Healing     Zu .................. Sleep
  */
 
-const char *syllable[26] = {"An ", "Bet ", "Corp ", "Des ", "Ex ", "Flam ", "Grav ", "Hur ", "In ", "Jux ", "Kal ", "Lor ", "Mani ", "Nox ", "Ort ", "Por ", "Quas ", "Rel ", "Sanct ", "Tym ", "Uus ", "Vas ", "Wis ", "Xen ", "Ylem ", "Zu "};
-const char *reagent[8] = {"mandrake root", "nightshade", "black pearl", "blood moss", "spider silk", "garlic", "ginseng", "sulfurous ash"}; // check names
+const char *const syllable[26] = {"An ", "Bet ", "Corp ", "Des ", "Ex ", "Flam ", "Grav ", "Hur ", "In ", "Jux ", "Kal ", "Lor ", "Mani ", "Nox ", "Ort ", "Por ", "Quas ", "Rel ", "Sanct ", "Tym ", "Uus ", "Vas ", "Wis ", "Xen ", "Ylem ", "Zu "};
+const char *const reagent[8] = {"mandrake root", "nightshade", "black pearl", "blood moss", "spider silk", "garlic", "ginseng", "sulfurous ash"}; // check names
 const int obj_n_reagent[8] = {OBJ_U6_MANDRAKE_ROOT, OBJ_U6_NIGHTSHADE, OBJ_U6_BLACK_PEARL, OBJ_U6_BLOOD_MOSS, OBJ_U6_SPIDER_SILK, OBJ_U6_GARLIC, OBJ_U6_GINSENG, OBJ_U6_SULFUROUS_ASH};
 
 
diff --git a/engines/ultima/nuvie/core/tile_manager.cpp b/engines/ultima/nuvie/core/tile_manager.cpp
index e834425e748..06a4cd32f69 100644
--- a/engines/ultima/nuvie/core/tile_manager.cpp
+++ b/engines/ultima/nuvie/core/tile_manager.cpp
@@ -40,7 +40,7 @@ namespace Nuvie {
 
 #define NUM_ORIGINAL_TILES 2048
 
-static char article_tbl[][5] = {"", "a ", "an ", "the "};
+static const char article_tbl[][5] = {"", "a ", "an ", "the "};
 
 static const uint16 U6_ANIM_SRC_TILE[32] = {0x16, 0x16, 0x1a, 0x1a, 0x1e, 0x1e, 0x12, 0x12,
 											0x1a, 0x1e, 0x16, 0x12, 0x16, 0x1a, 0x1e, 0x12,
diff --git a/engines/ultima/nuvie/gui/gui_font.h b/engines/ultima/nuvie/gui/gui_font.h
index bb4b7279b9e..ca6c94364d6 100644
--- a/engines/ultima/nuvie/gui/gui_font.h
+++ b/engines/ultima/nuvie/gui/gui_font.h
@@ -45,7 +45,7 @@ protected:
 	/* dimensions */
 	int _charH, _charW;
 
-	byte *_wData;
+	const byte *_wData;
 public:
 	/* use default 8x8 font */
 	GUI_Font(uint8 fontType = GUI_FONT_DEFAULT);
diff --git a/engines/ultima/nuvie/gui/gui_load_image.cpp b/engines/ultima/nuvie/gui/gui_load_image.cpp
index 6399bc30e04..f3ed9ca0b37 100644
--- a/engines/ultima/nuvie/gui/gui_load_image.cpp
+++ b/engines/ultima/nuvie/gui/gui_load_image.cpp
@@ -31,7 +31,7 @@ namespace Nuvie {
 /*                                                                      */
 /************************************************************************/
 
-Graphics::ManagedSurface *GUI_LoadImage(int w, int h, uint8 *pal, uint8 *data) {
+Graphics::ManagedSurface *GUI_LoadImage(int w, int h, const uint8 *pal, const uint8 *data) {
 	Graphics::ManagedSurface *image = new Graphics::ManagedSurface(w, h,
 		Graphics::PixelFormat::createFormatCLUT8());
 
@@ -77,7 +77,7 @@ Graphics::ManagedSurface *GUI_FontGump(void) {
 	return the_font_gump;
 }
 
-uint8 *GUI_FontGumpWData(void) {
+const uint8 *GUI_FontGumpWData(void) {
 	return font_gump_w_data;
 }
 
diff --git a/engines/ultima/nuvie/gui/gui_load_image.h b/engines/ultima/nuvie/gui/gui_load_image.h
index f7aa9868816..174fdd01685 100644
--- a/engines/ultima/nuvie/gui/gui_load_image.h
+++ b/engines/ultima/nuvie/gui/gui_load_image.h
@@ -36,7 +36,7 @@ namespace Nuvie {
  */
 /************************************************************************/
 
-extern Graphics::ManagedSurface *GUI_LoadImage(int w, int h, uint8 *pal, uint8 *data);
+extern Graphics::ManagedSurface *GUI_LoadImage(int w, int h, const uint8 *pal, const uint8 *data);
 
 /* Load the internal 8x8 font and return the associated font surface */
 extern Graphics::ManagedSurface *GUI_DefaultFont(void);
@@ -45,7 +45,7 @@ extern Graphics::ManagedSurface *GUI_Font6x8(void);
 
 extern Graphics::ManagedSurface *GUI_FontGump(void);
 
-extern uint8 *GUI_FontGumpWData(void);
+extern const uint8 *GUI_FontGumpWData(void);
 
 } // End of namespace Nuvie
 } // End of namespace Ultima
diff --git a/engines/ultima/nuvie/gui/the_font.h b/engines/ultima/nuvie/gui/the_font.h
index 65f5fe32189..760f43380b2 100644
--- a/engines/ultima/nuvie/gui/the_font.h
+++ b/engines/ultima/nuvie/gui/the_font.h
@@ -25,9 +25,9 @@
 namespace Ultima {
 namespace Nuvie {
 
-static int font_w = 128;
-static int font_h = 144;
-static uint8 font_pal[] = {
+static const int font_w = 128;
+static const int font_h = 144;
+static const uint8 font_pal[] = {
 	0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -93,7 +93,7 @@ static uint8 font_pal[] = {
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
-static uint8 font_data[] = {
+static const uint8 font_data[] = {
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -240,9 +240,9 @@ static uint8 font_data[] = {
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
-static int font_6x8_w = 96;
-static int font_6x8_h = 144;
-static uint8 font_6x8_data[] = {
+static const int font_6x8_w = 96;
+static const int font_6x8_h = 144;
+static const uint8 font_6x8_data[] = {
 	0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1,
 	1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1,
 	1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1,
@@ -1109,10 +1109,10 @@ static uint8 font_6x8_data[] = {
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
 
-static int font_gump_w = 96;
-static int font_gump_h = 128;
+static const int font_gump_w = 96;
+static const int font_gump_h = 128;
 
-static uint8 font_gump_w_data[] = {
+static const uint8 font_gump_w_data[] = {
 	4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
 	4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
 	4, 2, 4, 5, 4, 4, 4, 2, 4, 4, 4, 4, 2, 4, 2, 4,
@@ -1131,7 +1131,7 @@ static uint8 font_gump_w_data[] = {
 	4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
 };
 
-static uint8 font_gump_data[] = {
+static const uint8 font_gump_data[] = {
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
diff --git a/engines/ultima/nuvie/gui/widgets/command_bar.cpp b/engines/ultima/nuvie/gui/widgets/command_bar.cpp
index 09de360c885..cd4747d8c89 100644
--- a/engines/ultima/nuvie/gui/widgets/command_bar.cpp
+++ b/engines/ultima/nuvie/gui/widgets/command_bar.cpp
@@ -46,7 +46,7 @@ namespace Nuvie {
 
 using Std::string;
 
-static Tile placeholder_tile = {
+static const Tile placeholder_tile = {
 	0,
 	false,
 	false,
diff --git a/engines/ultima/nuvie/gui/widgets/command_bar.h b/engines/ultima/nuvie/gui/widgets/command_bar.h
index 1d16d51fb18..2d76e561195 100644
--- a/engines/ultima/nuvie/gui/widgets/command_bar.h
+++ b/engines/ultima/nuvie/gui/widgets/command_bar.h
@@ -51,7 +51,7 @@ protected:
 	Game *game;
 	Events *event;
 	Font *font;
-	Tile *icon[13];
+	const Tile *icon[13];
 	U6Shape *background; // used to display the WoU command bar backgrounds
 
 	U6Shape *lever_up;	  // The lever in the up state (MD only)
diff --git a/engines/ultima/nuvie/keybinding/keys.cpp b/engines/ultima/nuvie/keybinding/keys.cpp
index 9a8001d27f5..70dd6ca1a0b 100644
--- a/engines/ultima/nuvie/keybinding/keys.cpp
+++ b/engines/ultima/nuvie/keybinding/keys.cpp
@@ -64,8 +64,8 @@ struct Action {
 	ActionKeyType keyType;
 };
 
-const char *appendAltCodeActionStr = "ALT_CODE";
-const char *toggleAltCodeModeActionStr = "TOGGLE_ALT_CODE_MODE";
+const char *const appendAltCodeActionStr = "ALT_CODE";
+const char *const toggleAltCodeModeActionStr = "TOGGLE_ALT_CODE_MODE";
 const uint toggleAltCodeModeEventID = Common::hashit(toggleAltCodeModeActionStr); // to identify END (KEYUP) events for alt-code mode toggle action
 
 const Action NuvieActions[] = {
@@ -143,7 +143,7 @@ const Action NuvieActions[] = {
 	{ "DO_NOTHING", ActionDoNothing, Action::KeyNotShown, true, OTHER_KEY },
 };
 
-const char *PerPartyMemberActions[] = {
+const char *const PerPartyMemberActions[] = {
 	"SOLO_MODE", "SHOW_STATS", "INVENTORY", "DOLL_GUMP"
 };
 
diff --git a/engines/ultima/nuvie/misc/u6_misc.cpp b/engines/ultima/nuvie/misc/u6_misc.cpp
index 1d7dbe45346..73d45038da5 100644
--- a/engines/ultima/nuvie/misc/u6_misc.cpp
+++ b/engines/ultima/nuvie/misc/u6_misc.cpp
@@ -457,7 +457,7 @@ void get_relative_dir(NuvieDir dir, sint16 *rel_x, sint16 *rel_y) {
 	}
 }
 
-int str_bsearch(const char *str[], int max, const char *value) {
+int str_bsearch(const char *const str[], int max, const char *value) {
 	int position;
 	int begin = 0;
 	int end = max - 1;
diff --git a/engines/ultima/nuvie/misc/u6_misc.h b/engines/ultima/nuvie/misc/u6_misc.h
index bdf8637e246..9d853df87c0 100644
--- a/engines/ultima/nuvie/misc/u6_misc.h
+++ b/engines/ultima/nuvie/misc/u6_misc.h
@@ -67,7 +67,7 @@ NuvieDir get_reverse_direction(NuvieDir dir);
 void get_relative_dir(NuvieDir dir, sint16 *rel_x, sint16 *rel_y);
 const char *get_direction_name(NuvieDir dir);
 const char *get_direction_name(sint16 rel_x, sint16 rel_y);
-int str_bsearch(const char *str[], int max, const char *value);
+int str_bsearch(const char *const str[], int max, const char *value);
 
 /* Does line xy->x2y2 cross rect, to any extent?
  */
diff --git a/engines/ultima/nuvie/script/script_actor.cpp b/engines/ultima/nuvie/script/script_actor.cpp
index ca92e311689..209b99602bf 100644
--- a/engines/ultima/nuvie/script/script_actor.cpp
+++ b/engines/ultima/nuvie/script/script_actor.cpp
@@ -207,7 +207,7 @@ static const struct luaL_Reg nscript_actorlib_m[] = {
 
 
 //Actor variables - must be in alphabetical order
-static const char *actor_set_vars[] = {
+static const char *const actor_set_vars[] = {
 	"align",
 	"asleep",
 	"base_obj_n",
@@ -243,7 +243,7 @@ static const char *actor_set_vars[] = {
 };
 
 //Actor variables - must be in alphabetical order
-static const char *actor_get_vars[] = {
+static const char *const actor_get_vars[] = {
 	"actor_num",
 	"align",
 	"alive",
@@ -325,7 +325,7 @@ static int nscript_actor_set_x(Actor *actor, lua_State *L);
 static int nscript_actor_set_y(Actor *actor, lua_State *L);
 static int nscript_actor_set_z(Actor *actor, lua_State *L);
 
-int (*actor_set_func[])(Actor *, lua_State *) = {
+int (*const actor_set_func[])(Actor *, lua_State *) = {
 	nscript_actor_set_align,
 	nscript_actor_set_asleep_flag,
 	nscript_actor_set_base_obj_n,
@@ -407,7 +407,7 @@ static int nscript_actor_get_xyz(Actor *actor, lua_State *L);
 static int nscript_actor_get_y(Actor *actor, lua_State *L);
 static int nscript_actor_get_z(Actor *actor, lua_State *L);
 
-int (*actor_get_func[])(Actor *, lua_State *) = {
+int (*const actor_get_func[])(Actor *, lua_State *) = {
 	nscript_actor_get_actor_num,
 	nscript_actor_get_align,
 	nscript_actor_get_alive,
diff --git a/engines/ultima/ultima1/core/resources.cpp b/engines/ultima/ultima1/core/resources.cpp
index 8fceb26cde5..aaeaafba851 100644
--- a/engines/ultima/ultima1/core/resources.cpp
+++ b/engines/ultima/ultima1/core/resources.cpp
@@ -187,39 +187,39 @@ static const char *const SRC_LOCATION_NAMES[LOCATION_COUNT] = {
 
 static const char *const SRC_DUNGEON_ITEM_NAMES[2] = { "Chest", "Coffin" };
 
-static const char *SRC_WEAPON_NAMES_UPPERCASE[16] = {
+static const char *const SRC_WEAPON_NAMES_UPPERCASE[16] = {
 	"Hands", "Dagger", "Mace", "Axe", "Rope & Spikes", "Sword", "Great Sword", "Bow & Arrows",
 	"Amulet", "Wand", "Staff", "Triangle", "Pistol", "Light Sword", "Phazor", "Blaster"
 };
 
-static const char *SRC_WEAPON_NAMES_LOWERCASE[16] = {
+static const char *const SRC_WEAPON_NAMES_LOWERCASE[16] = {
 	"hands", "dagger", "mace", "axe", "rope", "sword", "g sword", "bow",
 	"amulet", "wand", "staff", "triangle", "pistol", "L sword", "phazor", "blaster"
 };
 
-static const char *SRC_WEAPON_NAMES_ARTICLE[16] = {
+static const char *const SRC_WEAPON_NAMES_ARTICLE[16] = {
 	"a Hands", "a Dagger", "a Mace", "Axe", "a Rope & Spikes", "a Sword", "a Great Sword", "a Bow & Arrows",
 	"an Amulet", "a Wand", "a Staff", "a Triangle", "a Pistol", "a Light Sword", "a Phazor", "a Blaster"
 };
 
 static const byte SRC_WEAPON_DISTANCES[16] = { 1, 1, 1, 1, 0, 1, 1, 3, 0, 0, 0, 1, 3, 1, 3, 3 };
 
-static const char *SRC_ARMOUR_NAMES[6] = {
+static const char *const SRC_ARMOUR_NAMES[6] = {
 	"Skin", "Leather armor", "Chain mail", "Plate mail", "Vacuum suit", "Reflect suit"
 };
 
-static const char *SRC_SPELL_NAMES[11] = {
+static const char *const SRC_SPELL_NAMES[11] = {
 	"Prayer", "Open", "Unlock", "Magic Missile", "Steal", "Ladder Down", "Ladder Up",
 	"Blink", "Create", "Destroy", "Kill"
 };
 
-static const char *SRC_SPELL_PHRASES[14] = {
+static const char *const SRC_SPELL_PHRASES[14] = {
 	"\"POTENTIS-LAUDIS!\"", "\"APERTUS!\"", "\"PECUNIA!\"", "\"VASTO!\"", "\"NUDO!\"",
 	"\"INFERUS!\"", "\"ASCENDO!\"", "\"DUCIS-EDUCO!\"", "\"STRUXI!\"", "\"DELIO!\"",
 	"\"INTERFICIO!\"", " Shazam!", "\"DELCIO-ERE-UI\" ", "\"INTERFICIO-NUNC!\" "
 };
 
-static const char *SRC_GEM_NAMES[4] = { "Red Gem", "Green Gem", "Blue Gem", "White Gem" };
+static const char *const SRC_GEM_NAMES[4] = { "Red Gem", "Green Gem", "Blue Gem", "White Gem" };
 
 static const byte SRC_LOCATION_X[LOCATION_COUNT] = {
 	39, 66, 25, 46, 52, 18, 70, 64, 126, 128, 148, 115, 150, 121,
@@ -684,16 +684,16 @@ static const char *const SRC_MAGIC_NAMES[8] = {
 	"Psychic Sam's Magical Emporium", nullptr, nullptr, nullptr, "The Unleashed Spell"
 };
 static const char *const SRC_DONT_BUY_SPELLS = "Sorry, we don't buy spells!";
-static const char *SRC_TAVERN_NAMES[8] = {
+static const char *const SRC_TAVERN_NAMES[8] = {
 	"Pub de Varg", "Ye Olde Local Pub", "Dr. Cat's Lair", "Teaser's House", nullptr,
 	"Mary's Midway", "Kurtstable's Korner", "Dav's House-o-Suds"
 };
-static const char *SRC_TAVERN_TEXT[4] = {
+static const char *const SRC_TAVERN_TEXT[4] = {
 	"Thou art broke!\nCome back when thou hast\nsome money to spend.",
 	"We have plenty of booze\nalready!",
 	"The tavern keeper sayeth:\nHere, have a cold one!", "ale"
 };
-static const char *SRC_TAVERN_TIPS[13] = {
+static const char *const SRC_TAVERN_TIPS[13] = {
 	"Thou had best know",
 	"Thou hast been seduced!\nAfter a long night,\nthou art back.",
 	"about space travel!\nThou must destroy at\nleast 20 enemy vessels\nto become an ace!",
@@ -710,11 +710,11 @@ static const char *SRC_TAVERN_TIPS[13] = {
 		"days before Mondain created\nthe evil gem and destroy him!",
 	"wench", "lecher"
 };
-static const char *SRC_TRANSPORTS_NAMES[8] = {
+static const char *const SRC_TRANSPORTS_NAMES[8] = {
 	"Scooter's Super Duper\nTransport, Inc.", nullptr, nullptr, "Quality Transport Ltd.",
 	nullptr, "O.K. New and Used Transport", nullptr, "Sly Sam's Transportation\nSpecialists"
 };
-static const char *SRC_TRANSPORTS_TEXT[2] = {
+static const char *const SRC_TRANSPORTS_TEXT[2] = {
 	"Sorry, we don't deal in\nused stuff.", "Closed for the day."
 
 };
diff --git a/engines/ultima/ultima4/core/config.cpp b/engines/ultima/ultima4/core/config.cpp
index 38f0c90a0ef..38c71f7ad54 100644
--- a/engines/ultima/ultima4/core/config.cpp
+++ b/engines/ultima/ultima4/core/config.cpp
@@ -99,7 +99,7 @@ bool ConfigElement::getBool(const Common::String &name) const {
 	return toupper(str[0]) == 'T' || str == "1";
 }
 
-int ConfigElement::getEnum(const Common::String &name, const char *enumValues[]) const {
+int ConfigElement::getEnum(const Common::String &name, const char *const enumValues[]) const {
 	Common::String str = (*_node)[name];
 	if (str.empty())
 		return 0;
diff --git a/engines/ultima/ultima4/core/config.h b/engines/ultima/ultima4/core/config.h
index 6f65ec25258..8db20c96211 100644
--- a/engines/ultima/ultima4/core/config.h
+++ b/engines/ultima/ultima4/core/config.h
@@ -144,7 +144,7 @@ public:
 	Common::String getString(const Common::String &name) const;
 	int getInt(const Common::String &name, int defaultValue = 0) const;
 	bool getBool(const Common::String &name) const;
-	int getEnum(const Common::String &name, const char *enumValues[]) const;
+	int getEnum(const Common::String &name, const char *const enumValues[]) const;
 
 	Std::vector<ConfigElement> getChildren() const;
 
diff --git a/engines/ultima/ultima4/core/debugger.cpp b/engines/ultima/ultima4/core/debugger.cpp
index 360b5056400..499508c1f93 100644
--- a/engines/ultima/ultima4/core/debugger.cpp
+++ b/engines/ultima/ultima4/core/debugger.cpp
@@ -166,11 +166,11 @@ void Debugger::prompt() {
 }
 
 bool Debugger::handleCommand(int argc, const char **argv, bool &keepRunning) {
-	static const char *DUNGEON_DISALLOWED[] = {
+	static const char *const DUNGEON_DISALLOWED[] = {
 		"attack", "board", "enter", "fire", "jimmy", "locate",
 		"open", "talk", "exit", "yell", nullptr
 	};
-	static const char *COMBAT_DISALLOWED[] = {
+	static const char *const COMBAT_DISALLOWED[] = {
 		"board", "climb", "descend", "enter", "exit", "fire", "hole",
 		"ignite", "jimmy", "mix", "order", "open", "peer", "quitAndSave",
 		"search", "wear", "yell", nullptr
diff --git a/engines/ultima/ultima4/game/codex.cpp b/engines/ultima/ultima4/game/codex.cpp
index c54bd120790..181bd9b7275 100644
--- a/engines/ultima/ultima4/game/codex.cpp
+++ b/engines/ultima/ultima4/game/codex.cpp
@@ -249,7 +249,7 @@ void Codex::handleWOP(const Common::String &word) {
 }
 
 void Codex::handleVirtues(const Common::String &virtue) {
-	static const char *codexImageNames[] = {
+	static const char *const codexImageNames[] = {
 		BKGD_HONESTY, BKGD_COMPASSN, BKGD_VALOR, BKGD_JUSTICE,
 		BKGD_SACRIFIC, BKGD_HONOR, BKGD_SPIRIT, BKGD_HUMILITY,
 		BKGD_TRUTH, BKGD_LOVE, BKGD_COURAGE
diff --git a/engines/ultima/ultima4/game/item.cpp b/engines/ultima/ultima4/game/item.cpp
index 9294601eaa9..23372e1d6d3 100644
--- a/engines/ultima/ultima4/game/item.cpp
+++ b/engines/ultima/ultima4/game/item.cpp
@@ -420,10 +420,10 @@ void Items::useStone(int item) {
 	MapCoords coords;
 	byte stone = static_cast<byte>(item);
 
-	static byte truth   = STONE_WHITE | STONE_PURPLE | STONE_GREEN  | STONE_BLUE;
-	static byte love    = STONE_WHITE | STONE_YELLOW | STONE_GREEN  | STONE_ORANGE;
-	static byte courage = STONE_WHITE | STONE_RED    | STONE_PURPLE | STONE_ORANGE;
-	static byte *attr   = nullptr;
+	static const byte truth   = STONE_WHITE | STONE_PURPLE | STONE_GREEN  | STONE_BLUE;
+	static const byte love    = STONE_WHITE | STONE_YELLOW | STONE_GREEN  | STONE_ORANGE;
+	static const byte courage = STONE_WHITE | STONE_RED    | STONE_PURPLE | STONE_ORANGE;
+	static const byte *attr   = nullptr;
 
 	g_context->_location->getCurrentPosition(&coords);
 
diff --git a/engines/ultima/ultima4/gfx/imagemgr.cpp b/engines/ultima/ultima4/gfx/imagemgr.cpp
index 887fa8baa7a..f75ec104d95 100644
--- a/engines/ultima/ultima4/gfx/imagemgr.cpp
+++ b/engines/ultima/ultima4/gfx/imagemgr.cpp
@@ -143,7 +143,7 @@ ImageSet *ImageMgr::loadImageSetFromConf(const ConfigElement &conf) {
 
 ImageInfo *ImageMgr::loadImageInfoFromConf(const ConfigElement &conf) {
 	ImageInfo *info;
-	static const char *fixupEnumStrings[] = { "none", "intro", "abyss", "abacus", "dungns", "blackTransparencyHack", "fmtownsscreen", nullptr };
+	static const char *const fixupEnumStrings[] = { "none", "intro", "abyss", "abacus", "dungns", "blackTransparencyHack", "fmtownsscreen", nullptr };
 
 	info = new ImageInfo();
 	info->_name = conf.getString("name");
diff --git a/engines/ultima/ultima4/gfx/screen.cpp b/engines/ultima/ultima4/gfx/screen.cpp
index d4f332ea041..66eaf09d544 100644
--- a/engines/ultima/ultima4/gfx/screen.cpp
+++ b/engines/ultima/ultima4/gfx/screen.cpp
@@ -379,7 +379,7 @@ void Screen::screenLoadGraphicsFromConf() {
 
 Layout *Screen::screenLoadLayoutFromConf(const ConfigElement &conf) {
 	Layout *layout;
-	static const char *typeEnumStrings[] = {"standard", "gem", "dungeon_gem", nullptr};
+	static const char *const typeEnumStrings[] = {"standard", "gem", "dungeon_gem", nullptr};
 
 	layout = new Layout();
 	layout->_name = conf.getString("name");
diff --git a/engines/ultima/ultima4/map/mapmgr.cpp b/engines/ultima/ultima4/map/mapmgr.cpp
index c5796ece739..96257e013c7 100644
--- a/engines/ultima/ultima4/map/mapmgr.cpp
+++ b/engines/ultima/ultima4/map/mapmgr.cpp
@@ -150,8 +150,8 @@ void MapMgr::registerMap(Map *map) {
 
 Map *MapMgr::initMapFromConf(const ConfigElement &mapConf) {
 	Map *map;
-	static const char *mapTypeEnumStrings[] = { "world", "city", "shrine", "combat", "dungeon", "xml", nullptr };
-	static const char *borderBehaviorEnumStrings[] = { "wrap", "exit", "fixed", nullptr };
+	static const char *const mapTypeEnumStrings[] = { "world", "city", "shrine", "combat", "dungeon", "xml", nullptr };
+	static const char *const borderBehaviorEnumStrings[] = { "wrap", "exit", "fixed", nullptr };
 
 	map = initMap(static_cast<Map::Type>(mapConf.getEnum("type", mapTypeEnumStrings)));
 	if (!map)
@@ -230,7 +230,7 @@ void MapMgr::initCityFromConf(const ConfigElement &cityConf, City *city) {
 
 PersonRole *MapMgr::initPersonRoleFromConf(const ConfigElement &personRoleConf) {
 	PersonRole *personrole;
-	static const char *roleEnumStrings[] = { "companion", "weaponsvendor", "armorvendor", "foodvendor", "tavernkeeper",
+	static const char *const roleEnumStrings[] = { "companion", "weaponsvendor", "armorvendor", "foodvendor", "tavernkeeper",
 	                                         "reagentsvendor", "healer", "innkeeper", "guildvendor", "horsevendor",
 	                                         "lordbritish", "hawkwind", nullptr
 	                                       };
@@ -326,7 +326,7 @@ Portal *MapMgr::initPortalFromConf(const ConfigElement &portalConf) {
 }
 
 void MapMgr::initShrineFromConf(const ConfigElement &shrineConf, Shrine *shrine) {
-	static const char *virtues[] = {"Honesty", "Compassion", "Valor", "Justice", "Sacrifice", "Honor", "Spirituality", "Humility", nullptr};
+	static const char *const virtues[] = {"Honesty", "Compassion", "Valor", "Justice", "Sacrifice", "Honor", "Spirituality", "Humility", nullptr};
 
 	shrine->setVirtue(static_cast<Virtue>(shrineConf.getEnum("virtue", virtues)));
 	shrine->setMantra(shrineConf.getString("mantra"));
diff --git a/engines/ultima/ultima4/map/tileanim.cpp b/engines/ultima/ultima4/map/tileanim.cpp
index 1eb45d7f968..9657cc03c45 100644
--- a/engines/ultima/ultima4/map/tileanim.cpp
+++ b/engines/ultima/ultima4/map/tileanim.cpp
@@ -33,7 +33,7 @@ namespace Ultima4 {
 
 TileAnimTransform *TileAnimTransform::create(const ConfigElement &conf) {
 	TileAnimTransform *transform;
-	static const char *transformTypeEnumStrings[] = { "invert", "pixel", "scroll", "frame", "pixel_color", nullptr };
+	static const char *const transformTypeEnumStrings[] = { "invert", "pixel", "scroll", "frame", "pixel_color", nullptr };
 
 	int type = conf.getEnum("type", transformTypeEnumStrings);
 
@@ -219,8 +219,8 @@ void TileAnimPixelColorTransform::draw(Image *dest, Tile *tile, MapTile &mapTile
 
 TileAnimContext *TileAnimContext::create(const ConfigElement &conf) {
 	TileAnimContext *context;
-	static const char *contextTypeEnumStrings[] = { "frame", "dir", nullptr };
-	static const char *dirEnumStrings[] = { "none", "west", "north", "east", "south", nullptr };
+	static const char *const contextTypeEnumStrings[] = { "frame", "dir", nullptr };
+	static const char *const dirEnumStrings[] = { "none", "west", "north", "east", "south", nullptr };
 
 	TileAnimContext::Type type = (TileAnimContext::Type)conf.getEnum("type", contextTypeEnumStrings);
 
diff --git a/engines/ultima/ultima4/map/tileset.cpp b/engines/ultima/ultima4/map/tileset.cpp
index 9c4df1c9ae4..72ef636c6b6 100644
--- a/engines/ultima/ultima4/map/tileset.cpp
+++ b/engines/ultima/ultima4/map/tileset.cpp
@@ -188,8 +188,8 @@ bool TileRule::initFromConf(const ConfigElement &conf) {
 		{ "unflyable", MASK_UNFLYABLE },
 		{ "creatureunwalkable", MASK_CREATURE_UNWALKABLE }
 	};
-	static const char *speedEnumStrings[] = { "fast", "slow", "vslow", "vvslow", nullptr };
-	static const char *effectsEnumStrings[] = { "none", "fire", "sleep", "poison", "poisonField", "electricity", "lava", nullptr };
+	static const char *const speedEnumStrings[] = { "fast", "slow", "vslow", "vvslow", nullptr };
+	static const char *const effectsEnumStrings[] = { "none", "fire", "sleep", "poison", "poisonField", "electricity", "lava", nullptr };
 
 	_mask = 0;
 	_movementMask = 0;
diff --git a/engines/ultima/ultima8/audio/cru_music_process.cpp b/engines/ultima/ultima8/audio/cru_music_process.cpp
index fdfb1426a37..906a0bf7130 100644
--- a/engines/ultima/ultima8/audio/cru_music_process.cpp
+++ b/engines/ultima/ultima8/audio/cru_music_process.cpp
@@ -38,7 +38,7 @@ static const int MAX_TRACK_REGRET = 22;
 
 // NOTE: The order of these lists has to be the same as the original games
 // as they come as numbers from the usecode.
-static const char *TRACK_FILE_NAMES_REMORSE[] = {
+static const char *const TRACK_FILE_NAMES_REMORSE[] = {
 	nullptr,
 	"M01",
 	"M02",
@@ -63,7 +63,7 @@ static const char *TRACK_FILE_NAMES_REMORSE[] = {
 	"buyme" // for demo
 };
 
-static const char *TRACK_FILE_NAMES_REGRET[] = {
+static const char *const TRACK_FILE_NAMES_REGRET[] = {
 	nullptr,
 	"ninth",
 	"phil",
diff --git a/engines/ultima/ultima8/audio/cru_music_process.h b/engines/ultima/ultima8/audio/cru_music_process.h
index 80c1e222db8..d98b39b1ea6 100644
--- a/engines/ultima/ultima8/audio/cru_music_process.h
+++ b/engines/ultima/ultima8/audio/cru_music_process.h
@@ -52,7 +52,7 @@ private:
 
 	// These are both initialized in constructor and do not need to be saved.
 	int _maxTrack;
-	const char **_trackNames;
+	const char *const *_trackNames;
 
 public:
 	CruMusicProcess();
diff --git a/engines/ultima/ultima8/games/cru_game.cpp b/engines/ultima/ultima8/games/cru_game.cpp
index dd865126a77..271315e9a2c 100644
--- a/engines/ultima/ultima8/games/cru_game.cpp
+++ b/engines/ultima/ultima8/games/cru_game.cpp
@@ -182,10 +182,10 @@ void CruGame::playDemoScreen() {
 	Process *menuproc = new MainMenuProcess();
 	Kernel::get_instance()->addProcess(menuproc);
 
-	static const Common::Path bmp_filename = "static/buyme.dat";
+	const char *bmp_filename = "static/buyme.dat";
 	auto *bmprs = new Common::File();
 	if (!bmprs->open(bmp_filename)) {
-		warning("RemorseGame::playDemoScreen: error opening demo background: %s", bmp_filename.toString().c_str());
+		warning("RemorseGame::playDemoScreen: error opening demo background: %s", bmp_filename);
 		delete bmprs;
 		return;
 	}
@@ -200,20 +200,20 @@ void CruGame::playDemoScreen() {
 }
 
 ProcId CruGame::playCreditsNoMenu() {
-	static const Common::Path txt_filename = "static/credits.dat";
-	static const Common::Path bmp_filename = "static/cred.dat";
+	const char *txt_filename = "static/credits.dat";
+	const char *bmp_filename = "static/cred.dat";
 	auto *txtrs = new Common::File();
 	auto *bmprs = new Common::File();
 
 	if (!txtrs->open(txt_filename)) {
-		warning("RemorseGame::playCredits: error opening credits text: %s", txt_filename.toString().c_str());
+		warning("RemorseGame::playCredits: error opening credits text: %s", txt_filename);
 		delete txtrs;
 		delete bmprs;
 		return 0;
 	}
 
 	if (!bmprs->open(bmp_filename)) {
-		warning("RemorseGame::playCredits: error opening credits background: %s", bmp_filename.toString().c_str());
+		warning("RemorseGame::playCredits: error opening credits background: %s", bmp_filename);
 		delete txtrs;
 		delete bmprs;
 		return 0;
diff --git a/engines/ultima/ultima8/gumps/paperdoll_gump.cpp b/engines/ultima/ultima8/gumps/paperdoll_gump.cpp
index e2b26c6ce07..07d25b86c34 100644
--- a/engines/ultima/ultima8/gumps/paperdoll_gump.cpp
+++ b/engines/ultima/ultima8/gumps/paperdoll_gump.cpp
@@ -43,7 +43,7 @@ DEFINE_RUNTIME_CLASSTYPE_CODE(PaperdollGump)
 
 
 // lots of CONSTANTS...
-struct equipcoords_struct {
+const struct equipcoords_struct {
 	int x, y;
 } equipcoords[] = {
 	{ 0, 0 },
@@ -55,7 +55,7 @@ struct equipcoords_struct {
 	{ 16, 18 }  // weapon
 };
 
-struct statcords_struct {
+const struct statcords_struct {
 
 	int xd, x, y;
 } statcoords[] = {
diff --git a/engines/ultima/ultima8/gumps/weasel_gump.cpp b/engines/ultima/ultima8/gumps/weasel_gump.cpp
index 7976a9ad655..7e8fb4bf11a 100644
--- a/engines/ultima/ultima8/gumps/weasel_gump.cpp
+++ b/engines/ultima/ultima8/gumps/weasel_gump.cpp
@@ -68,13 +68,13 @@ static const int WEASEL_BTN_X[] = { 14,  76, 138,  18, 113,  20,  19,  19,  44};
 static const int WEASEL_BTN_Y[] = {213, 213, 213, 237, 237, 280, 319, 319, 368};
 static const int WEASEL_BTN_SHAPES[] = {13, 26, 14, 16, 15, 28, 27, 83, 29};
 
-static const char *FIRST_INTRO_MOVIE = "17A";
-static const char *INTRO_MOVIES[] = {"18A", "18B", "18C"};
-static const char *BUYMORE_MOVIES[] = {"21A", "21B"};
-static const char *CONFIRM_BUY_MOVIES[] = {"21A", "21B"};
-static const char *CANCELLED_PURCHASE_MOVIES[] = {"19C", "19D"};
-static const char *COMPLETED_PURCHASE_MOVIES[] = {"21C", "21D"};
-static const char *INSUFFICIENT_FUND_MOVIES[] = {"20C", "20D"};
+static const char *const FIRST_INTRO_MOVIE = "17A";
+static const char *const INTRO_MOVIES[] = {"18A", "18B", "18C"};
+static const char *const BUYMORE_MOVIES[] = {"21A", "21B"};
+static const char *const CONFIRM_BUY_MOVIES[] = {"21A", "21B"};
+static const char *const CANCELLED_PURCHASE_MOVIES[] = {"19C", "19D"};
+static const char *const COMPLETED_PURCHASE_MOVIES[] = {"21C", "21D"};
+static const char *const INSUFFICIENT_FUND_MOVIES[] = {"20C", "20D"};
 
 
 namespace {
@@ -90,7 +90,7 @@ static void _closeIfExists(Gump *gump) {
 		gump->Close();
 }
 
-static const char *_getRandomMovie(const char **movies, int nmovies) {
+static const char *_getRandomMovie(const char *const *movies, int nmovies) {
 	Common::RandomSource &rs = Ultima8Engine::get_instance()->getRandomSource();
 	int offset = rs.getRandomNumber(nmovies - 1);
 	return movies[offset];
diff --git a/engines/ultima/ultima8/misc/encoding.cpp b/engines/ultima/ultima8/misc/encoding.cpp
index 3396d021ce0..26454522094 100644
--- a/engines/ultima/ultima8/misc/encoding.cpp
+++ b/engines/ultima/ultima8/misc/encoding.cpp
@@ -26,7 +26,7 @@ Copyright (C) 1999-2004 Free Software Foundation, Inc.
 
 */
 
-#include "ultima/ultima8/misc/common_types.h"
+#include "ultima/ultima8/misc/encoding.h"
 
 
 namespace Ultima {
@@ -34,7 +34,7 @@ namespace Ultima8 {
 
 // U8's encoding to unicode
 
-uint16 encoding[256] = {
+const uint16 encoding[256] = {
 	0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, //0x00
 	0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
 	0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, //0x10
@@ -72,7 +72,7 @@ uint16 encoding[256] = {
 
 // first 256 unicode code points to U8's encoding
 
-uint8 reverse_encoding[256] = {
+const uint8 reverse_encoding[256] = {
 	0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
 	0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
 	0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
diff --git a/engines/ultima/ultima8/misc/encoding.h b/engines/ultima/ultima8/misc/encoding.h
index 945618c66ca..1d43a141e67 100644
--- a/engines/ultima/ultima8/misc/encoding.h
+++ b/engines/ultima/ultima8/misc/encoding.h
@@ -22,11 +22,13 @@
 #ifndef ULTIMA8_MISC_ENCODING_H
 #define ULTIMA8_MISC_ENCODING_H
 
+#include "common/scummsys.h"
+
 namespace Ultima {
 namespace Ultima8 {
 
-extern uint8 reverse_encoding[256];
-extern uint16 encoding[256];
+extern const uint8 reverse_encoding[256];
+extern const uint16 encoding[256];
 
 // first byte in shift_jis character stream encoded as LSbyte in sjis
 // if first byte is >= 0x80 then second byte in character stream as MSB in sjis
diff --git a/engines/ultima/ultima8/usecode/regret_intrinsics.h b/engines/ultima/ultima8/usecode/regret_intrinsics.h
index a52e50d408d..f1623f065e8 100644
--- a/engines/ultima/ultima8/usecode/regret_intrinsics.h
+++ b/engines/ultima/ultima8/usecode/regret_intrinsics.h
@@ -30,7 +30,7 @@ namespace Ultima8 {
 
 // Crusader: No Regret Intrinsics
 // Main list for the updated version (1.06) (as on GOG)
-Intrinsic RegretIntrinsics[] = {
+const Intrinsic RegretIntrinsics[] = {
 	World::I_getAlertActive, // Intrinsic000()
 	Item::I_getFrame, // Intrinsic001()
 	Item::I_setFrame, // Intrinsic002()
@@ -410,7 +410,7 @@ Intrinsic RegretIntrinsics[] = {
 // changing part way through.
 //
 
-Intrinsic RegretDemoIntrinsics[] = {
+const Intrinsic RegretDemoIntrinsics[] = {
 	World::I_getAlertActive,        // Intrinsic000 10e8:048d
 	Item::I_getFrame,               // Intrinsic001 10b0:0826
 	Item::I_setFrame,               // Intrinsic002 10b0:0882
@@ -783,7 +783,7 @@ Intrinsic RegretDemoIntrinsics[] = {
 // at 13F so they are all offset after that
 //
 
-Intrinsic RegretDeIntrinsics[] = {
+const Intrinsic RegretDeIntrinsics[] = {
 	// 0x000
 	World::I_getAlertActive,        // Intrinsic000 10e8:048d
 	Item::I_getFrame,               // Intrinsic001 10b0:0826
diff --git a/engines/ultima/ultima8/usecode/remorse_intrinsics.h b/engines/ultima/ultima8/usecode/remorse_intrinsics.h
index 69382fc52d9..70947d142fd 100644
--- a/engines/ultima/ultima8/usecode/remorse_intrinsics.h
+++ b/engines/ultima/ultima8/usecode/remorse_intrinsics.h
@@ -31,7 +31,7 @@ namespace Ultima8 {
 // Crusader: No Remorse Intrinsics for V1.21
 // Unknown function signatures were generate by the usecode disassembly
 // and looking at handling of SP and retval after function.
-Intrinsic RemorseIntrinsics[] = {
+const Intrinsic RemorseIntrinsics[] = {
 	// 0x000
 	World::I_getAlertActive,
 	Item::I_getFrame, // int Intrinsic001(Item *)
@@ -369,7 +369,7 @@ Intrinsic RemorseIntrinsics[] = {
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
 // Intrinsics for the Remorse demo.
-Intrinsic RemorseDemoIntrinsics[] = {
+const Intrinsic RemorseDemoIntrinsics[] = {
 	World::I_getAlertActive,        // Intrinsic000 10d8:0243
 	Item::I_getFrame,               // Intrinsic001 10a0:07b4
 	Item::I_setFrame,               // Intrinsic002 10a0:0810
@@ -704,7 +704,7 @@ Intrinsic RemorseDemoIntrinsics[] = {
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
 // Intrinsics for the Remorse Spanish version.
-Intrinsic RemorseEsIntrinsics[] = {
+const Intrinsic RemorseEsIntrinsics[] = {
 	ComputerGump::I_readComputer,   // Intrinsic000 13a0:0005
 	Item::I_getMapArray,            // Intrinsic001 10a8:0c78
 	Item::I_getFrame,               // Intrinsic002 10a8:07b4
@@ -1035,7 +1035,7 @@ Intrinsic RemorseEsIntrinsics[] = {
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
 // Intrinsics for the Remorse French version.
-Intrinsic RemorseFrIntrinsics[] = {
+const Intrinsic RemorseFrIntrinsics[] = {
 	// 0x000
 	World::I_getAlertActive,        // Intrinsic000 10e0:0243
 	Item::I_getFrame,               // Intrinsic001 10a8:07b4
diff --git a/engines/ultima/ultima8/usecode/u8_intrinsics.h b/engines/ultima/ultima8/usecode/u8_intrinsics.h
index f0c6ac0ec71..687f8a2346f 100644
--- a/engines/ultima/ultima8/usecode/u8_intrinsics.h
+++ b/engines/ultima/ultima8/usecode/u8_intrinsics.h
@@ -53,7 +53,7 @@ namespace Ultima {
 namespace Ultima8 {
 
 // Ultima 8 Intrinsics
-Intrinsic U8Intrinsics[] = {
+const Intrinsic U8Intrinsics[] = {
 	// 0x000
 	TargetGump::I_target,
 	0, //U
diff --git a/engines/ultima/ultima8/usecode/uc_machine.cpp b/engines/ultima/ultima8/usecode/uc_machine.cpp
index 7a626ec311a..2f0f7d591d0 100644
--- a/engines/ultima/ultima8/usecode/uc_machine.cpp
+++ b/engines/ultima/ultima8/usecode/uc_machine.cpp
@@ -81,7 +81,7 @@ enum UCSegments {
 
 UCMachine *UCMachine::_ucMachine = nullptr;
 
-UCMachine::UCMachine(Intrinsic *iset, unsigned int icount) {
+UCMachine::UCMachine(const Intrinsic *iset, unsigned int icount) {
 	debug(1, "Creating UCMachine...");
 
 	_ucMachine = this;
@@ -145,7 +145,7 @@ void UCMachine::reset() {
 	_stringHeap.clear();
 }
 
-void UCMachine::loadIntrinsics(Intrinsic *i, unsigned int icount) {
+void UCMachine::loadIntrinsics(const Intrinsic *i, unsigned int icount) {
 	_intrinsics = i;
 	_intrinsicCount = icount;
 }
diff --git a/engines/ultima/ultima8/usecode/uc_machine.h b/engines/ultima/ultima8/usecode/uc_machine.h
index 4c15ac29c44..38834319fa7 100644
--- a/engines/ultima/ultima8/usecode/uc_machine.h
+++ b/engines/ultima/ultima8/usecode/uc_machine.h
@@ -41,7 +41,7 @@ class idMan;
 class UCMachine {
 	friend class Debugger;
 public:
-	UCMachine(Intrinsic *iset, unsigned int icount);
+	UCMachine(const Intrinsic *iset, unsigned int icount);
 	~UCMachine();
 
 	static UCMachine *get_instance() {
@@ -91,11 +91,11 @@ public:
 	INTRINSIC(I_numToStr);
 
 protected:
-	void loadIntrinsics(Intrinsic *i, unsigned int icount);
+	void loadIntrinsics(const Intrinsic *i, unsigned int icount);
 
 private:
 	ConvertUsecode *_convUse;
-	Intrinsic *_intrinsics;
+	const Intrinsic *_intrinsics;
 	unsigned int _intrinsicCount;
 
 	GlobalStorage *_globals;
diff --git a/engines/ultima/ultima8/world/actors/attack_process.cpp b/engines/ultima/ultima8/world/actors/attack_process.cpp
index cc0121ebacd..89a9f494613 100644
--- a/engines/ultima/ultima8/world/actors/attack_process.cpp
+++ b/engines/ultima/ultima8/world/actors/attack_process.cpp
@@ -76,8 +76,6 @@ static const int16 REG_SFX_15[] = { 0x1E7, 0x1E8, 0x1E9, 0x1EA, 0x1ED };
 // read from the data array.
 static const int MAGIC_DATA_OFF = 33000;
 
-const uint16 AttackProcess::ATTACK_PROC_TYPE = 0x259;
-
 int16 AttackProcess::_lastAttackSound = -1;
 int16 AttackProcess::_lastLastAttackSound = -1;
 
diff --git a/engines/ultima/ultima8/world/actors/attack_process.h b/engines/ultima/ultima8/world/actors/attack_process.h
index f71645ab9c2..62f96f98440 100644
--- a/engines/ultima/ultima8/world/actors/attack_process.h
+++ b/engines/ultima/ultima8/world/actors/attack_process.h
@@ -84,7 +84,7 @@ public:
 	bool loadData(Common::ReadStream *rs, uint32 version);
 	void saveData(Common::WriteStream *ws) override;
 
-	static const uint16 ATTACK_PROC_TYPE;
+	static const uint16 ATTACK_PROC_TYPE = 0x259;
 private:
 	/** Set the current tactic in use from the combat.dat file.  If 0,
 	 * will use the genericAttack function. */
diff --git a/engines/ultima/ultima8/world/actors/pathfinder_process.cpp b/engines/ultima/ultima8/world/actors/pathfinder_process.cpp
index 6bcec651575..39ea31c0709 100644
--- a/engines/ultima/ultima8/world/actors/pathfinder_process.cpp
+++ b/engines/ultima/ultima8/world/actors/pathfinder_process.cpp
@@ -31,8 +31,6 @@ namespace Ultima8 {
 static const unsigned int PATH_OK = 1;
 static const unsigned int PATH_FAILED = 0;
 
-const uint16 PathfinderProcess::PATHFINDER_PROC_TYPE = 0x204;
-
 DEFINE_RUNTIME_CLASSTYPE_CODE(PathfinderProcess)
 
 PathfinderProcess::PathfinderProcess() : Process(),
diff --git a/engines/ultima/ultima8/world/actors/pathfinder_process.h b/engines/ultima/ultima8/world/actors/pathfinder_process.h
index 7b20af7aae8..2c0ac35f7df 100644
--- a/engines/ultima/ultima8/world/actors/pathfinder_process.h
+++ b/engines/ultima/ultima8/world/actors/pathfinder_process.h
@@ -56,7 +56,7 @@ protected:
 	unsigned int _currentStep;
 
 public:
-	static const uint16 PATHFINDER_PROC_TYPE;
+	static const uint16 PATHFINDER_PROC_TYPE = 0x204;
 };
 
 } // End of namespace Ultima8
diff --git a/engines/ultima/ultima8/world/fire_type.cpp b/engines/ultima/ultima8/world/fire_type.cpp
index 67c190730f0..bacee956be1 100644
--- a/engines/ultima/ultima8/world/fire_type.cpp
+++ b/engines/ultima/ultima8/world/fire_type.cpp
@@ -35,17 +35,6 @@
 namespace Ultima {
 namespace Ultima8 {
 
-FireType::FireType(uint16 typeNo, uint16 minDamage, uint16 maxDamage, uint8 range,
-				 uint8 numShots, uint16 shieldCost, uint8 shieldMask, bool accurate,
-				 uint16 cellsPerRound, uint16 roundDuration, bool nearSprite) :
-	_typeNo(typeNo), _minDamage(minDamage), _maxDamage(maxDamage),
-	_range(range), _numShots(numShots), _shieldCost(shieldCost),
-	_shieldMask(shieldMask), _accurate(accurate),
-	_cellsPerRound(cellsPerRound), _roundDuration(roundDuration),
-	_nearSprite(nearSprite) {
-	assert(maxDamage >= minDamage);
-}
-
 uint16 FireType::getRandomDamage() const {
 	if (_minDamage == _maxDamage)
 		return _minDamage;
diff --git a/engines/ultima/ultima8/world/fire_type.h b/engines/ultima/ultima8/world/fire_type.h
index 7350faafd30..fa01bd18cd0 100644
--- a/engines/ultima/ultima8/world/fire_type.h
+++ b/engines/ultima/ultima8/world/fire_type.h
@@ -33,9 +33,14 @@ struct Point3;
  */
 class FireType {
 public:
-	FireType(uint16 typeNo, uint16 minDamage, uint16 maxDamage, uint8 range,
+	constexpr FireType(uint16 typeNo, uint16 minDamage, uint16 maxDamage, uint8 range,
 			 uint8 numShots, uint16 shieldCost, uint8 shieldMask, bool accurate,
-			 uint16 cellsPerRound, uint16 roundDuration, bool nearSprite);
+			 uint16 cellsPerRound, uint16 roundDuration, bool nearSprite) :
+		_typeNo(typeNo), _minDamage(minDamage), _maxDamage(maxDamage),
+		_range(range), _numShots(numShots), _shieldCost(shieldCost),
+		_shieldMask(shieldMask), _accurate(accurate),
+		_cellsPerRound(cellsPerRound), _roundDuration(roundDuration),
+		_nearSprite(nearSprite) {}
 
 	uint16 getTypeNo() const {
 		return _typeNo;




More information about the Scummvm-git-logs mailing list