X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=libbb%2Fxatonum.c;h=dec3c2dc4aa5ce85373942baf2b000ad7b9f0c7c;hb=9af7c9d6b62ceb07a9ba24cee0cf4a08c689235e;hp=0d487dd9be2dce33fbc458da46f70cde59ccf760;hpb=43bddf31e95080abf7232952da9064207636f47b;p=oweals%2Fbusybox.git diff --git a/libbb/xatonum.c b/libbb/xatonum.c index 0d487dd9b..dec3c2dc4 100644 --- a/libbb/xatonum.c +++ b/libbb/xatonum.c @@ -19,15 +19,6 @@ #define XSTR_TYPE_MIN LLONG_MIN #define XSTR_STRTOU strtoull #include "xatonum_template.c" -#undef type -#undef xstrtou -#undef xstrto -#undef xatou -#undef xato -#undef XSTR_UTYPE_MAX -#undef XSTR_TYPE_MAX -#undef XSTR_TYPE_MIN -#undef XSTR_STRTOU #if ULONG_MAX != ULLONG_MAX #define type long @@ -40,19 +31,11 @@ #define XSTR_TYPE_MIN LONG_MIN #define XSTR_STRTOU strtoul #include "xatonum_template.c" -#undef type -#undef xstrtou -#undef xstrto -#undef xatou -#undef xato -#undef XSTR_UTYPE_MAX -#undef XSTR_TYPE_MAX -#undef XSTR_TYPE_MIN -#undef XSTR_STRTOU #endif #if UINT_MAX != ULONG_MAX -extern inline unsigned bb_strtoui(const char *str, char **end, int b) +static ATTRIBUTE_ALWAYS_INLINE +unsigned bb_strtoui(const char *str, char **end, int b) { unsigned long v = strtoul(str, end, b); if (v > UINT_MAX) { @@ -72,15 +55,6 @@ extern inline unsigned bb_strtoui(const char *str, char **end, int b) /* libc has no strtoui, so we need to create/use our own */ #define XSTR_STRTOU bb_strtoui #include "xatonum_template.c" -#undef type -#undef xstrtou -#undef xstrto -#undef xatou -#undef xato -#undef XSTR_UTYPE_MAX -#undef XSTR_TYPE_MAX -#undef XSTR_TYPE_MIN -#undef XSTR_STRTOU #endif /* A few special cases */ @@ -90,11 +64,6 @@ int xatoi_u(const char *numstr) return xatou_range(numstr, 0, INT_MAX); } -uint32_t xatou32(const char *numstr) -{ - return xatoul_range(numstr, 0, 0xffffffff); -} - uint16_t xatou16(const char *numstr) { return xatou_range(numstr, 0, 0xffff);