WP-105: The engine’s three clang warnings (Gen 1)
Status: ✅ Done (2026-11-28). Fork PR barefootbetters/scummvm#30 merged on 2026-11-28 (merge commit 55c8b6b32a).
Phase: 5 (build hygiene)
Depends on: WP-103 ✅ (the fork tip the warnings were seen on)
Companion EC: none (inline checklist under Exit criteria)
Pre-flight: pre-flight-WP-105-2026-11-28. Required: the packet modifies engines/terraglyph/**.
Targets generation(s): Gen 1, both titles (no behaviour change).
Estimated effort: An hour
Goal
Clear the three warnings that clang printed in the engine during the Android build that loaded Phantom on the TV:
engines/terraglyph/maze_rooms.h:142:6: warning: private field '_marker' is not used [-Wunused-private-field]
engines/terraglyph/room_class.cpp:81:23: warning: declaration requires a global destructor [-Wglobal-constructors]
engines/terraglyph/wizards_rooms.cpp:42:26: warning: unused variable 'kBigHead' [-Wunused-const-variable]
GCC, the Windows build, doesn’t report any of the three, so the Windows build had been clean.
The fixes
- The button sound playing (
room_class.cpp). The original keeps one global,0x475F50: the sound of the button last rolled over. A button doesn’t play its sound again while that sound is still playing (scooby-exe, the button update). The fork modelled it as a file-scopestatic Common::String, which needs a global constructor and destructor. ScummVM’s code doesn’t allow those. It’s nowTerraglyphEngine::_buttonSound, whichButtonRoom::tickreaches throughbuttonSound(). It is still one value for the whole game, shared by every button room, as the global is. MazeMapRoom::_marker(maze_rooms.h). A private array that nothing read or wrote. The maze map’s four markers arekMarkers, which the claim and click use. It’s removed.kBigHead(wizards_rooms.cpp). A room-name constant that nothing used. It’s removed.
Both unused names date from the rename commit d168cbbcc6 (2026-11-23) or
earlier.
Scope
In scope: fork terraglyph.h, room_class.cpp, maze_rooms.h,
wizards_rooms.cpp; this packet, its pre-flight and the index row.
Out of scope: the warnings outside the engine (GCC: engines/gob/dataio.cpp,
audio/mac/halestorm.cpp), which are upstream’s.
Exit criteria
- Clang. The Android tree, rebuilt with the four files, prints no warnings.
- GCC. The terraglyph-only Windows build prints no warnings in the engine.
- Self-test. Matches the WP-103 run except for the per-run random keys. No new warnings.
- Process. The fork PR against
scooby-engineis open (merged later the same day).
Result
Evidence labels: log (a build or self-test log).
- The fix (source). On
wp-105-clang-warnings(2a05a9e7f8): 14 lines added and 14 removed across the four files. - Clang (log). The WSL Android tree (
android-arm-v7a, release flags, as built for the TV) with the four files copied in:makerebuilt all 82 terraglyph objects, and the log has nowarning:lines at all. - GCC (log). The terraglyph-only build in the fork worktree has two
warnings, both outside the engine (
engines/gob/dataio.cpp,audio/mac/halestorm.cpp). - Self-test (log). 1882 check lines in both runs. The only differences from
the WP-103 run (
4360580) are the per-run random keys: the drawbridge’s banner and flag states and Ewan’sCurrentQuestion. 18 warnings in both. The menu lines that roll over buttons are unchanged.
Deliverables
- Fork:
wp-105-clang-warnings, PR barefootbetters/scummvm#30 (2a05a9e7f8), merged on 2026-11-28 as55c8b6b32a; the fork worktree is removed, andC:\dev\scummvmwas rebuilt from it. Staged by name:terraglyph.h,room_class.cpp,maze_rooms.h,wizards_rooms.cpp. - Docs: this packet, its pre-flight and the index row.
- Local only: the build and self-test logs.