mirror of
https://git.h3cjp.net/H3cJP/citra.git
synced 2024-12-28 06:06:55 +00:00
layered_fs: Mark functions as static where applicable
Makes them internally linked and prevents potential -Wmissing-declaration warnings.
This commit is contained in:
parent
85d37c9994
commit
37a6ea72e5
|
@ -275,7 +275,7 @@ void LayeredFS::LoadExtRelocations() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::size_t GetNameSize(const std::string& name) {
|
static std::size_t GetNameSize(const std::string& name) {
|
||||||
std::u16string u16name = Common::UTF8ToUTF16(name);
|
std::u16string u16name = Common::UTF8ToUTF16(name);
|
||||||
return Common::AlignUp(u16name.size() * 2, 4);
|
return Common::AlignUp(u16name.size() * 2, 4);
|
||||||
}
|
}
|
||||||
|
@ -310,7 +310,7 @@ void LayeredFS::PrepareBuild(Directory& current) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implementation from 3dbrew
|
// Implementation from 3dbrew
|
||||||
u32 CalcHash(const std::string& name, u32 parent_offset) {
|
static u32 CalcHash(const std::string& name, u32 parent_offset) {
|
||||||
u32 hash = parent_offset ^ 123456789;
|
u32 hash = parent_offset ^ 123456789;
|
||||||
std::u16string u16name = Common::UTF8ToUTF16(name);
|
std::u16string u16name = Common::UTF8ToUTF16(name);
|
||||||
for (char16_t c : u16name) {
|
for (char16_t c : u16name) {
|
||||||
|
@ -320,7 +320,7 @@ u32 CalcHash(const std::string& name, u32 parent_offset) {
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::size_t WriteName(u8* dest, std::u16string name) {
|
static std::size_t WriteName(u8* dest, std::u16string name) {
|
||||||
const auto buffer_size = Common::AlignUp(name.size() * 2, 4);
|
const auto buffer_size = Common::AlignUp(name.size() * 2, 4);
|
||||||
std::vector<u16_le> buffer(buffer_size / 2);
|
std::vector<u16_le> buffer(buffer_size / 2);
|
||||||
std::transform(name.begin(), name.end(), buffer.begin(), [](char16_t character) {
|
std::transform(name.begin(), name.end(), buffer.begin(), [](char16_t character) {
|
||||||
|
@ -431,7 +431,7 @@ void LayeredFS::BuildFiles() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implementation from 3dbrew
|
// Implementation from 3dbrew
|
||||||
std::size_t GetHashTableSize(std::size_t entry_count) {
|
static std::size_t GetHashTableSize(std::size_t entry_count) {
|
||||||
if (entry_count < 3) {
|
if (entry_count < 3) {
|
||||||
return 3;
|
return 3;
|
||||||
} else if (entry_count < 19) {
|
} else if (entry_count < 19) {
|
||||||
|
|
Loading…
Reference in a new issue