[ox] Correct bad bit_cast uses and improve constexpr-ness

This commit is contained in:
2021-11-28 21:03:29 -06:00
parent 22f08f83c5
commit 1f24912ddd
35 changed files with 247 additions and 214 deletions

View File

@ -95,8 +95,7 @@ Error PassThroughFS::ls(const char *dir, F cb) noexcept {
const auto di = std::filesystem::directory_iterator(m_path / stripSlash(dir), ec);
oxReturnError(OxError(ec.value(), "PassThroughFS: ls failed"));
for (auto &p : di) {
const auto u8p = p.path().filename().u8string();
oxReturnError(cb(bit_cast<const char*>(u8p.c_str()), 0));
oxReturnError(cb(p.path().filename().c_str(), 0));
}
return OxError(0);
}