From d528ebfe9610ed190b7c1efb6a1373b5b6cb0eb2 Mon Sep 17 00:00:00 2001 From: tracer-ics2023 Date: Sat, 14 Sep 2024 11:45:08 +0800 Subject: [PATCH] =?UTF-8?q?>=20=20compile=20NEMU=20221220000=20=E5=BC=A0?= =?UTF-8?q?=E4=B8=89=20Linux=20zzy=205.15.146.1-microsoft-standard-WSL2=20?= =?UTF-8?q?#1=20SMP=20Thu=20Jan=2011=2004:09:03=20UTC=202024=20x86=5F64=20?= =?UTF-8?q?x86=5F64=20x86=5F64=20GNU/Linux=20=2011:45:08=20up=202=20days,?= =?UTF-8?q?=20=201:59,=20=201=20user,=20=20load=20average:=201.05,=200.55,?= =?UTF-8?q?=200.42?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- abstract-machine/klib/src/printf.c | 12 ++++++------ abstract-machine/klib/src/stdio.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/abstract-machine/klib/src/printf.c b/abstract-machine/klib/src/printf.c index 07a4d15..788b916 100644 --- a/abstract-machine/klib/src/printf.c +++ b/abstract-machine/klib/src/printf.c @@ -27,15 +27,15 @@ int num_to_ascii(int num, int power, int size, char *buf) { return ret; } -static inline int print_fmt(char **out, int n, const char** fmt, va_list* ap) { +static inline int print_fmt(char **out, int n, const char** fmt, va_list ap) { int ret = 0; switch (**fmt) { case 'd': - ret = num_to_ascii(va_arg(*ap, int), 10, n, *out); + ret = num_to_ascii(va_arg(ap, int), 10, n, *out); (*out) += ret; break; case 's': - const char* str = va_arg(*ap, const char*); + const char* str = va_arg(ap, const char*); if (ret > n) break; for (; *str; str ++, (*out) ++, ret ++ ) { if (ret >= n) { @@ -45,13 +45,13 @@ static inline int print_fmt(char **out, int n, const char** fmt, va_list* ap) { } break; case 'c': - char ch = va_arg(*ap, int); + char ch = va_arg(ap, int); ret = 1; **out = ch; (*out) ++; break; case 'x': - ret = num_to_ascii(va_arg(*ap, int), 16, n, *out); + ret = num_to_ascii(va_arg(ap, int), 16, n, *out); (*out) += ret; break; default: @@ -61,7 +61,7 @@ static inline int print_fmt(char **out, int n, const char** fmt, va_list* ap) { return ret; } -int rvsnprintf(char* out, size_t n, const char* fmt, va_list* ap) { +int rvsnprintf(char* out, size_t n, const char* fmt, va_list ap) { int ret = 0; while(*fmt && n) { if (*fmt == '%') { diff --git a/abstract-machine/klib/src/stdio.c b/abstract-machine/klib/src/stdio.c index 751c96b..8c8aaac 100644 --- a/abstract-machine/klib/src/stdio.c +++ b/abstract-machine/klib/src/stdio.c @@ -34,10 +34,10 @@ int snprintf(char *out, size_t n, const char *fmt, ...) { return ret; } -int rvsnprintf(char* out, size_t n, const char* fmt, va_list* ap); +int rvsnprintf(char* out, size_t n, const char* fmt, va_list ap); int vsnprintf(char *out, size_t n, const char *fmt, va_list ap) { - return rvsnprintf(out, n, fmt, &ap); + return rvsnprintf(out, n, fmt, ap); } #endif