X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdlib%2Fstrtod.c;h=a5d0118a2dc6e58ec06e5bb5bfc1313c62d06d20;hb=59b64ff686cef2a87e9552658b2c8d2531f87176;hp=1886efa5e2c17089e68ef67b5695f615c25708b6;hpb=cb81b6947c0277a6a27ddc699d716e9cf2b524aa;p=musl diff --git a/src/stdlib/strtod.c b/src/stdlib/strtod.c index 1886efa5..a5d0118a 100644 --- a/src/stdlib/strtod.c +++ b/src/stdlib/strtod.c @@ -5,10 +5,8 @@ static long double strtox(const char *s, char **p, int prec) { - FILE f = { - .buf = (void *)s, .rpos = (void *)s, - .rend = (void *)-1, .lock = -1 - }; + FILE f; + sh_fromstring(&f, s); shlim(&f, 0); long double y = __floatscan(&f, prec, 1); off_t cnt = shcnt(&f); @@ -16,17 +14,24 @@ static long double strtox(const char *s, char **p, int prec) return y; } -float strtof(const char *s, char **p) +float strtof(const char *restrict s, char **restrict p) { return strtox(s, p, 0); } -double strtod(const char *s, char **p) +double strtod(const char *restrict s, char **restrict p) { return strtox(s, p, 1); } -long double strtold(const char *s, char **p) +long double strtold(const char *restrict s, char **restrict p) { return strtox(s, p, 2); } + +weak_alias(strtof, strtof_l); +weak_alias(strtod, strtod_l); +weak_alias(strtold, strtold_l); +weak_alias(strtof, __strtof_l); +weak_alias(strtod, __strtod_l); +weak_alias(strtold, __strtold_l);