diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-02-17 14:47:14 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-02-17 14:47:14 -0500 |
| commit | 5d2d54ae0ebad9b7e2314735ba89b8e09b4ab147 (patch) | |
| tree | 4cebfd72fd0d04d16c761663c999a2a6333319ad /nextlang.h | |
| parent | 605eb45626a0076b748a23f77a1899fc0e5b631a (diff) | |
Tweak cord formatting
Diffstat (limited to 'nextlang.h')
| -rw-r--r-- | nextlang.h | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -40,13 +40,13 @@ CORD as_cord(void *x, bool use_color, const char *fmt, ...); -#define CORD_asprintf(...) ({ CORD $c; CORD_sprintf(&$c, __VA_ARGS__); $c; }) +#define StrF(...) ({ CORD $c; CORD_sprintf(&$c, __VA_ARGS__); $c; }) #define $var(var, val) __typeof(val) var = val #define $cord(x) _Generic(x, bool: x ? "yes" : "no", \ - int8_t: CORD_asprintf("%d", x), \ - int16_t: CORD_asprintf("%d", x), \ - int32_t: CORD_asprintf("%d", x), int64_t: CORD_asprintf("%ld", x), \ - double: CORD_asprintf("%g", x), float: CORD_asprintf("%g", x), \ + int8_t: StrF("%d", x), \ + int16_t: StrF("%d", x), \ + int32_t: StrF("%d", x), int64_t: StrF("%ld", x), \ + double: StrF("%g", x), float: StrF("%g", x), \ CORD: x, \ array_t: as_cord($stack(x), false, "[ ]"), \ default: "???") |
