don't wrongly try to use constexpr on non constexpr functions

This commit is contained in:
HookedBehemoth 2019-12-11 01:49:10 +01:00
parent ab7b9eda0e
commit 92b4d399d1

View file

@ -28,29 +28,29 @@ namespace tin::install
static_assert(sizeof(HFS0BaseHeader) == 0x10, "HFS0BaseHeader must be 0x10");
NX_CONSTEXPR const HFS0FileEntry *hfs0GetFileEntry(const HFS0BaseHeader *header, u32 i)
NX_INLINE const HFS0FileEntry *hfs0GetFileEntry(const HFS0BaseHeader *header, u32 i)
{
if (i >= header->numFiles)
return NULL;
return (const HFS0FileEntry*)(header + 0x1 + i * 0x4);
}
NX_CONSTEXPR const char *hfs0GetStringTable(const HFS0BaseHeader *header)
NX_INLINE const char *hfs0GetStringTable(const HFS0BaseHeader *header)
{
return (const char*)(header + 0x1 + header->numFiles * 0x4);
}
NX_CONSTEXPR u64 hfs0GetHeaderSize(const HFS0BaseHeader *header)
NX_INLINE u64 hfs0GetHeaderSize(const HFS0BaseHeader *header)
{
return 0x1 + header->numFiles * 0x4 + header->stringTableSize;
}
NX_CONSTEXPR const char *hfs0GetFileName(const HFS0BaseHeader *header, u32 i)
NX_INLINE const char *hfs0GetFileName(const HFS0BaseHeader *header, u32 i)
{
return hfs0GetStringTable(header) + hfs0GetFileEntry(header, i)->stringTableOffset;
}
NX_CONSTEXPR const char *hfs0GetFileName(const HFS0BaseHeader *header, const HFS0FileEntry *entry)
NX_INLINE const char *hfs0GetFileName(const HFS0BaseHeader *header, const HFS0FileEntry *entry)
{
return hfs0GetStringTable(header) + entry->stringTableOffset;
}