diff --git a/src/hb-number-parser.hh b/src/hb-number-parser.hh index afad228f6..1a9dbba6d 100644 --- a/src/hb-number-parser.hh +++ b/src/hb-number-parser.hh @@ -119,9 +119,8 @@ _pow10 (unsigned exponent) /* a variant of strtod that also gets end of buffer in its second argument */ static inline double -strtod_rl (const char *buf, const char **end_ptr /* IN/OUT */) +strtod_rl (const char *p, const char **end_ptr /* IN/OUT */) { - const char *p, *pe; double value = 0; double frac = 0; double frac_count = 0; @@ -129,20 +128,19 @@ strtod_rl (const char *buf, const char **end_ptr /* IN/OUT */) bool neg = false, exp_neg = false, exp_overflow = false; const unsigned long long MAX_FRACT = 0xFFFFFFFFFFFFFull; /* 2^52-1 */ const unsigned MAX_EXP = 0x7FFu; /* 2^11-1 */ - p = buf; - pe = *end_ptr; + const char *pe = *end_ptr; while (p < pe && ISSPACE (*p)) p++; int cs; -#line 141 "hb-number-parser.hh" +#line 139 "hb-number-parser.hh" { cs = double_parser_start; } -#line 146 "hb-number-parser.hh" +#line 144 "hb-number-parser.hh" { int _slen; int _trans; @@ -200,7 +198,7 @@ _resume: exp_overflow = true; } break; -#line 204 "hb-number-parser.hh" +#line 202 "hb-number-parser.hh" } _again: @@ -212,10 +210,10 @@ _again: _out: {} } -#line 115 "hb-number-parser.rl" +#line 113 "hb-number-parser.rl" - *end_ptr = (const char *) p; + *end_ptr = p; if (frac_count) value += frac / _pow10 (frac_count); if (neg) value *= -1.; diff --git a/src/hb-number-parser.rl b/src/hb-number-parser.rl index 1de262afc..c6c4a3bab 100644 --- a/src/hb-number-parser.rl +++ b/src/hb-number-parser.rl @@ -92,9 +92,8 @@ _pow10 (unsigned exponent) /* a variant of strtod that also gets end of buffer in its second argument */ static inline double -strtod_rl (const char *buf, const char **end_ptr /* IN/OUT */) +strtod_rl (const char *p, const char **end_ptr /* IN/OUT */) { - const char *p, *pe; double value = 0; double frac = 0; double frac_count = 0; @@ -102,9 +101,8 @@ strtod_rl (const char *buf, const char **end_ptr /* IN/OUT */) bool neg = false, exp_neg = false, exp_overflow = false; const unsigned long long MAX_FRACT = 0xFFFFFFFFFFFFFull; /* 2^52-1 */ const unsigned MAX_EXP = 0x7FFu; /* 2^11-1 */ - p = buf; - pe = *end_ptr; + const char *pe = *end_ptr; while (p < pe && ISSPACE (*p)) p++; @@ -114,7 +112,7 @@ strtod_rl (const char *buf, const char **end_ptr /* IN/OUT */) write exec; }%% - *end_ptr = (const char *) p; + *end_ptr = p; if (frac_count) value += frac / _pow10 (frac_count); if (neg) value *= -1.;