strat: build sysmodules with -Wextra/-Werror

This commit is contained in:
Michael Scire 2021-10-06 23:22:54 -07:00
parent e8f1efd01b
commit 6a53726833
61 changed files with 433 additions and 217 deletions

View file

@ -118,7 +118,7 @@ namespace ams::pm::impl {
};
/* Process Tracking globals. */
void ProcessTrackingMain(void *arg);
void ProcessTrackingMain(void *);
constinit os::ThreadType g_process_track_thread;
alignas(os::ThreadStackAlignment) constinit u8 g_process_track_thread_stack[16_KB];
@ -154,7 +154,7 @@ namespace ams::pm::impl {
void OnProcessSignaled(ProcessListAccessor &list, ProcessInfo *process_info);
/* Helpers. */
void ProcessTrackingMain(void *arg) {
void ProcessTrackingMain(void *) {
/* This is the main loop of the process tracking thread. */
/* Setup multi wait/holders. */
@ -552,6 +552,7 @@ namespace ams::pm::impl {
/* Information Getters. */
Result GetModuleIdList(u32 *out_count, u8 *out_buf, size_t max_out_count, u64 unused) {
/* This function was always stubbed... */
AMS_UNUSED(out_buf, max_out_count, unused);
*out_count = 0;
return ResultSuccess();
}
@ -560,11 +561,19 @@ namespace ams::pm::impl {
ProcessListAccessor list(g_process_list);
size_t count = 0;
for (auto &process : *list) {
if (process.HasExceptionWaitingAttach()) {
out_process_ids[count++] = process.GetProcessId();
if (max_out_count > 0) {
for (auto &process : *list) {
if (process.HasExceptionWaitingAttach()) {
out_process_ids[count++] = process.GetProcessId();
if (count >= max_out_count) {
break;
}
}
}
}
*out_count = static_cast<u32>(count);
return ResultSuccess();
}

View file

@ -218,28 +218,46 @@ namespace {
}
void *operator new(size_t size) {
namespace ams {
void *Malloc(size_t) {
AMS_ABORT("ams::Malloc was called");
}
void Free(void *) {
AMS_ABORT("ams::Free was called");
}
}
void *operator new(size_t) {
AMS_ABORT("operator new(size_t) was called");
}
void operator delete(void *p) {
void operator delete(void *) {
AMS_ABORT("operator delete(void *) was called");
}
void *__libnx_alloc(size_t size) {
void operator delete(void *, size_t) {
AMS_ABORT("operator delete(void *, size_t) was called");
}
void *__libnx_alloc(size_t) {
AMS_ABORT("__libnx_alloc was called");
}
void *__libnx_aligned_alloc(size_t alignment, size_t size) {
void *__libnx_aligned_alloc(size_t, size_t) {
AMS_ABORT("__libnx_aligned_alloc was called");
}
void __libnx_free(void *mem) {
void __libnx_free(void *) {
AMS_ABORT("__libnx_free was called");
}
int main(int argc, char **argv)
{
AMS_UNUSED(argc, argv);
/* Set thread name. */
os::SetThreadNamePointer(os::GetCurrentThread(), AMS_GET_SYSTEM_THREAD_NAME(pm, Main));
AMS_ASSERT(os::GetThreadPriority(os::GetCurrentThread()) == AMS_GET_SYSTEM_THREAD_PRIORITY(pm, Main));