summaryrefslogtreecommitdiff
path: root/src/numfmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/numfmt.c')
-rw-r--r--src/numfmt.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/numfmt.c b/src/numfmt.c
index 9a321d697..8c21c2b3a 100644
--- a/src/numfmt.c
+++ b/src/numfmt.c
@@ -190,13 +190,28 @@ static uintmax_t header = 0;
error (similar to sort's debug). */
static bool debug;
-/* debugging for developers. Enables devmsg(). */
-bool dev_debug = false;
-
/* will be set according to the current locale. */
static const char *decimal_point;
static int decimal_point_length;
+/* debugging for developers. Enables devmsg(). */
+static bool dev_debug = false;
+
+/* Like error(0, 0, ...), but without an implicit newline.
+ Also a noop unless the global DEV_DEBUG is set.
+ TODO: Replace with variadic macro in system.h or
+ move to a separate module. */
+static inline void
+devmsg (char const *fmt, ...)
+{
+ if (dev_debug)
+ {
+ va_list ap;
+ va_start (ap, fmt);
+ vfprintf (stderr, fmt, ap);
+ va_end (ap);
+ }
+}
static inline int
default_scale_base (enum scale_type scale)