1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-10 19:20:13 +00:00

Add va_end and returns to variadic functions (#950)

This commit is contained in:
EllipticEllipsis 2021-09-07 17:17:19 +01:00 committed by GitHub
parent c577ed1e84
commit b1cd46c37c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 25 additions and 2 deletions

View file

@ -17,6 +17,8 @@ void osSyncPrintfUnused(const char* fmt, ...) {
va_start(args, fmt);
_Printf(is_proutSyncPrintf, NULL, fmt, args);
va_end(args);
}
void osSyncPrintf(const char* fmt, ...) {
@ -24,6 +26,8 @@ void osSyncPrintf(const char* fmt, ...) {
va_start(args, fmt);
_Printf(is_proutSyncPrintf, NULL, fmt, args);
va_end(args);
}
// assumption
@ -32,6 +36,8 @@ void rmonPrintf(const char* fmt, ...) {
va_start(args, fmt);
_Printf(is_proutSyncPrintf, NULL, fmt, args);
va_end(args);
}
void* is_proutSyncPrintf(void* arg, const char* str, u32 count) {

View file

@ -272,6 +272,8 @@ void FaultDrawer_Printf(const char* fmt, ...) {
va_start(args, fmt);
FaultDrawer_VPrintf(fmt, args);
va_end(args);
}
void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...) {
@ -280,6 +282,8 @@ void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...) {
FaultDrawer_SetCursor(x, y);
FaultDrawer_VPrintf(fmt, args);
va_end(args);
}
void FaultDrawer_SetDrawerFB(void* fb, u16 w, u16 h) {

View file

@ -357,8 +357,13 @@ s32 GfxPrint_VPrintf(GfxPrint* this, const char* fmt, va_list args) {
}
s32 GfxPrint_Printf(GfxPrint* this, const char* fmt, ...) {
s32 ret;
va_list args;
va_start(args, fmt);
return GfxPrint_VPrintf(this, fmt, args);
ret = GfxPrint_VPrintf(this, fmt, args);
va_end(args);
return ret;
}

View file

@ -5,8 +5,13 @@ s32 PrintUtils_VPrintf(PrintCallback* pfn, const char* fmt, va_list args) {
}
s32 PrintUtils_Printf(PrintCallback* pfn, const char* fmt, ...) {
s32 ret;
va_list args;
va_start(args, fmt);
return PrintUtils_VPrintf(pfn, fmt, args);
ret = PrintUtils_VPrintf(pfn, fmt, args);
va_end(args);
return ret;
}

View file

@ -21,5 +21,8 @@ s32 sprintf(char* dst, const char* fmt, ...) {
if (ret > -1) {
dst[ret] = 0;
}
va_end(args);
return ret;
}