UV
Perl_grok_hex(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) {
+ dVAR;
const char *s = start;
STRLEN len = *len_p;
UV value = 0;
const UV max_div_16 = UV_MAX / 16;
const bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
bool overflowed = FALSE;
- const char *hexdigit;
if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) {
/* strip off leading x or 0x.
}
for (; len-- && *s; s++) {
- hexdigit = strchr(PL_hexdigit, *s);
+ const char *hexdigit = strchr(PL_hexdigit, *s);
if (hexdigit) {
/* Write it in this wonky order with a goto to attempt to get the
compiler to make the common case integer-only loop pretty tight.
if (exponent == 0)
return value;
if (value == 0)
- return 0;
+ return (NV)0;
/* On OpenVMS VAX we by default use the D_FLOAT double format,
* and that format does not have *easy* capabilities [1] for
return (scalbnl(x, -*e));
}
#endif
+
+/*
+ * Local variables:
+ * c-indentation-style: bsd
+ * c-basic-offset: 4
+ * indent-tabs-mode: t
+ * End:
+ *
+ * ex: set ts=8 sts=4 sw=4 noet:
+ */