Mercurial > libjeffpc
changeset 686:adc02e842728
int: add str2uXX_full prototypes to catch code generation macro issues
As an added benefit, this will allow cscope/ctags/etc. to know where
(approximately) the functions are defined.
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Mon, 25 Feb 2019 16:10:33 -0500 |
parents | 09e338f3ebb2 |
children | 19bcd869e80d |
files | include/jeffpc/int.h |
diffstat | 1 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/include/jeffpc/int.h Mon Feb 25 16:13:43 2019 -0500 +++ b/include/jeffpc/int.h Mon Feb 25 16:10:33 2019 -0500 @@ -81,6 +81,16 @@ #undef STR_TO_INT +/* + * These prototypes exist to catch bugs in the code generating macros above. + */ +static inline int str2u64_full(const char *restrict s, uint64_t *i, + int base, char terminator); +static inline int str2u32_full(const char *restrict s, uint32_t *i, + int base, char terminator); +static inline int str2u16_full(const char *restrict s, uint16_t *i, + int base, char terminator); + /* base [2, 36], nul-terminated */ #define str2u64_base(s, i, b) str2u64_full((s), (i), (b), '\0') #define str2u32_base(s, i, b) str2u32_full((s), (i), (b), '\0')