Fix -Werror build: drop dead variables, honor nodiscard

Surfaced by a -DVOID_WARNINGS_AS_ERRORS=ON build now that Json/Ini are
pulled into SHARED module TUs (Log, Fsm, Plugin, Configuration):
- Json::Detail::parse_number: removed the unused is_float tracking var.
- Ini::from_string: (void)-cast the nodiscard parse() result.
- Fsm::Machine::dispatch_event: removed the dead `source` variable
  (the transition already carries its source state).

Module targets now compile clean under -Wall -Wextra -Wpedantic -Werror;
967 tests green, ASan+UBSan clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Fable 5 committed 2026-06-13 18:15:32 +03:00
1 parent c988f635e9
commit ff6960a2af
3 files changed
+3 -6

No files matched your search

+1 -1
View File
@@ -91,7 +91,7 @@ public:
[[nodiscard]] static IniFile from_string(std::string_view text)
{
IniFile f;
parse(f, text);
(void)parse(f, text);
return f;
}
+2 -3
View File
@@ -220,10 +220,9 @@ struct Parser
if (peek() == '-') advance();
if (peek() == '0') { advance(); }
else { while (peek() >= '1' && peek() <= '9') advance(); while (peek() >= '0' && peek() <= '9') advance(); }
bool is_float = false;
if (peek() == '.') { is_float = true; advance(); while (peek() >= '0' && peek() <= '9') advance(); }
if (peek() == '.') { advance(); while (peek() >= '0' && peek() <= '9') advance(); }
if (peek() == 'e' || peek() == 'E') {
is_float = true; advance();
advance();
if (peek() == '+' || peek() == '-') advance();
while (peek() >= '0' && peek() <= '9') advance();
}
-2
View File
@@ -403,7 +403,6 @@ namespace Void::Fsm
}
const MachineDef::TransitionDef* chosen = nullptr;
StateId source = leaf;
for (StateId cur = leaf; cur != kInvalidState && chosen == nullptr;
cur = def.state(cur).parent) {
for (const auto index : def.transitions_from(cur)) {
@@ -415,7 +414,6 @@ namespace Void::Fsm
continue;
}
chosen = &t;
source = cur;
break;
}
if (chosen == nullptr) {