[olympic] Enable warnings for unsafe buffers

This commit is contained in:
2024-11-26 23:58:11 -06:00
parent a0ed1b3f62
commit 86b9f9316e
7 changed files with 76 additions and 61 deletions

View File

@ -14,7 +14,7 @@ ox::Result<ox::UUID> readUuidHeader(ox::BufferView buff) noexcept {
if (k1Hdr != ox::StringView(buff.data(), k1Hdr.bytes())) [[unlikely]] {
return OxError(2, "No Keel asset header data");
}
return ox::UUID::fromString(ox::StringView(buff.data() + k1Hdr.bytes(), 36));
return ox::UUID::fromString(ox::StringView(&buff[k1Hdr.bytes()], 36));
}
ox::Result<ox::ModelObject> readAsset(ox::TypeStore &ts, ox::BufferView buff) noexcept {

View File

@ -25,9 +25,10 @@ static std::map<ox::StringView, ox::Error(*)()> tests = {
},
};
int main(int argc, const char **args) {
int main(int argc, const char **argv) {
int retval = -1;
if (argc > 0) {
auto const args = ox::SpanView{argv, static_cast<size_t>(argc)};
auto testName = args[1];
if (tests.find(testName) != tests.end()) {
retval = static_cast<int>(tests[testName]());