diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-05-14 12:20:02 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-05-15 14:51:15 -0600 |
commit | 67cec6d2770aa14a13c89247612f16c628ebd54c (patch) | |
tree | 0a64beaa2f57f5b6e4db5e2ea84811cb05406958 /libfmt/libmisc.c | |
parent | f01b89b599d40df5d6c127310b0030cd41c8dc85 (diff) |
libmisc: Remove uses of printf
Diffstat (limited to 'libfmt/libmisc.c')
-rw-r--r-- | libfmt/libmisc.c | 29 |
1 files changed, 2 insertions, 27 deletions
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 <libmisc/macro.h> /* for LM_UNUSED() */ -#include <libmisc/_intercept.h> /* for __lm_printf() and __lm_light_printf() */ +#include <libmisc/_intercept.h> /* for __lm_printf() */ #include <libfmt/fmt.h> /* 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); |