159159 * floating-point numbers and flushes underflows to zero rather
160160 * than implementing gradual underflow, then you must also #define
161161 * Sudden_Underflow.
162- * #define USE_LOCALE to use the current locale's decimal_point value.
163162 * #define SET_INEXACT if IEEE arithmetic is being used and extra
164163 * computation should be done to set the inexact flag when the
165164 * result is inexact and avoid setting inexact when the result
@@ -206,10 +205,6 @@ static void Bug(const char *message) {
206205#include "stdlib.h"
207206#include "string.h"
208207
209- #ifdef USE_LOCALE
210- #include "locale.h"
211- #endif
212-
213208#ifdef Honor_FLT_ROUNDS
214209#ifndef Trust_FLT_ROUNDS
215210#include <fenv.h>
@@ -1827,25 +1822,6 @@ gethex( CONST char **sp, U *rvp, int rounding, int sign)
18271822#endif
18281823#endif /*}}*/
18291824 };
1830- #ifdef USE_LOCALE
1831- int i ;
1832- #ifdef NO_LOCALE_CACHE
1833- const unsigned char * decimalpoint = (unsigned char * )
1834- localeconv ()-> decimal_point ;
1835- #else
1836- const unsigned char * decimalpoint ;
1837- static unsigned char * decimalpoint_cache ;
1838- if (!(s0 = decimalpoint_cache )) {
1839- s0 = (unsigned char * )localeconv ()-> decimal_point ;
1840- if ((decimalpoint_cache = (unsigned char * )
1841- MALLOC (strlen ((CONST char * )s0 ) + 1 ))) {
1842- strcpy ((char * )decimalpoint_cache , (CONST char * )s0 );
1843- s0 = decimalpoint_cache ;
1844- }
1845- }
1846- decimalpoint = s0 ;
1847- #endif
1848- #endif
18491825
18501826 /**** if (!hexdig['0']) hexdig_init(); ****/
18511827 havedig = 0 ;
@@ -1861,17 +1837,9 @@ gethex( CONST char **sp, U *rvp, int rounding, int sign)
18611837 havedig ++ ;
18621838 else {
18631839 zret = 1 ;
1864- #ifdef USE_LOCALE
1865- for (i = 0 ; decimalpoint [i ]; ++ i ) {
1866- if (s [i ] != decimalpoint [i ])
1867- goto pcheck ;
1868- }
1869- decpt = s += i ;
1870- #else
18711840 if (* s != '.' )
18721841 goto pcheck ;
18731842 decpt = ++ s ;
1874- #endif
18751843 if (!hexdig [* s ])
18761844 goto pcheck ;
18771845 while (* s == '0' )
@@ -1883,17 +1851,8 @@ gethex( CONST char **sp, U *rvp, int rounding, int sign)
18831851 }
18841852 while (hexdig [* s ])
18851853 s ++ ;
1886- #ifdef USE_LOCALE
1887- if (* s == * decimalpoint && !decpt ) {
1888- for (i = 1 ; decimalpoint [i ]; ++ i ) {
1889- if (s [i ] != decimalpoint [i ])
1890- goto pcheck ;
1891- }
1892- decpt = s += i ;
1893- #else
18941854 if (* s == '.' && !decpt ) {
18951855 decpt = ++ s ;
1896- #endif
18971856 while (hexdig [* s ])
18981857 s ++ ;
18991858 }/*}*/
@@ -1982,19 +1941,9 @@ gethex( CONST char **sp, U *rvp, int rounding, int sign)
19821941 x = b -> x ;
19831942 n = 0 ;
19841943 L = 0 ;
1985- #ifdef USE_LOCALE
1986- for (i = 0 ; decimalpoint [i + 1 ]; ++ i );
1987- #endif
19881944 while (s1 > s0 ) {
1989- #ifdef USE_LOCALE
1990- if (* -- s1 == decimalpoint [i ]) {
1991- s1 -= i ;
1992- continue ;
1993- }
1994- #else
19951945 if (* -- s1 == '.' )
19961946 continue ;
1997- #endif
19981947 if (n == ULbits ) {
19991948 * x ++ = L ;
20001949 L = 0 ;
@@ -2566,10 +2515,6 @@ zend_strtod
25662515 }
25672516#endif /*}}*/
25682517#endif /*}*/
2569- #ifdef USE_LOCALE
2570- CONST char * s2 ;
2571- #endif
2572-
25732518 sign = nz0 = nz1 = nz = bc .dplen = bc .uflchk = 0 ;
25742519 dval (& rv ) = 0. ;
25752520 for (s = s00 ;;s ++ ) switch (* s ) {
@@ -2622,25 +2567,6 @@ zend_strtod
26222567 bc .dp0 = bc .dp1 = s - s0 ;
26232568 for (s1 = s ; s1 > s0 && * -- s1 == '0' ; )
26242569 ++ nz1 ;
2625- #ifdef USE_LOCALE
2626- s1 = localeconv ()-> decimal_point ;
2627- if (c == * s1 ) {
2628- c = '.' ;
2629- if (* ++ s1 ) {
2630- s2 = s ;
2631- for (;;) {
2632- if (* ++ s2 != * s1 ) {
2633- c = 0 ;
2634- break ;
2635- }
2636- if (!* ++ s1 ) {
2637- s = s2 ;
2638- break ;
2639- }
2640- }
2641- }
2642- }
2643- #endif
26442570 if (c == '.' ) {
26452571 c = * ++ s ;
26462572 bc .dp1 = s - s0 ;
0 commit comments