From 9b2eaedddeb176737e7f61eb140dfb7c235f9c54 Mon Sep 17 00:00:00 2001 From: Robert Kessl Date: Wed, 25 Jun 2014 14:09:42 +0200 Subject: [PATCH] strtonum: added str_to_[s|u]64 --- ucw/strtonum.c | 4 ++++ ucw/strtonum.h | 3 +++ 2 files changed, 7 insertions(+) diff --git a/ucw/strtonum.c b/ucw/strtonum.c index 8468cf75..77858b19 100644 --- a/ucw/strtonum.c +++ b/ucw/strtonum.c @@ -102,6 +102,10 @@ static inline uint get_digit(const uint c) #define STN_SUFFIX uint #include +#define STN_TYPE u64 +#define STN_SUFFIX u64 +#include + #define STN_TYPE uintmax_t #define STN_SUFFIX uintmax #include diff --git a/ucw/strtonum.h b/ucw/strtonum.h index 085bd0b0..d5631f68 100644 --- a/ucw/strtonum.h +++ b/ucw/strtonum.h @@ -52,6 +52,9 @@ static inline const char *str_to_##suffix(type *num, const char *str, const char STN_DECLARE_CONVERTOR(uint, uint); STN_SIGNED_CONVERTOR(int, int, uint) +STN_DECLARE_CONVERTOR(u64, u64); +STN_SIGNED_CONVERTOR(s64, s64, u64) + STN_DECLARE_CONVERTOR(uintmax_t, uintmax); STN_SIGNED_CONVERTOR(intmax_t, intmax, uintmax) -- 2.39.5