@@ -1554,9 +1554,8 @@ double xstrtod(const char *str, char **endptr, char decimal, char sci,
1554
1554
int n ;
1555
1555
int num_digits ;
1556
1556
int num_decimals ;
1557
- int _maybe_int = 1 ;
1558
-
1559
1557
1558
+ if (maybe_int != NULL ) maybe_int = 1 ;
1560
1559
// Skip leading whitespace.
1561
1560
while (isspace_ascii (* p )) p ++ ;
1562
1561
@@ -1596,7 +1595,7 @@ double xstrtod(const char *str, char **endptr, char decimal, char sci,
1596
1595
1597
1596
// Process decimal part.
1598
1597
if (* p == decimal ) {
1599
- _maybe_int = 0 ;
1598
+ if ( maybe_int != NULL ) maybe_int = 0 ;
1600
1599
p ++ ;
1601
1600
1602
1601
while (isdigit_ascii (* p )) {
@@ -1619,7 +1618,7 @@ double xstrtod(const char *str, char **endptr, char decimal, char sci,
1619
1618
1620
1619
// Process an exponent string.
1621
1620
if (toupper_ascii (* p ) == toupper_ascii (sci )) {
1622
- _maybe_int = 0 ;
1621
+ if ( maybe_int != NULL ) maybe_int = 0 ;
1623
1622
1624
1623
// Handle optional sign.
1625
1624
negative = 0 ;
@@ -1678,7 +1677,6 @@ double xstrtod(const char *str, char **endptr, char decimal, char sci,
1678
1677
}
1679
1678
1680
1679
if (endptr ) * endptr = p ;
1681
- if (maybe_int ) * maybe_int = _maybe_int ;
1682
1680
return number ;
1683
1681
}
1684
1682
@@ -1693,7 +1691,8 @@ double precise_xstrtod(const char *str, char **endptr, char decimal,
1693
1691
int num_decimals ;
1694
1692
int max_digits = 17 ;
1695
1693
int n ;
1696
- int _maybe_int = 1 ;
1694
+
1695
+ if (maybe_int != NULL ) maybe_int = 1 ;
1697
1696
// Cache powers of 10 in memory.
1698
1697
static double e [] = {
1699
1698
1. , 1e1 , 1e2 , 1e3 , 1e4 , 1e5 , 1e6 , 1e7 , 1e8 , 1e9 ,
@@ -1760,7 +1759,7 @@ double precise_xstrtod(const char *str, char **endptr, char decimal,
1760
1759
1761
1760
// Process decimal part
1762
1761
if (* p == decimal ) {
1763
- _maybe_int = 0 ;
1762
+ if ( maybe_int != NULL ) maybe_int = 0 ;
1764
1763
p ++ ;
1765
1764
1766
1765
while (num_digits < max_digits && isdigit_ascii (* p )) {
@@ -1786,7 +1785,7 @@ double precise_xstrtod(const char *str, char **endptr, char decimal,
1786
1785
1787
1786
// Process an exponent string.
1788
1787
if (toupper_ascii (* p ) == toupper_ascii (sci )) {
1789
- _maybe_int = 0 ;
1788
+ if ( maybe_int != NULL ) maybe_int = 0 ;
1790
1789
1791
1790
// Handle optional sign
1792
1791
negative = 0 ;
@@ -1837,7 +1836,6 @@ double precise_xstrtod(const char *str, char **endptr, char decimal,
1837
1836
}
1838
1837
1839
1838
if (endptr ) * endptr = p ;
1840
- if (maybe_int ) * maybe_int = _maybe_int ;
1841
1839
return number ;
1842
1840
}
1843
1841
0 commit comments