From c629eb35f1e65a7cef8fbbf12b4844db204edf35 Mon Sep 17 00:00:00 2001 From: Myria Date: Sat, 3 Jun 2017 10:15:12 -0700 Subject: [PATCH 1/2] Added 11.3 and 11.4 system calls SetGpuProt and SetWifiEnabled. Also, switched from C99 to C11 to get _Static_assert. --- ctrtool/Makefile | 2 +- ctrtool/syscalls.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ctrtool/Makefile b/ctrtool/Makefile index 55bc16b..8f07f97 100644 --- a/ctrtool/Makefile +++ b/ctrtool/Makefile @@ -5,7 +5,7 @@ OBJS = $(foreach dir,$(SRC_DIR),$(subst .c,.o,$(wildcard $(dir)/*.c))) $(foreach # Compiler Settings OUTPUT = ctrtool CXXFLAGS = -I. -CFLAGS = -O2 -Wall -Wno-unused-variable -Wno-unused-result -I. -std=c99 +CFLAGS = -O2 -Wall -Wno-unused-variable -Wno-unused-result -I. -std=c11 CC = gcc CXX = g++ SYS := $(shell gcc -dumpmachine) diff --git a/ctrtool/syscalls.c b/ctrtool/syscalls.c index edf8e8c..cd37cf8 100644 --- a/ctrtool/syscalls.c +++ b/ctrtool/syscalls.c @@ -95,8 +95,8 @@ static const char *const syscall_list[NUM_SYSCALLS] = "StopDma", // 56 "GetDmaState", // 57 "RestartDma", // 58 - NULL, // 59 - NULL, // 5A + "SetGpuProt", // 59 + "SetWifiEnabled", // 5A NULL, // 5B NULL, // 5C NULL, // 5D @@ -139,7 +139,8 @@ static const char *const syscall_list[NUM_SYSCALLS] = void syscall_get_name(char *output, size_t size, unsigned int call_num) { - typedef char StaticAssert[sizeof(syscall_list) / sizeof(syscall_list[0]) == NUM_SYSCALLS ? 1 : -1]; + _Static_assert(sizeof(syscall_list) / sizeof(syscall_list[0]) == NUM_SYSCALLS, + "syscall table length mismatch"); if (size == 0) { From 4d5d9582a207eaaec4aa7fd141d5407205ed552d Mon Sep 17 00:00:00 2001 From: Myria Date: Sat, 3 Jun 2017 10:17:27 -0700 Subject: [PATCH 2/2] Warning fix. Uninitialized variable shouldn't have happened because it'd mean header was corrupt...? --- ctrtool/cwav.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ctrtool/cwav.c b/ctrtool/cwav.c index cf9f59b..c87ede4 100644 --- a/ctrtool/cwav.c +++ b/ctrtool/cwav.c @@ -814,6 +814,8 @@ int cwav_pcm_setup(cwav_pcmstate* state, cwav_context* ctx, int isloop) startoffset = getle32(ctx->infoheader.loopstart); else if (ctx->infoheader.encoding == CWAV_ENCODING_PCM16) startoffset = getle32(ctx->infoheader.loopstart) * 2; + else + startoffset = 0; } else {