fix(quality): real auto-save bug + clear all compiler warnings

The compiler-warning sweep surfaced one real behavioral bug and a
handful of cosmetic noise:

REAL BUG — editor_app.cpp:1069 misleading-indentation:

    if (objectPlacer_.objectCount() > 0 || npcSpawner_.spawnCount() > 0)
        objectsDirty_ = true; autoSavePendingChanges_ = true;

The trailing `autoSavePendingChanges_ = true;` was OUTSIDE the if, so
the auto-save flag was set unconditionally on every reload — meaning
zones with zero objects/NPCs were getting needlessly auto-saved. Wrap
both writes in braces so they share the guard.

Cosmetic / noise — also fixed so the warning channel stays useful:

- cli_mesh_io.cpp:193,194,333 — same misleading-indentation pattern
  (`if (a) x; if (b) y;` chained on one line). Replaced with std::clamp.
- cli_for_each.cpp:26,114,116 — `\\` at end of `//` comment was
  treated as line-continuation, silently extending the comment to the
  next line. Replaced the trailing-backslash convention with literal
  "(continued)" markers in the example shell command.
- world_map/input_handler.cpp:14 — unused `cosmicEnabled` parameter
  marked [[maybe_unused]].
- wowee_player_spawn_profiles.cpp:75 — unused CLS_PALADIN constant
  marked [[maybe_unused]] (kept to document the bit layout).
- wowee_crafting_recipes.cpp — three unused `using R = …` aliases
  removed.
- cli_data_tree.cpp:609, cli_format_validate.cpp:950 — unused argc
  parameters marked [[maybe_unused]] in handlers I touched recently.

CMakeLists.txt: editor's CLI handlers all share `(int& i, int argc,
char** argv)` so they can plug into a function-pointer table; many
handlers don't reference argc. Added -Wno-unused-parameter to the
editor target rather than littering 30+ handler signatures with
[[maybe_unused]] noise. Main wowee target keeps the warning enabled.

Result: clean build with -Wall -Wextra -Wpedantic, zero warnings in
our code (the remaining ones are all in extern/ third-party headers).
This commit is contained in:
Kelsi 2026-05-13 20:05:52 -07:00
parent bf75ccd15b
commit 630c8bce29
9 changed files with 25 additions and 17 deletions

View file

@ -606,7 +606,7 @@ int handleStripDataTree(int& i, int argc, char** argv) {
return failed == 0 ? 0 : 1;
}
int handleAuditDataTree(int& i, int argc, char** argv) {
int handleAuditDataTree(int& i, [[maybe_unused]] int argc, char** argv) {
// Non-destructive CI gate. Walks <srcDir> and exits 1 if
// any proprietary file (.m2/.wmo/.blp/.dbc) lacks a
// matching open sidecar at the same (parent, stem). The