diff options
Diffstat (limited to 'src/libstddjb/fmtscan-internal.h')
-rw-r--r-- | src/libstddjb/fmtscan-internal.h | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/libstddjb/fmtscan-internal.h b/src/libstddjb/fmtscan-internal.h index 61b3e6a..f6c3391 100644 --- a/src/libstddjb/fmtscan-internal.h +++ b/src/libstddjb/fmtscan-internal.h @@ -11,9 +11,6 @@ #include <skalibs/uint64.h> #include <skalibs/fmtscan.h> -extern size_t uint64_scan_base_max (char const *, uint64_t *, uint8_t, uint64_t) ; -extern size_t int64_scan_base_max (char const *, int64_t *, uint8_t, uint64_t) ; - #define SCANB0(bits) \ size_t uint##bits##0_scan_base (char const *s, uint##bits##_t *u, uint8_t base) \ { \ @@ -65,17 +62,13 @@ size_t int##bits##_scanlist (int##bits##_t *tab, size_t max, char const *s, size } \ #define FMTL(bits) \ +static uint64_t get (void const *tab, size_t i) \ +{ \ + return ((uint##bits##_t const *)tab)[i] ; \ +} \ size_t uint##bits##_fmtlist (char *s, uint##bits##_t const *tab, size_t n) \ { \ - size_t i = 0, len = 0 ; \ - for (; i < n ; i++) \ - { \ - size_t w = uint##bits##_fmt(s, tab[i]) ; \ - len += w ; \ - if (s) s += w ; \ - if (i < n-1) { len++ ; if (s) *s++ = ',' ; } \ - } \ - return len ; \ + return uint64_fmtlist_generic(s, tab, n, 10, &get) ; \ } \ #define FMTSL(bits) \ |