From 67cec6d2770aa14a13c89247612f16c628ebd54c Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Wed, 14 May 2025 12:20:02 -0600 Subject: libmisc: Remove uses of printf --- libfmt/libmisc.c | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) (limited to 'libfmt/libmisc.c') diff --git a/libfmt/libmisc.c b/libfmt/libmisc.c index 04affb7..552b916 100644 --- a/libfmt/libmisc.c +++ b/libfmt/libmisc.c @@ -11,17 +11,11 @@ #endif #include /* for LM_UNUSED() */ -#include /* for __lm_printf() and __lm_light_printf() */ +#include /* for __lm_printf() */ #include /* for fmt_vfctprintf() */ -#if LIB_PICO_STDIO -static void libfmt_light_fct(char character, void *LM_UNUSED(arg)) { - if (character == '\n') - stdio_putchar_raw('\r'); - stdio_putchar_raw(character); -} -#else +#if !LIB_PICO_STDIO static void libfmt_libc_fct(char character, void *LM_UNUSED(arg)) { putchar(character); } @@ -43,25 +37,6 @@ size_t __lm_printf(const char *format, ...) { return ret; } -size_t __lm_light_printf(const char *format, ...) { - va_list va; - va_start(va, format); -#if LIB_PICO_STDIO - /* libfmt_light_fct() and stdio_buffered_printer() both use 68 - * bytes of stack; but the buffer lives on the stack of - * stdio.c:__wrap_vprintf(); so that's where you'll see the - * numbers be different if you're analyzing it. (Also, being - * able to skip the stdio_stack_buffer_flush() call.) */ - size_t ret = (size_t) fmt_vfctprintf(libfmt_light_fct, NULL, format, va); - stdio_flush(); -#else - size_t ret = (size_t) fmt_vfctprintf(libfmt_libc_fct, NULL, format, va); - fflush(stdout); -#endif - va_end(va); - return ret; -} - static void libfmt_conv_formatter(struct fmt_state *state) { lo_interface fmt_formatter obj = va_arg(*state->args, lo_interface fmt_formatter); LO_CALL(obj, format, state); -- cgit v1.2.3-2-g168b