lib: fix clang compatibility / warnings

This commit is contained in:
Dirk-Jan C. Binnema
2022-02-18 10:49:56 +02:00
parent d2e6cfdf70
commit c0da564bba
16 changed files with 48 additions and 22 deletions

View File

@ -162,6 +162,16 @@ Command::get_int(const Parameters& params, const std::string& argname)
return ::atoi(it->value().c_str());
}
std::optional<unsigned>
Command::get_unsigned(const Parameters& params, const std::string& argname)
{
if (auto val = get_int(params, argname); val && *val >= 0)
return val;
else
return std::nullopt;
}
std::optional<bool>
Command::get_bool(const Parameters& params, const std::string& argname)
{