@@ -1554,9 +1554,8 @@ double xstrtod(const char *str, char **endptr, char decimal, char sci,
15541554 int n ;
15551555 int num_digits ;
15561556 int num_decimals ;
1557- int _maybe_int = 1 ;
1558-
15591557
1558+ if (maybe_int != NULL ) maybe_int = 1 ;
15601559 // Skip leading whitespace.
15611560 while (isspace_ascii (* p )) p ++ ;
15621561
@@ -1596,7 +1595,7 @@ double xstrtod(const char *str, char **endptr, char decimal, char sci,
15961595
15971596 // Process decimal part.
15981597 if (* p == decimal ) {
1599- _maybe_int = 0 ;
1598+ if ( maybe_int != NULL ) maybe_int = 0 ;
16001599 p ++ ;
16011600
16021601 while (isdigit_ascii (* p )) {
@@ -1619,7 +1618,7 @@ double xstrtod(const char *str, char **endptr, char decimal, char sci,
16191618
16201619 // Process an exponent string.
16211620 if (toupper_ascii (* p ) == toupper_ascii (sci )) {
1622- _maybe_int = 0 ;
1621+ if ( maybe_int != NULL ) maybe_int = 0 ;
16231622
16241623 // Handle optional sign.
16251624 negative = 0 ;
@@ -1678,7 +1677,6 @@ double xstrtod(const char *str, char **endptr, char decimal, char sci,
16781677 }
16791678
16801679 if (endptr ) * endptr = p ;
1681- if (maybe_int ) * maybe_int = _maybe_int ;
16821680 return number ;
16831681}
16841682
@@ -1693,7 +1691,8 @@ double precise_xstrtod(const char *str, char **endptr, char decimal,
16931691 int num_decimals ;
16941692 int max_digits = 17 ;
16951693 int n ;
1696- int _maybe_int = 1 ;
1694+
1695+ if (maybe_int != NULL ) maybe_int = 1 ;
16971696 // Cache powers of 10 in memory.
16981697 static double e [] = {
16991698 1. , 1e1 , 1e2 , 1e3 , 1e4 , 1e5 , 1e6 , 1e7 , 1e8 , 1e9 ,
@@ -1760,7 +1759,7 @@ double precise_xstrtod(const char *str, char **endptr, char decimal,
17601759
17611760 // Process decimal part
17621761 if (* p == decimal ) {
1763- _maybe_int = 0 ;
1762+ if ( maybe_int != NULL ) maybe_int = 0 ;
17641763 p ++ ;
17651764
17661765 while (num_digits < max_digits && isdigit_ascii (* p )) {
@@ -1786,7 +1785,7 @@ double precise_xstrtod(const char *str, char **endptr, char decimal,
17861785
17871786 // Process an exponent string.
17881787 if (toupper_ascii (* p ) == toupper_ascii (sci )) {
1789- _maybe_int = 0 ;
1788+ if ( maybe_int != NULL ) maybe_int = 0 ;
17901789
17911790 // Handle optional sign
17921791 negative = 0 ;
@@ -1837,7 +1836,6 @@ double precise_xstrtod(const char *str, char **endptr, char decimal,
18371836 }
18381837
18391838 if (endptr ) * endptr = p ;
1840- if (maybe_int ) * maybe_int = _maybe_int ;
18411839 return number ;
18421840}
18431841
0 commit comments