Fix some warnings

This commit is contained in:
Megamouse
2026-04-30 17:08:01 +02:00
parent 66d2bc3dd5
commit a8dd053593
14 changed files with 13 additions and 24 deletions
-5
View File
@@ -253,10 +253,6 @@ bool try_to_float(f64* out, std::string_view value, f64 min, f64 max, std::strin
bool try_to_string(std::string* out, f64 value, std::string_view name)
{
#ifdef __APPLE__
if (out) *out = std::to_string(value);
return true;
#else
std::array<char, 32> str{};
if (auto [ptr, ec] = std::to_chars(str.data(), str.data() + str.size(), value, std::chars_format::fixed); ec == std::errc())
@@ -269,7 +265,6 @@ bool try_to_string(std::string* out, f64 value, std::string_view name)
if (out) cfg_log.error("cfg::try_to_string('%s'): could not convert value '%f' to string. error='%s'", name, value, std::make_error_code(ec).message());
return false;
}
#endif
}
bool cfg::try_to_enum_value(u64* out, decltype(&fmt_class_string<int>::format) func, std::string_view value, std::string_view name)
+1 -3
View File
@@ -1112,15 +1112,13 @@ bool fs::is_symlink(const std::string& path)
return true;
}
bool fs::is_optical_raw_device(const std::string& path)
bool fs::is_optical_raw_device([[maybe_unused]] const std::string& path)
{
#ifdef _WIN32
if (path.starts_with("\\\\.\\"))
{
return true;
}
return false;
#endif
return false;
}
+1 -1
View File
@@ -74,7 +74,7 @@ enum
};
#endif
inline int futex(volatile void* uaddr, int futex_op, uint val, const timespec* timeout = nullptr, uint mask = 0)
inline int futex(volatile void* uaddr, int futex_op, uint val, const timespec* timeout = nullptr, [[maybe_unused]] uint mask = 0)
{
#ifdef __linux__
return syscall(SYS_futex, uaddr, futex_op, static_cast<int>(val), timeout, nullptr, static_cast<int>(mask));