mirror of https://github.com/AxioDL/metaforce.git
Editor/ProjectManager: Remove pointer cast in GetObj()
Pointer casting like this is technically undefined behavior, we can just use a lambda and forward the arguments over to the athena read handler.
This commit is contained in:
parent
df663359c7
commit
43e808ff17
|
@ -118,7 +118,12 @@ bool ProjectManager::openProject(hecl::SystemStringView path) {
|
||||||
return makeProj(true);
|
return makeProj(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
yaml_parser_set_input(r.getParser(), (yaml_read_handler_t*)athena::io::YAMLAthenaReader, &reader);
|
const auto readHandler = [](void* data, unsigned char* buffer, size_t size, size_t* size_read) {
|
||||||
|
auto* const reader = static_cast<athena::io::IStreamReader*>(data);
|
||||||
|
return athena::io::YAMLAthenaReader(reader, buffer, size, size_read);
|
||||||
|
};
|
||||||
|
|
||||||
|
yaml_parser_set_input(r.getParser(), readHandler, &reader);
|
||||||
if (!r.ValidateClassType("UrdeSpacesState")) {
|
if (!r.ValidateClassType("UrdeSpacesState")) {
|
||||||
return makeProj(true);
|
return makeProj(true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue