aboutsummaryrefslogtreecommitdiff
path: root/nextlang.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-02-17 14:47:14 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-02-17 14:47:14 -0500
commit5d2d54ae0ebad9b7e2314735ba89b8e09b4ab147 (patch)
tree4cebfd72fd0d04d16c761663c999a2a6333319ad /nextlang.h
parent605eb45626a0076b748a23f77a1899fc0e5b631a (diff)
Tweak cord formatting
Diffstat (limited to 'nextlang.h')
-rw-r--r--nextlang.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/nextlang.h b/nextlang.h
index c02760de..30a8aecc 100644
--- a/nextlang.h
+++ b/nextlang.h
@@ -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: "???")