ams: fix compilation with gcc 13

This commit is contained in:
Michael Scire
2023-05-06 17:49:36 -07:00
committed by SciresM
parent ed9e60acb9
commit 1f5ec68a5c
8 changed files with 8 additions and 28 deletions

View File

@@ -251,12 +251,11 @@ namespace ams::mitm::fs {
using DirectoryTableWriter = TableWriter<DirectoryEntry>;
using FileTableWriter = TableWriter<FileEntry>;
constexpr inline u32 CalculatePathHash(u32 parent, const char *_path, u32 start, size_t path_len) {
const unsigned char *path = reinterpret_cast<const unsigned char *>(_path);
constexpr inline u32 CalculatePathHash(u32 parent, const char *path, u32 start, size_t path_len) {
u32 hash = parent ^ 123456789;
for (size_t i = 0; i < path_len; i++) {
hash = (hash >> 5) | (hash << 27);
hash ^= path[start + i];
hash ^= static_cast<unsigned char>(path[start + i]);
}
return hash;
}