]> git.draconx.ca Git - dxcommon.git/blobdiff - src/copysym.c
help: Allow tests to build/run without <getopt.h>
[dxcommon.git] / src / copysym.c
index 8ecace7c32a68d924bb9a2ca2932ad9d578f04a5..3d72d6aad9f246eb6aa307669fafc289b2a91918 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 #include <stdint.h>
-#include "xtra.h"
+
+#define ARRAYSIZE(x) (sizeof (x) / sizeof (x)[0])
 
 static int compar_5arr(const void *key, const void *elem_)
 {
-       const char (*elem)[5] = elem_;
+       const char (*elem)[5] = (void *)elem_;
 
        return strncmp(key, *elem, sizeof *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;