From 0ca8e614dc99eae0e638224aafee8cf090594429 Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Mon, 29 May 2023 20:35:15 -0400 Subject: [PATCH] copysym: Avoid including xtra.h. Using the xtra.h header just for the arraysize macro is just added complexity for downstream projects (who then need to ensure the xtra.h header is distributed even if they don't otherwise need it). --- src/copysym.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/copysym.c b/src/copysym.c index 8ecace7..7de9e98 100644 --- a/src/copysym.c +++ b/src/copysym.c @@ -17,7 +17,8 @@ #include #include #include -#include "xtra.h" + +#define ARRAYSIZE(x) (sizeof (x) / sizeof (x)[0]) static int compar_5arr(const void *key, const void *elem_) { @@ -130,7 +131,7 @@ const char *copyright_symbol(const char *charset) if (!charset) goto no_conv; - m1 = bsearch(charset, t1, XTRA_ARRAYSIZE(t1), sizeof *t1, compar_5arr); + m1 = bsearch(charset, t1, ARRAYSIZE(t1), sizeof *t1, compar_5arr); if (!m1) goto no_conv; charset += 5; -- 2.43.2