From 46b5ce1b8f52329a18095da9ca4a5ee58345ff92 Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Thu, 19 Sep 2019 13:26:01 -0400 Subject: added arg type checking --- util/err.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'util') diff --git a/util/err.c b/util/err.c index 3fe3b53..c5d32b2 100644 --- a/util/err.c +++ b/util/err.c @@ -12,6 +12,15 @@ #define TEXT_IMPORTANT(x) x #endif +static inline const char *ordinals(size_t x) { + switch (x % 10) { + case 1: return "st"; + case 2: return "nd"; + case 3: return "rd"; + default: return "th"; + } +} + typedef uint32_t LineNo; typedef struct { -- cgit v1.2.3