summaryrefslogtreecommitdiff
path: root/src/boot_O2
diff options
context:
space:
mode:
authorEllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com>2021-09-24 00:14:12 +0100
committerGitHub <noreply@github.com>2021-09-23 20:14:12 -0300
commit9e4d51fb9ffc676607f6eb793fb21ef47c891ce5 (patch)
tree60357fb26335540af0806ec3651196924ca4bdca /src/boot_O2
parent2ff7320409d1f6340bed2ea37b7ceb3a49a57525 (diff)
printutils OK, add `va_end` to variadic functions (#294)
* printutils OK * Add va_end to every variadic function
Diffstat (limited to 'src/boot_O2')
-rw-r--r--src/boot_O2/gfxprint.c4
-rw-r--r--src/boot_O2/printutils.c13
2 files changed, 14 insertions, 3 deletions
diff --git a/src/boot_O2/gfxprint.c b/src/boot_O2/gfxprint.c
index 485799678..f671c6f5c 100644
--- a/src/boot_O2/gfxprint.c
+++ b/src/boot_O2/gfxprint.c
@@ -172,7 +172,7 @@ Gfx* GfxPrint_Close(GfxPrint* this) {
}
void GfxPrint_VPrintf(GfxPrint* this, const char* fmt, va_list args) {
- PrintUtils_VPrintf(&this->callback, fmt, args);
+ PrintUtils_VPrintf((PrintCallback*)&this->callback, fmt, args);
}
void GfxPrint_Printf(GfxPrint* this, const char* fmt, ...) {
@@ -180,4 +180,6 @@ void GfxPrint_Printf(GfxPrint* this, const char* fmt, ...) {
va_start(args, fmt);
GfxPrint_VPrintf(this, fmt, args);
+
+ va_end(args);
}
diff --git a/src/boot_O2/printutils.c b/src/boot_O2/printutils.c
index fb5b81033..4f04fca14 100644
--- a/src/boot_O2/printutils.c
+++ b/src/boot_O2/printutils.c
@@ -1,5 +1,14 @@
#include "global.h"
-#pragma GLOBAL_ASM("asm/non_matchings/boot/printutils/PrintUtils_VPrintf.s")
+void PrintUtils_VPrintf(PrintCallback* pfn, const char* fmt, va_list args) {
+ _Printf(*pfn, pfn, fmt, args);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/boot/printutils/PrintUtils_Printf.s")
+void PrintUtils_Printf(PrintCallback* pfn, const char* fmt, ...) {
+ va_list args;
+ va_start(args, fmt);
+
+ PrintUtils_VPrintf(pfn, fmt, args);
+
+ va_end(args);
+}