Ignore:
Timestamp:
Feb 25, 2011, 9:26:54 PM (13 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi-busybox/include/xatonum.h

    r1765 r2725  
    55 * Copyright (C) 2003  Manuel Novoa III  <mjn3@codepoet.org>
    66 *
    7  * Licensed under GPLv2, see file LICENSE in this tarball for details.
     7 * Licensed under GPLv2, see file LICENSE in this source tree.
    88 */
     9
     10PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
    911
    1012/* Provides extern declarations of functions */
    1113#define DECLARE_STR_CONV(type, T, UT) \
    1214\
    13 unsigned type xstrto##UT##_range_sfx(const char *str, int b, unsigned type l, unsigned type u, const struct suffix_mult *sfx); \
    14 unsigned type xstrto##UT##_range(const char *str, int b, unsigned type l, unsigned type u); \
    15 unsigned type xstrto##UT##_sfx(const char *str, int b, const struct suffix_mult *sfx); \
    16 unsigned type xstrto##UT(const char *str, int b); \
    17 unsigned type xato##UT##_range_sfx(const char *str, unsigned type l, unsigned type u, const struct suffix_mult *sfx); \
    18 unsigned type xato##UT##_range(const char *str, unsigned type l, unsigned type u); \
    19 unsigned type xato##UT##_sfx(const char *str, const struct suffix_mult *sfx); \
    20 unsigned type xato##UT(const char *str); \
    21 type xstrto##T##_range_sfx(const char *str, int b, type l, type u, const struct suffix_mult *sfx); \
    22 type xstrto##T##_range(const char *str, int b, type l, type u); \
    23 type xato##T##_range_sfx(const char *str, type l, type u, const struct suffix_mult *sfx); \
    24 type xato##T##_range(const char *str, type l, type u); \
    25 type xato##T##_sfx(const char *str, const struct suffix_mult *sfx); \
    26 type xato##T(const char *str); \
     15unsigned type xstrto##UT##_range_sfx(const char *str, int b, unsigned type l, unsigned type u, const struct suffix_mult *sfx) FAST_FUNC; \
     16unsigned type xstrto##UT##_range(const char *str, int b, unsigned type l, unsigned type u) FAST_FUNC; \
     17unsigned type xstrto##UT##_sfx(const char *str, int b, const struct suffix_mult *sfx) FAST_FUNC; \
     18unsigned type xstrto##UT(const char *str, int b) FAST_FUNC; \
     19unsigned type xato##UT##_range_sfx(const char *str, unsigned type l, unsigned type u, const struct suffix_mult *sfx) FAST_FUNC; \
     20unsigned type xato##UT##_range(const char *str, unsigned type l, unsigned type u) FAST_FUNC; \
     21unsigned type xato##UT##_sfx(const char *str, const struct suffix_mult *sfx) FAST_FUNC; \
     22unsigned type xato##UT(const char *str) FAST_FUNC; \
     23type xstrto##T##_range_sfx(const char *str, int b, type l, type u, const struct suffix_mult *sfx) FAST_FUNC; \
     24type xstrto##T##_range(const char *str, int b, type l, type u) FAST_FUNC; \
     25type xstrto##T(const char *str, int b) FAST_FUNC; \
     26type xato##T##_range_sfx(const char *str, type l, type u, const struct suffix_mult *sfx) FAST_FUNC; \
     27type xato##T##_range(const char *str, type l, type u) FAST_FUNC; \
     28type xato##T##_sfx(const char *str, const struct suffix_mult *sfx) FAST_FUNC; \
     29type xato##T(const char *str) FAST_FUNC; \
    2730
    2831/* Unsigned long long functions always exist */
     
    6568{ return xstrto##W##_range(str, b, l, u); } \
    6669static ALWAYS_INLINE \
     70narrow xstrto##N(const char *str, int b) \
     71{ return xstrto##W(str, b); } \
     72static ALWAYS_INLINE \
    6773narrow xato##N##_range_sfx(const char *str, narrow l, narrow u, const struct suffix_mult *sfx) \
    6874{ return xato##W##_range_sfx(str, l, u, sfx); } \
     
    96102/* Specialized */
    97103
    98 int BUG_xatou32_unimplemented(void);
     104uint32_t BUG_xatou32_unimplemented(void);
    99105static ALWAYS_INLINE uint32_t xatou32(const char *numstr)
    100106{
     
    106112}
    107113
    108 /* Non-aborting kind of convertors */
     114/* Non-aborting kind of convertors: bb_strto[u][l]l */
    109115
    110 unsigned long long bb_strtoull(const char *arg, char **endp, int base);
    111 long long bb_strtoll(const char *arg, char **endp, int base);
     116/* On exit: errno = 0 only if there was non-empty, '\0' terminated value
     117 * errno = EINVAL if value was not '\0' terminated, but otherwise ok
     118 *    Return value is still valid, caller should just check whether end[0]
     119 *    is a valid terminating char for particular case. OTOH, if caller
     120 *    requires '\0' terminated input, [s]he can just check errno == 0.
     121 * errno = ERANGE if value had alphanumeric terminating char ("1234abcg").
     122 * errno = ERANGE if value is out of range, missing, etc.
     123 * errno = ERANGE if value had minus sign for strtouXX (even "-0" is not ok )
     124 *    return value is all-ones in this case.
     125 */
     126
     127unsigned long long bb_strtoull(const char *arg, char **endp, int base) FAST_FUNC;
     128long long bb_strtoll(const char *arg, char **endp, int base) FAST_FUNC;
    112129
    113130#if ULONG_MAX == ULLONG_MAX
     
    119136{ return bb_strtoll(arg, endp, base); }
    120137#else
    121 unsigned long bb_strtoul(const char *arg, char **endp, int base);
    122 long bb_strtol(const char *arg, char **endp, int base);
     138unsigned long bb_strtoul(const char *arg, char **endp, int base) FAST_FUNC;
     139long bb_strtol(const char *arg, char **endp, int base) FAST_FUNC;
    123140#endif
    124141
     
    138155{ return bb_strtol(arg, endp, base); }
    139156#else
    140 unsigned bb_strtou(const char *arg, char **endp, int base);
    141 int bb_strtoi(const char *arg, char **endp, int base);
     157unsigned bb_strtou(const char *arg, char **endp, int base) FAST_FUNC;
     158int bb_strtoi(const char *arg, char **endp, int base) FAST_FUNC;
    142159#endif
    143160
    144 int BUG_bb_strtou32_unimplemented(void);
     161uint32_t BUG_bb_strtou32_unimplemented(void);
    145162static ALWAYS_INLINE
    146163uint32_t bb_strtou32(const char *arg, char **endp, int base)
     
    155172/* Floating point */
    156173
    157 /* double bb_strtod(const char *arg, char **endp); */
     174double bb_strtod(const char *arg, char **endp) FAST_FUNC;
     175
     176POP_SAVED_FUNCTION_VISIBILITY
Note: See TracChangeset for help on using the changeset viewer.