From ba3c55ab7b40dd9c227cef8f3c3fdd2650f9fdce Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 27 Nov 2019 05:26:31 -0500 Subject: [PATCH 1/2] filesys/romfs: Make ProcessFile and ProcessDirectory internally linked These functions aren't used outside of this file, so we can place them within an anonymous namespace. --- src/core/file_sys/romfs.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/file_sys/romfs.cpp b/src/core/file_sys/romfs.cpp index ebbdf081ee..5f24bc5ae8 100644 --- a/src/core/file_sys/romfs.cpp +++ b/src/core/file_sys/romfs.cpp @@ -12,7 +12,7 @@ #include "core/file_sys/vfs_vector.h" namespace FileSys { - +namespace { constexpr u32 ROMFS_ENTRY_EMPTY = 0xFFFFFFFF; struct TableLocation { @@ -51,7 +51,7 @@ struct FileEntry { static_assert(sizeof(FileEntry) == 0x20, "FileEntry has incorrect size."); template -static std::pair GetEntry(const VirtualFile& file, std::size_t offset) { +std::pair GetEntry(const VirtualFile& file, std::size_t offset) { Entry entry{}; if (file->ReadObject(&entry, offset) != sizeof(Entry)) return {}; @@ -99,6 +99,7 @@ void ProcessDirectory(VirtualFile file, std::size_t dir_offset, std::size_t file this_dir_offset = entry.first.sibling; } } +} // Anonymous namespace VirtualDir ExtractRomFS(VirtualFile file, RomFSExtractionType type) { RomFSHeader header{}; From d66ab2b8aa6042672581064172ab1f2a5489461b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 27 Nov 2019 05:28:19 -0500 Subject: [PATCH 2/2] filesys/romfs: Remove unused includes These inclusions aren't used at all within the public interface, so they can be removed. --- src/core/file_sys/romfs.cpp | 2 ++ src/core/file_sys/romfs.h | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/core/file_sys/romfs.cpp b/src/core/file_sys/romfs.cpp index 5f24bc5ae8..c909d1ce40 100644 --- a/src/core/file_sys/romfs.cpp +++ b/src/core/file_sys/romfs.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include + #include "common/common_types.h" #include "common/swap.h" #include "core/file_sys/fsmitm_romfsbuild.h" diff --git a/src/core/file_sys/romfs.h b/src/core/file_sys/romfs.h index 1c89be8a49..2fd07ed04c 100644 --- a/src/core/file_sys/romfs.h +++ b/src/core/file_sys/romfs.h @@ -5,10 +5,6 @@ #pragma once #include -#include -#include "common/common_funcs.h" -#include "common/common_types.h" -#include "common/swap.h" #include "core/file_sys/vfs.h" namespace FileSys {