2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 15:47:46 +00:00

General: Make use of FopenUnique where applicable

Migrates to the hecl Fopen variant that automatically closes its
contained file handle if it goes out of scope.
This commit is contained in:
Lioncash
2019-08-26 14:37:19 -04:00
parent f48ebefa84
commit 1d3062b33f
9 changed files with 60 additions and 73 deletions

View File

@@ -42,8 +42,8 @@ void SCLY::exportToLayerDirectories(const PAK::Entry& entry, PAKRouter<PAKBridge
layerPath.makeDirChain(true);
if (active) {
hecl::ProjectPath activePath(layerPath, "!defaultactive");
fclose(hecl::Fopen(activePath.getAbsolutePath().data(), _SYS_STR("wb")));
const hecl::ProjectPath activePath(layerPath, "!defaultactive");
[[maybe_unused]] const auto fp = hecl::FopenUnique(activePath.getAbsolutePath().data(), _SYS_STR("wb"));
}
hecl::ProjectPath yamlFile(layerPath, _SYS_STR("!objects.yaml"));