sleep: if FANCY && DESKTOP, support fractional seconds, minutes,
hours and so on. It's coreutils compat. bloatcheck is atrocious :( function old new delta sleep_main 71 362 +291 bb_strtod - 127 +127 make_device 1269 1294 +25 getoptscmd 708 713 +5 switch_root_main 402 401 -1 display_speed 90 85 -5 show_entry 295 289 -6 parse_expr 841 833 -8 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 3/4 up/down: 448/-20) Total: 428 bytes
This commit is contained in:
@@ -124,33 +124,3 @@ int FAST_FUNC bb_strtoi(const char *arg, char **endp, int base)
|
||||
return handle_errors(v, endp, endptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Floating point */
|
||||
|
||||
#if 0
|
||||
|
||||
#include <math.h> /* just for HUGE_VAL */
|
||||
#define NOT_DIGIT(a) (((unsigned char)(a-'0')) > 9)
|
||||
double FAST_FUNC bb_strtod(const char *arg, char **endp)
|
||||
{
|
||||
double v;
|
||||
char *endptr;
|
||||
|
||||
if (arg[0] != '-' && NOT_DIGIT(arg[0])) goto err;
|
||||
errno = 0;
|
||||
v = strtod(arg, &endptr);
|
||||
if (endp) *endp = endptr;
|
||||
if (endptr[0]) {
|
||||
/* "1234abcg" or out-of-range? */
|
||||
if (isalnum(endptr[0]) || errno) {
|
||||
err:
|
||||
errno = ERANGE;
|
||||
return HUGE_VAL;
|
||||
}
|
||||
/* good number, just suspicious terminator */
|
||||
errno = EINVAL;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user