aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/platform.h2
-rw-r--r--include/xatonum.h60
2 files changed, 31 insertions, 31 deletions
diff --git a/include/platform.h b/include/platform.h
index 345e9cb7a..a1ec17a7b 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -195,7 +195,7 @@ typedef unsigned long long int uintmax_t;
195 * out of the tree, so stop saying it should be. */ 195 * out of the tree, so stop saying it should be. */
196#define fdprintf dprintf 196#define fdprintf dprintf
197 197
198/* Don't use lchown with glibc older then 2.1.x ... uC-libc lacks it */ 198/* Don't use lchown with glibc older than 2.1.x ... uC-libc lacks it */
199#if (defined __GLIBC__ && __GLIBC__ <= 2 && __GLIBC_MINOR__ < 1) || \ 199#if (defined __GLIBC__ && __GLIBC__ <= 2 && __GLIBC_MINOR__ < 1) || \
200 defined __UC_LIBC__ 200 defined __UC_LIBC__
201# define lchown chown 201# define lchown chown
diff --git a/include/xatonum.h b/include/xatonum.h
index 585d84623..cf088a49e 100644
--- a/include/xatonum.h
+++ b/include/xatonum.h
@@ -29,50 +29,50 @@ type xato##T(const char *str); \
29DECLARE_STR_CONV(long long, ll, ull) 29DECLARE_STR_CONV(long long, ll, ull)
30 30
31 31
32/* Provides extern inline definitions of functions */ 32/* Provides inline definitions of functions */
33/* (useful for mapping them to the type of the same width) */ 33/* (useful for mapping them to the type of the same width) */
34#define DEFINE_EQUIV_STR_CONV(narrow, N, W, UN, UW) \ 34#define DEFINE_EQUIV_STR_CONV(narrow, N, W, UN, UW) \
35\ 35\
36extern inline \ 36static ATTRIBUTE_ALWAYS_INLINE \
37unsigned narrow xstrto##UN##_range_sfx(const char *str, int b, unsigned narrow l, unsigned narrow u, const struct suffix_mult *sfx) \ 37unsigned narrow xstrto##UN##_range_sfx(const char *str, int b, unsigned narrow l, unsigned narrow u, const struct suffix_mult *sfx) \
38{ return xstrto##UW##_range_sfx(str, b, l, u, sfx); } \ 38{ return xstrto##UW##_range_sfx(str, b, l, u, sfx); } \
39extern inline \ 39static ATTRIBUTE_ALWAYS_INLINE \
40unsigned narrow xstrto##UN##_range(const char *str, int b, unsigned narrow l, unsigned narrow u) \ 40unsigned narrow xstrto##UN##_range(const char *str, int b, unsigned narrow l, unsigned narrow u) \
41{ return xstrto##UW##_range(str, b, l, u); } \ 41{ return xstrto##UW##_range(str, b, l, u); } \
42extern inline \ 42static ATTRIBUTE_ALWAYS_INLINE \
43unsigned narrow xstrto##UN##_sfx(const char *str, int b, const struct suffix_mult *sfx) \ 43unsigned narrow xstrto##UN##_sfx(const char *str, int b, const struct suffix_mult *sfx) \
44{ return xstrto##UW##_sfx(str, b, sfx); } \ 44{ return xstrto##UW##_sfx(str, b, sfx); } \
45extern inline \ 45static ATTRIBUTE_ALWAYS_INLINE \
46unsigned narrow xstrto##UN(const char *str, int b) \ 46unsigned narrow xstrto##UN(const char *str, int b) \
47{ return xstrto##UW(str, b); } \ 47{ return xstrto##UW(str, b); } \
48extern inline \ 48static ATTRIBUTE_ALWAYS_INLINE \
49unsigned narrow xato##UN##_range_sfx(const char *str, unsigned narrow l, unsigned narrow u, const struct suffix_mult *sfx) \ 49unsigned narrow xato##UN##_range_sfx(const char *str, unsigned narrow l, unsigned narrow u, const struct suffix_mult *sfx) \
50{ return xato##UW##_range_sfx(str, l, u, sfx); } \ 50{ return xato##UW##_range_sfx(str, l, u, sfx); } \
51extern inline \ 51static ATTRIBUTE_ALWAYS_INLINE \
52unsigned narrow xato##UN##_range(const char *str, unsigned narrow l, unsigned narrow u) \ 52unsigned narrow xato##UN##_range(const char *str, unsigned narrow l, unsigned narrow u) \
53{ return xato##UW##_range(str, l, u); } \ 53{ return xato##UW##_range(str, l, u); } \
54extern inline \ 54static ATTRIBUTE_ALWAYS_INLINE \
55unsigned narrow xato##UN##_sfx(const char *str, const struct suffix_mult *sfx) \ 55unsigned narrow xato##UN##_sfx(const char *str, const struct suffix_mult *sfx) \
56{ return xato##UW##_sfx(str, sfx); } \ 56{ return xato##UW##_sfx(str, sfx); } \
57extern inline \ 57static ATTRIBUTE_ALWAYS_INLINE \
58unsigned narrow xato##UN(const char *str) \ 58unsigned narrow xato##UN(const char *str) \
59{ return xato##UW(str); } \ 59{ return xato##UW(str); } \
60extern inline \ 60static ATTRIBUTE_ALWAYS_INLINE \
61narrow xstrto##N##_range_sfx(const char *str, int b, narrow l, narrow u, const struct suffix_mult *sfx) \ 61narrow xstrto##N##_range_sfx(const char *str, int b, narrow l, narrow u, const struct suffix_mult *sfx) \
62{ return xstrto##W##_range_sfx(str, b, l, u, sfx); } \ 62{ return xstrto##W##_range_sfx(str, b, l, u, sfx); } \
63extern inline \ 63static ATTRIBUTE_ALWAYS_INLINE \
64narrow xstrto##N##_range(const char *str, int b, narrow l, narrow u) \ 64narrow xstrto##N##_range(const char *str, int b, narrow l, narrow u) \
65{ return xstrto##W##_range(str, b, l, u); } \ 65{ return xstrto##W##_range(str, b, l, u); } \
66extern inline \ 66static ATTRIBUTE_ALWAYS_INLINE \
67narrow xato##N##_range_sfx(const char *str, narrow l, narrow u, const struct suffix_mult *sfx) \ 67narrow xato##N##_range_sfx(const char *str, narrow l, narrow u, const struct suffix_mult *sfx) \
68{ return xato##W##_range_sfx(str, l, u, sfx); } \ 68{ return xato##W##_range_sfx(str, l, u, sfx); } \
69extern inline \ 69static ATTRIBUTE_ALWAYS_INLINE \
70narrow xato##N##_range(const char *str, narrow l, narrow u) \ 70narrow xato##N##_range(const char *str, narrow l, narrow u) \
71{ return xato##W##_range(str, l, u); } \ 71{ return xato##W##_range(str, l, u); } \
72extern inline \ 72static ATTRIBUTE_ALWAYS_INLINE \
73narrow xato##N##_sfx(const char *str, const struct suffix_mult *sfx) \ 73narrow xato##N##_sfx(const char *str, const struct suffix_mult *sfx) \
74{ return xato##W##_sfx(str, sfx); } \ 74{ return xato##W##_sfx(str, sfx); } \
75extern inline \ 75static ATTRIBUTE_ALWAYS_INLINE \
76narrow xato##N(const char *str) \ 76narrow xato##N(const char *str) \
77{ return xato##W(str); } \ 77{ return xato##W(str); } \
78 78
@@ -96,7 +96,7 @@ DECLARE_STR_CONV(int, i, u)
96/* Specialized */ 96/* Specialized */
97 97
98int BUG_xatou32_unimplemented(void); 98int BUG_xatou32_unimplemented(void);
99extern inline uint32_t xatou32(const char *numstr) 99static ATTRIBUTE_ALWAYS_INLINE uint32_t xatou32(const char *numstr)
100{ 100{
101 if (UINT_MAX == 0xffffffff) 101 if (UINT_MAX == 0xffffffff)
102 return xatou(numstr); 102 return xatou(numstr);
@@ -111,11 +111,11 @@ unsigned long long bb_strtoull(const char *arg, char **endp, int base);
111long long bb_strtoll(const char *arg, char **endp, int base); 111long long bb_strtoll(const char *arg, char **endp, int base);
112 112
113#if ULONG_MAX == ULLONG_MAX 113#if ULONG_MAX == ULLONG_MAX
114extern inline 114static ATTRIBUTE_ALWAYS_INLINE
115unsigned long bb_strtoul(const char *arg, char **endp, int base) 115unsigned long bb_strtoul(const char *arg, char **endp, int base)
116{ return bb_strtoull(arg, endp, base); } 116{ return bb_strtoull(arg, endp, base); }
117extern inline 117static ATTRIBUTE_ALWAYS_INLINE
118unsigned long bb_strtol(const char *arg, char **endp, int base) 118long bb_strtol(const char *arg, char **endp, int base)
119{ return bb_strtoll(arg, endp, base); } 119{ return bb_strtoll(arg, endp, base); }
120#else 120#else
121unsigned long bb_strtoul(const char *arg, char **endp, int base); 121unsigned long bb_strtoul(const char *arg, char **endp, int base);
@@ -123,26 +123,26 @@ long bb_strtol(const char *arg, char **endp, int base);
123#endif 123#endif
124 124
125#if UINT_MAX == ULLONG_MAX 125#if UINT_MAX == ULLONG_MAX
126extern inline 126static ATTRIBUTE_ALWAYS_INLINE
127unsigned long bb_strtou(const char *arg, char **endp, int base) 127unsigned bb_strtou(const char *arg, char **endp, int base)
128{ return bb_strtoull(arg, endp, base); } 128{ return bb_strtoull(arg, endp, base); }
129extern inline 129static ATTRIBUTE_ALWAYS_INLINE
130unsigned long bb_strtoi(const char *arg, char **endp, int base) 130int bb_strtoi(const char *arg, char **endp, int base)
131{ return bb_strtoll(arg, endp, base); } 131{ return bb_strtoll(arg, endp, base); }
132#elif UINT_MAX == ULONG_MAX 132#elif UINT_MAX == ULONG_MAX
133extern inline 133static ATTRIBUTE_ALWAYS_INLINE
134unsigned long bb_strtou(const char *arg, char **endp, int base) 134unsigned bb_strtou(const char *arg, char **endp, int base)
135{ return bb_strtoul(arg, endp, base); } 135{ return bb_strtoul(arg, endp, base); }
136extern inline 136static ATTRIBUTE_ALWAYS_INLINE
137unsigned long bb_strtoi(const char *arg, char **endp, int base) 137int bb_strtoi(const char *arg, char **endp, int base)
138{ return bb_strtol(arg, endp, base); } 138{ return bb_strtol(arg, endp, base); }
139#else 139#else
140unsigned long bb_strtou(const char *arg, char **endp, int base); 140unsigned bb_strtou(const char *arg, char **endp, int base);
141long bb_strtoi(const char *arg, char **endp, int base); 141int bb_strtoi(const char *arg, char **endp, int base);
142#endif 142#endif
143 143
144int BUG_bb_strtou32_unimplemented(void); 144int BUG_bb_strtou32_unimplemented(void);
145extern inline 145static ATTRIBUTE_ALWAYS_INLINE
146uint32_t bb_strtou32(const char *arg, char **endp, int base) 146uint32_t bb_strtou32(const char *arg, char **endp, int base)
147{ 147{
148 if (sizeof(uint32_t) == sizeof(unsigned)) 148 if (sizeof(uint32_t) == sizeof(unsigned))