aboutsummaryrefslogtreecommitdiff
path: root/libbb/xatonum_template.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-06-27 02:52:20 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-06-27 02:52:20 +0000
commitdefc1ea34074e7882724c460260d307cdf981a70 (patch)
treefca9b9a5fe243f9c0c76b84824ea2ff92ea8e589 /libbb/xatonum_template.c
parent26bc57d8b26425f23f4be974cce7bf35c95c9a1a (diff)
downloadbusybox-w32-defc1ea34074e7882724c460260d307cdf981a70.tar.gz
busybox-w32-defc1ea34074e7882724c460260d307cdf981a70.tar.bz2
busybox-w32-defc1ea34074e7882724c460260d307cdf981a70.zip
*: introduce and use FAST_FUNC: regparm on i386, otherwise no-on
text data bss dec hex filename 808035 611 6868 815514 c719a busybox_old 804472 611 6868 811951 c63af busybox_unstripped
Diffstat (limited to 'libbb/xatonum_template.c')
-rw-r--r--libbb/xatonum_template.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/libbb/xatonum_template.c b/libbb/xatonum_template.c
index 9f9dc1102..2360ae88a 100644
--- a/libbb/xatonum_template.c
+++ b/libbb/xatonum_template.c
@@ -12,7 +12,7 @@ You need to define the following (example):
12#define XSTR_STRTOU strtoul 12#define XSTR_STRTOU strtoul
13*/ 13*/
14 14
15unsigned type xstrtou(_range_sfx)(const char *numstr, int base, 15unsigned type FAST_FUNC xstrtou(_range_sfx)(const char *numstr, int base,
16 unsigned type lower, 16 unsigned type lower,
17 unsigned type upper, 17 unsigned type upper,
18 const struct suffix_mult *suffixes) 18 const struct suffix_mult *suffixes)
@@ -71,25 +71,25 @@ unsigned type xstrtou(_range_sfx)(const char *numstr, int base,
71 bb_error_msg_and_die("invalid number '%s'", numstr); 71 bb_error_msg_and_die("invalid number '%s'", numstr);
72} 72}
73 73
74unsigned type xstrtou(_range)(const char *numstr, int base, 74unsigned type FAST_FUNC xstrtou(_range)(const char *numstr, int base,
75 unsigned type lower, 75 unsigned type lower,
76 unsigned type upper) 76 unsigned type upper)
77{ 77{
78 return xstrtou(_range_sfx)(numstr, base, lower, upper, NULL); 78 return xstrtou(_range_sfx)(numstr, base, lower, upper, NULL);
79} 79}
80 80
81unsigned type xstrtou(_sfx)(const char *numstr, int base, 81unsigned type FAST_FUNC xstrtou(_sfx)(const char *numstr, int base,
82 const struct suffix_mult *suffixes) 82 const struct suffix_mult *suffixes)
83{ 83{
84 return xstrtou(_range_sfx)(numstr, base, 0, XSTR_UTYPE_MAX, suffixes); 84 return xstrtou(_range_sfx)(numstr, base, 0, XSTR_UTYPE_MAX, suffixes);
85} 85}
86 86
87unsigned type xstrtou()(const char *numstr, int base) 87unsigned type FAST_FUNC xstrtou()(const char *numstr, int base)
88{ 88{
89 return xstrtou(_range_sfx)(numstr, base, 0, XSTR_UTYPE_MAX, NULL); 89 return xstrtou(_range_sfx)(numstr, base, 0, XSTR_UTYPE_MAX, NULL);
90} 90}
91 91
92unsigned type xatou(_range_sfx)(const char *numstr, 92unsigned type FAST_FUNC xatou(_range_sfx)(const char *numstr,
93 unsigned type lower, 93 unsigned type lower,
94 unsigned type upper, 94 unsigned type upper,
95 const struct suffix_mult *suffixes) 95 const struct suffix_mult *suffixes)
@@ -97,27 +97,27 @@ unsigned type xatou(_range_sfx)(const char *numstr,
97 return xstrtou(_range_sfx)(numstr, 10, lower, upper, suffixes); 97 return xstrtou(_range_sfx)(numstr, 10, lower, upper, suffixes);
98} 98}
99 99
100unsigned type xatou(_range)(const char *numstr, 100unsigned type FAST_FUNC xatou(_range)(const char *numstr,
101 unsigned type lower, 101 unsigned type lower,
102 unsigned type upper) 102 unsigned type upper)
103{ 103{
104 return xstrtou(_range_sfx)(numstr, 10, lower, upper, NULL); 104 return xstrtou(_range_sfx)(numstr, 10, lower, upper, NULL);
105} 105}
106 106
107unsigned type xatou(_sfx)(const char *numstr, 107unsigned type FAST_FUNC xatou(_sfx)(const char *numstr,
108 const struct suffix_mult *suffixes) 108 const struct suffix_mult *suffixes)
109{ 109{
110 return xstrtou(_range_sfx)(numstr, 10, 0, XSTR_UTYPE_MAX, suffixes); 110 return xstrtou(_range_sfx)(numstr, 10, 0, XSTR_UTYPE_MAX, suffixes);
111} 111}
112 112
113unsigned type xatou()(const char *numstr) 113unsigned type FAST_FUNC xatou()(const char *numstr)
114{ 114{
115 return xatou(_sfx)(numstr, NULL); 115 return xatou(_sfx)(numstr, NULL);
116} 116}
117 117
118/* Signed ones */ 118/* Signed ones */
119 119
120type xstrto(_range_sfx)(const char *numstr, int base, 120type FAST_FUNC xstrto(_range_sfx)(const char *numstr, int base,
121 type lower, 121 type lower,
122 type upper, 122 type upper,
123 const struct suffix_mult *suffixes) 123 const struct suffix_mult *suffixes)
@@ -148,12 +148,12 @@ type xstrto(_range_sfx)(const char *numstr, int base,
148 return r; 148 return r;
149} 149}
150 150
151type xstrto(_range)(const char *numstr, int base, type lower, type upper) 151type FAST_FUNC xstrto(_range)(const char *numstr, int base, type lower, type upper)
152{ 152{
153 return xstrto(_range_sfx)(numstr, base, lower, upper, NULL); 153 return xstrto(_range_sfx)(numstr, base, lower, upper, NULL);
154} 154}
155 155
156type xato(_range_sfx)(const char *numstr, 156type FAST_FUNC xato(_range_sfx)(const char *numstr,
157 type lower, 157 type lower,
158 type upper, 158 type upper,
159 const struct suffix_mult *suffixes) 159 const struct suffix_mult *suffixes)
@@ -161,17 +161,17 @@ type xato(_range_sfx)(const char *numstr,
161 return xstrto(_range_sfx)(numstr, 10, lower, upper, suffixes); 161 return xstrto(_range_sfx)(numstr, 10, lower, upper, suffixes);
162} 162}
163 163
164type xato(_range)(const char *numstr, type lower, type upper) 164type FAST_FUNC xato(_range)(const char *numstr, type lower, type upper)
165{ 165{
166 return xstrto(_range_sfx)(numstr, 10, lower, upper, NULL); 166 return xstrto(_range_sfx)(numstr, 10, lower, upper, NULL);
167} 167}
168 168
169type xato(_sfx)(const char *numstr, const struct suffix_mult *suffixes) 169type FAST_FUNC xato(_sfx)(const char *numstr, const struct suffix_mult *suffixes)
170{ 170{
171 return xstrto(_range_sfx)(numstr, 10, XSTR_TYPE_MIN, XSTR_TYPE_MAX, suffixes); 171 return xstrto(_range_sfx)(numstr, 10, XSTR_TYPE_MIN, XSTR_TYPE_MAX, suffixes);
172} 172}
173 173
174type xato()(const char *numstr) 174type FAST_FUNC xato()(const char *numstr)
175{ 175{
176 return xstrto(_range_sfx)(numstr, 10, XSTR_TYPE_MIN, XSTR_TYPE_MAX, NULL); 176 return xstrto(_range_sfx)(numstr, 10, XSTR_TYPE_MIN, XSTR_TYPE_MAX, NULL);
177} 177}