Merge pull request #19 from masagrator/master

Fix compiler errors in loader
This commit is contained in:
hanabbi
2023-05-28 11:36:34 +09:00
committed by GitHub
3 changed files with 9 additions and 8 deletions

View File

@@ -22,7 +22,7 @@ INC_DIRS := $(shell find $(SRC_DIRS) -type d)
# Add a prefix to INC_DIRS. So moduleA would become -ImoduleA. GCC understands this -I flag
INC_FLAGS := $(addprefix -I,$(INC_DIRS))
CPPFLAGS := $(INC_FLAGS) -Wall -Werror -std=c++20 -Og -g
CPPFLAGS := $(INC_FLAGS) -Wall -Werror -Wno-unused-result -std=c++20 -Og -g
# The final build step.
$(TARGET_EXEC): $(OBJS)

View File

@@ -84,7 +84,7 @@ Result Test_PcvDvfsTable() {
constexpr size_t limit = ams::ldr::oc::pcv::DvfsTableEntryLimit;
cvb_entry_t customized_table[limit] = {};
for (int i = 0; i < limit; i++) {
for (size_t i = 0; i < limit; i++) {
assert(GetDvfsTableEntryCount(customized_table) == i);
auto p = GetDvfsTableLastEntry(customized_table);
if (p)
@@ -160,8 +160,8 @@ int main(int argc, char** argv) {
ams::ldr::oc::pcv::erista::Patch(reinterpret_cast<uintptr_t>(erista_buf), file_size);
if (save_patched) {
char* exec_path_erista = reinterpret_cast<char *>(malloc(exec_path_patched_len));
strlcpy(exec_path_erista, exec_path, exec_path_patched_len);
strlcat(exec_path_erista, erista_ext, exec_path_patched_len);
strncpy(exec_path_erista, exec_path, exec_path_patched_len);
strncat(exec_path_erista, erista_ext, exec_path_patched_len);
saveExec(exec_path_erista, erista_buf, file_size);
free(exec_path_erista);
}
@@ -176,8 +176,8 @@ int main(int argc, char** argv) {
ams::ldr::oc::pcv::mariko::Patch(reinterpret_cast<uintptr_t>(mariko_buf), file_size);
if (save_patched) {
char* exec_path_mariko = reinterpret_cast<char *>(malloc(exec_path_patched_len));
strlcpy(exec_path_mariko, exec_path, exec_path_patched_len);
strlcat(exec_path_mariko, mariko_ext, exec_path_patched_len);
strncpy(exec_path_mariko, exec_path, exec_path_patched_len);
strncat(exec_path_mariko, mariko_ext, exec_path_patched_len);
saveExec(exec_path_mariko, mariko_buf, file_size);
free(exec_path_mariko);
}
@@ -193,8 +193,8 @@ int main(int argc, char** argv) {
ams::ldr::oc::ptm::Patch(reinterpret_cast<uintptr_t>(mariko_buf), file_size);
if (save_patched) {
char* exec_path_mariko = reinterpret_cast<char *>(malloc(exec_path_patched_len));
strlcpy(exec_path_mariko, exec_path, exec_path_patched_len);
strlcat(exec_path_mariko, mariko_ext, exec_path_patched_len);
strncpy(exec_path_mariko, exec_path, exec_path_patched_len);
strncat(exec_path_mariko, mariko_ext, exec_path_patched_len);
saveExec(exec_path_mariko, mariko_buf, file_size);
free(exec_path_mariko);
}

View File

@@ -17,6 +17,7 @@
#pragma once
#ifndef ATMOSPHERE_IS_STRATOSPHERE
#include <cassert>
#include <algorithm>
#include <cmath>
#include <cstddef>