5757 * Materiel Command, USAF, under agreement number F39502-99-1-0512.
5858 */
5959
60- static char * __cvt (double value , int ndigit , int * decpt , int * sign , int fmode , int pad ) /* {{{ */
60+ static char * __cvt (double value , int ndigit , int * decpt , bool * sign , int fmode , int pad ) /* {{{ */
6161{
6262 register char * s = NULL ;
6363 char * p , * rve , c ;
@@ -116,13 +116,13 @@ static char * __cvt(double value, int ndigit, int *decpt, int *sign, int fmode,
116116}
117117/* }}} */
118118
119- static inline char * php_ecvt (double value , int ndigit , int * decpt , int * sign ) /* {{{ */
119+ static inline char * php_ecvt (double value , int ndigit , int * decpt , bool * sign ) /* {{{ */
120120{
121121 return (__cvt (value , ndigit , decpt , sign , 0 , 1 ));
122122}
123123/* }}} */
124124
125- static inline char * php_fcvt (double value , int ndigit , int * decpt , int * sign ) /* {{{ */
125+ static inline char * php_fcvt (double value , int ndigit , int * decpt , bool * sign ) /* {{{ */
126126{
127127 return (__cvt (value , ndigit , decpt , sign , 1 , 1 ));
128128}
@@ -131,7 +131,8 @@ static inline char *php_fcvt(double value, int ndigit, int *decpt, int *sign) /*
131131PHPAPI char * php_gcvt (double value , int ndigit , char dec_point , char exponent , char * buf ) /* {{{ */
132132{
133133 char * digits , * dst , * src ;
134- int i , decpt , sign ;
134+ int i , decpt ;
135+ bool sign ;
135136 int mode = ndigit >= 0 ? 2 : 0 ;
136137
137138 if (mode == 0 ) {
@@ -182,7 +183,8 @@ PHPAPI char *php_gcvt(double value, int ndigit, char dec_point, char exponent, c
182183 * dst = '\0' ;
183184 } else {
184185 /* XXX - optimize */
185- for (sign = decpt , i = 0 ; (sign /= 10 ) != 0 ; i ++ );
186+ int n ;
187+ for (n = decpt , i = 0 ; (n /= 10 ) != 0 ; i ++ );
186188 dst [i + 1 ] = '\0' ;
187189 while (decpt != 0 ) {
188190 dst [i -- ] = '0' + decpt % 10 ;
@@ -283,8 +285,6 @@ PHPAPI char *php_gcvt(double value, int ndigit, char dec_point, char exponent, c
283285 */
284286/* }}} */
285287
286- #define FALSE 0
287- #define TRUE 1
288288#define NUL '\0'
289289#define INT_NULL ((int *)0)
290290
@@ -300,23 +300,23 @@ PHPAPI char *php_gcvt(double value, int ndigit, char dec_point, char exponent, c
300300 * Return value:
301301 * - a pointer to a string containing the number (no sign)
302302 * - len contains the length of the string
303- * - is_negative is set to TRUE or FALSE depending on the sign
304- * of the number (always set to FALSE if is_unsigned is TRUE )
303+ * - is_negative is set to true or false depending on the sign
304+ * of the number (always set to false if is_unsigned is true )
305305 *
306306 * The caller provides a buffer for the string: that is the buf_end argument
307307 * which is a pointer to the END of the buffer + 1 (i.e. if the buffer
308308 * is declared as buf[ 100 ], buf_end should be &buf[ 100 ])
309309 */
310310/* char * ap_php_conv_10() {{{ */
311- PHPAPI char * ap_php_conv_10 (register wide_int num , register bool_int is_unsigned ,
312- register bool_int * is_negative , char * buf_end , register size_t * len )
311+ PHPAPI char * ap_php_conv_10 (register wide_int num , register bool is_unsigned ,
312+ register bool * is_negative , char * buf_end , register size_t * len )
313313{
314314 register char * p = buf_end ;
315315 register u_wide_int magnitude ;
316316
317317 if (is_unsigned ) {
318318 magnitude = (u_wide_int ) num ;
319- * is_negative = FALSE ;
319+ * is_negative = false ;
320320 } else {
321321 * is_negative = (num < 0 );
322322
@@ -367,7 +367,7 @@ PHPAPI char * ap_php_conv_10(register wide_int num, register bool_int is_unsigne
367367 */
368368/* PHPAPI char * php_conv_fp() {{{ */
369369PHPAPI char * php_conv_fp (register char format , register double num ,
370- boolean_e add_dp , int precision , char dec_point , bool_int * is_negative , char * buf , size_t * len )
370+ boolean_e add_dp , int precision , char dec_point , bool * is_negative , char * buf , size_t * len )
371371{
372372 register char * s = buf ;
373373 register char * p , * p_orig ;
@@ -389,7 +389,7 @@ PHPAPI char * php_conv_fp(register char format, register double num,
389389 if (isalpha ((int )* p )) {
390390 * len = strlen (p );
391391 memcpy (buf , p , * len + 1 );
392- * is_negative = FALSE ;
392+ * is_negative = false ;
393393 free (p_orig );
394394 return (buf );
395395 }
@@ -436,12 +436,12 @@ PHPAPI char * php_conv_fp(register char format, register double num,
436436 if (format != 'F' ) {
437437 char temp [EXPONENT_LENGTH ]; /* for exponent conversion */
438438 size_t t_len ;
439- bool_int exponent_is_negative ;
439+ bool exponent_is_negative ;
440440
441441 * s ++ = format ; /* either e or E */
442442 decimal_point -- ;
443443 if (decimal_point != 0 ) {
444- p = ap_php_conv_10 ((wide_int ) decimal_point , FALSE , & exponent_is_negative , & temp [EXPONENT_LENGTH ], & t_len );
444+ p = ap_php_conv_10 ((wide_int ) decimal_point , false , & exponent_is_negative , & temp [EXPONENT_LENGTH ], & t_len );
445445 * s ++ = exponent_is_negative ? '-' : '+' ;
446446
447447 /*
@@ -616,7 +616,7 @@ static int format_converter(register buffy * odp, const char *fmt, va_list ap) /
616616 boolean_e print_blank ;
617617 boolean_e adjust_precision ;
618618 boolean_e adjust_width ;
619- bool_int is_negative ;
619+ bool is_negative ;
620620
621621 sp = odp -> nextb ;
622622 bep = odp -> buf_end ;
0 commit comments