From d610cfa8268f963ae5f10a91d6d2fd17d5e59978 Mon Sep 17 00:00:00 2001 From: offtkp Date: Sat, 29 Jul 2023 18:50:51 +0300 Subject: [PATCH] Change some function specifiers --- src/core/fs/romfs.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/fs/romfs.cpp b/src/core/fs/romfs.cpp index cf302cc1..1f081e9a 100644 --- a/src/core/fs/romfs.cpp +++ b/src/core/fs/romfs.cpp @@ -24,13 +24,13 @@ namespace RomFS { u32 fileDataOffset; }; - inline uintptr_t align(uintptr_t value, uintptr_t alignment) { + inline constexpr uintptr_t alignUp(uintptr_t value, uintptr_t alignment) { if (value % alignment == 0) return value; return value + (alignment - (value % alignment)); } - inline void printNode(const RomFSNode& node, int indentation) { + void printNode(const RomFSNode& node, int indentation) { for (int i = 0; i < indentation; i++) { printf(" "); } @@ -159,11 +159,11 @@ namespace RomFS { return {}; } - uintptr_t masterHashOffset = RomFS::align(ivfcSize, 0x10); + uintptr_t masterHashOffset = RomFS::alignUp(ivfcSize, 0x10); // For a weird reason, the level 3 offset is not the one in the IVFC, instead it's // the first block after the master hash // TODO: Find out why and explain in the comment - uintptr_t level3Offset = RomFS::align(masterHashOffset + ivfc.masterHashSize, ivfc.levels[2].blockSize); + uintptr_t level3Offset = RomFS::alignUp(masterHashOffset + ivfc.masterHashSize, ivfc.levels[2].blockSize); uintptr_t level3Base = (uintptr_t)romFS + level3Offset; u32* level3Ptr = (u32*)level3Base;