From 9da5949b953ae5424afb77ff4280399eacf414d4 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 28 Apr 2025 16:05:09 -0400 Subject: Remove remaining printf references --- src/stdlib/print.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/stdlib/print.h') diff --git a/src/stdlib/print.h b/src/stdlib/print.h index 454ef6b8..9bd89aea 100644 --- a/src/stdlib/print.h +++ b/src/stdlib/print.h @@ -42,6 +42,11 @@ typedef struct { } hex_format_t; #define hex(x, ...) ((hex_format_t){.n=x, __VA_ARGS__}) +typedef struct { + double d; +} hex_double_t; +#define hex_double(x, ...) ((hex_double_t){.d=x, __VA_ARGS__}) + typedef struct { uint64_t n; bool no_prefix; @@ -76,6 +81,7 @@ int _print_int(FILE *f, int64_t x); int _print_uint(FILE *f, uint64_t x); int _print_double(FILE *f, double x); int _print_hex(FILE *f, hex_format_t hex); +int _print_hex_double(FILE *f, hex_double_t hex); int _print_oct(FILE *f, oct_format_t oct); PRINT_FN _print_float(FILE *f, float x) { return _print_double(f, (double)x); } PRINT_FN _print_pointer(FILE *f, void *p) { return _print_hex(f, hex((uint64_t)p)); } @@ -111,6 +117,7 @@ extern int Int$print(FILE *f, Int_t i); float: _print_float, \ double: _print_double, \ hex_format_t: _print_hex, \ + hex_double_t: _print_hex_double, \ oct_format_t: _print_oct, \ quoted_t: _print_quoted, \ string_slice_t: _print_string_slice, \ -- cgit v1.2.3