aboutsummaryrefslogtreecommitdiff
path: root/libbb/xatonum.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-11-27 14:43:21 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-11-27 14:43:21 +0000
commitd686a045c8134d3a42fa5cc6b2e09118e08d603f (patch)
tree38f509fc9556f68f758c77b06b480cc33b2725eb /libbb/xatonum.c
parent8a0a83d503a7971895254efa9e79cf15ba1850d4 (diff)
downloadbusybox-w32-d686a045c8134d3a42fa5cc6b2e09118e08d603f.tar.gz
busybox-w32-d686a045c8134d3a42fa5cc6b2e09118e08d603f.tar.bz2
busybox-w32-d686a045c8134d3a42fa5cc6b2e09118e08d603f.zip
safe_strtoXX interface proved to be a bit unconvenient.
Remove it, introduce saner bb_strtoXX. Saved ~350 bytes.
Diffstat (limited to 'libbb/xatonum.c')
-rw-r--r--libbb/xatonum.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/libbb/xatonum.c b/libbb/xatonum.c
index 0d487dd9b..35607c317 100644
--- a/libbb/xatonum.c
+++ b/libbb/xatonum.c
@@ -19,15 +19,6 @@
19#define XSTR_TYPE_MIN LLONG_MIN 19#define XSTR_TYPE_MIN LLONG_MIN
20#define XSTR_STRTOU strtoull 20#define XSTR_STRTOU strtoull
21#include "xatonum_template.c" 21#include "xatonum_template.c"
22#undef type
23#undef xstrtou
24#undef xstrto
25#undef xatou
26#undef xato
27#undef XSTR_UTYPE_MAX
28#undef XSTR_TYPE_MAX
29#undef XSTR_TYPE_MIN
30#undef XSTR_STRTOU
31 22
32#if ULONG_MAX != ULLONG_MAX 23#if ULONG_MAX != ULLONG_MAX
33#define type long 24#define type long
@@ -40,15 +31,6 @@
40#define XSTR_TYPE_MIN LONG_MIN 31#define XSTR_TYPE_MIN LONG_MIN
41#define XSTR_STRTOU strtoul 32#define XSTR_STRTOU strtoul
42#include "xatonum_template.c" 33#include "xatonum_template.c"
43#undef type
44#undef xstrtou
45#undef xstrto
46#undef xatou
47#undef xato
48#undef XSTR_UTYPE_MAX
49#undef XSTR_TYPE_MAX
50#undef XSTR_TYPE_MIN
51#undef XSTR_STRTOU
52#endif 34#endif
53 35
54#if UINT_MAX != ULONG_MAX 36#if UINT_MAX != ULONG_MAX
@@ -72,15 +54,6 @@ extern inline unsigned bb_strtoui(const char *str, char **end, int b)
72/* libc has no strtoui, so we need to create/use our own */ 54/* libc has no strtoui, so we need to create/use our own */
73#define XSTR_STRTOU bb_strtoui 55#define XSTR_STRTOU bb_strtoui
74#include "xatonum_template.c" 56#include "xatonum_template.c"
75#undef type
76#undef xstrtou
77#undef xstrto
78#undef xatou
79#undef xato
80#undef XSTR_UTYPE_MAX
81#undef XSTR_TYPE_MAX
82#undef XSTR_TYPE_MIN
83#undef XSTR_STRTOU
84#endif 57#endif
85 58
86/* A few special cases */ 59/* A few special cases */
@@ -90,11 +63,6 @@ int xatoi_u(const char *numstr)
90 return xatou_range(numstr, 0, INT_MAX); 63 return xatou_range(numstr, 0, INT_MAX);
91} 64}
92 65
93uint32_t xatou32(const char *numstr)
94{
95 return xatoul_range(numstr, 0, 0xffffffff);
96}
97
98uint16_t xatou16(const char *numstr) 66uint16_t xatou16(const char *numstr)
99{ 67{
100 return xatou_range(numstr, 0, 0xffff); 68 return xatou_range(numstr, 0, 0xffff);