From eb8f292181e87747d73f56decf8fdb3cc0cf4053 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Mon, 17 Jun 2019 22:57:49 -0500 Subject: [PATCH] [nostalgia/tools] Cleanup --- src/nostalgia/tools/pack/pack.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/nostalgia/tools/pack/pack.cpp b/src/nostalgia/tools/pack/pack.cpp index 9cce07c4..ffe57fb2 100644 --- a/src/nostalgia/tools/pack/pack.cpp +++ b/src/nostalgia/tools/pack/pack.cpp @@ -40,16 +40,16 @@ ox::Error toMetalClaw(std::vector*) { ox::Error transformClaw(ox::FileSystem32 *dest, std::string path) { // copy dest->ls(path.c_str(), [dest, path](const char *name, ox::InodeId_t) { - auto stat = dest->stat(path.c_str()); - oxReturnError(stat.error); - if (stat.value.fileType == ox::FileType_Directory) { + auto [stat, err] = dest->stat(path.c_str()); + oxReturnError(err); + if (stat.fileType == ox::FileType_Directory) { const auto dir = path + name + '/'; oxReturnError(transformClaw(dest, dir)); } else { // do transforms if (endsWith(path, ".claw")) { // load file - std::vector buff(stat.value.size); + std::vector buff(stat.size); oxReturnError(dest->read(path.c_str(), buff.data(), buff.size())); // do transformations oxReturnError(pathToInode(&buff)); @@ -66,9 +66,9 @@ ox::Error transformClaw(ox::FileSystem32 *dest, std::string path) { ox::Error copy(ox::PassThroughFS *src, ox::FileSystem32 *dest, std::string path) { // copy src->ls(path.c_str(), [src, dest, path](const char *name, ox::InodeId_t) { - auto stat = src->stat(path.c_str()); - oxReturnError(stat.error); - if (stat.value.fileType == ox::FileType_Directory) { + auto [stat, err] = src->stat(path.c_str()); + oxReturnError(err); + if (stat.fileType == ox::FileType_Directory) { const auto dir = path + name + '/'; oxReturnError(dest->mkdir(dir.c_str())); oxReturnError(copy(src, dest, dir)); @@ -84,7 +84,7 @@ ox::Error copy(ox::PassThroughFS *src, ox::FileSystem32 *dest, std::string path) } } else { // load file - buff.resize(stat.value.size); + buff.resize(stat.size); oxReturnError(src->read(path.c_str(), buff.data(), buff.size())); } // write file to dest