* Materiel Command, USAF, under agreement number F39502-99-1-0512.
*/
-static char * __cvt(double value, int ndigit, int *decpt, int *sign, int fmode, int pad)
+static char * __cvt(double value, int ndigit, int *decpt, int *sign, int fmode, int pad) /* {{{ */
{
register char *s = NULL;
char *p, *rve, c;
return(s);
}
+/* }}} */
-static inline char *php_ecvt(double value, int ndigit, int *decpt, int *sign)
+static inline char *php_ecvt(double value, int ndigit, int *decpt, int *sign) /* {{{ */
{
return(__cvt(value, ndigit, decpt, sign, 0, 1));
}
+/* }}} */
-static inline char *php_fcvt(double value, int ndigit, int *decpt, int *sign)
+static inline char *php_fcvt(double value, int ndigit, int *decpt, int *sign) /* {{{ */
{
return(__cvt(value, ndigit, decpt, sign, 1, 1));
}
+/* }}} */
-PHPAPI char *php_gcvt(double value, int ndigit, char dec_point, char exponent, char *buf)
+PHPAPI char *php_gcvt(double value, int ndigit, char dec_point, char exponent, char *buf) /* {{{ */
{
char *digits, *dst, *src;
int i, decpt, sign;
* Infinity or NaN, convert to inf or nan with sign.
* We assume the buffer is at least ndigit long.
*/
- snprintf(buf, ndigit + 1, "%s%s", (sign && *digits == 'I') ? "-" : "",
- *digits == 'I' ? "INF" : "NAN");
+ snprintf(buf, ndigit + 1, "%s%s", (sign && *digits == 'I') ? "-" : "", *digits == 'I' ? "INF" : "NAN");
zend_freedtoa(digits);
return (buf);
}
dst = buf;
- if (sign)
+ if (sign) {
*dst++ = '-';
+ }
for (i = 0; i < ndigit && digits[i] != '\0'; i++);
- if ((decpt >= 0 && decpt - i > 4)
- || (decpt < 0 && decpt < -3)) { /* use E-style */
+ if ((decpt >= 0 && decpt - i > 4) || (decpt < 0 && decpt < -3)) { /* use E-style */
/* exponential format (e.g. 1.2345e+13) */
if (--decpt < 0) {
sign = 1;
decpt = -decpt;
- } else
+ } else {
sign = 0;
+ }
src = digits;
*dst++ = *src++;
*dst++ = dec_point;
} while (*src != '\0');
}
*dst++ = exponent;
- if (sign)
+ if (sign) {
*dst++ = '-';
- else
+ } else {
*dst++ = '+';
+ }
if (decpt < 10) {
*dst++ = '0' + decpt;
*dst = '\0';
} else {
/* standard format */
for (i = 0, src = digits; i < decpt; i++) {
- if (*src != '\0')
+ if (*src != '\0') {
*dst++ = *src++;
- else
+ } else {
*dst++ = '0';
+ }
}
if (*src != '\0') {
- if (src == digits)
+ if (src == digits) {
*dst++ = '0'; /* zero before decimal point */
+ }
*dst++ = dec_point;
for (i = decpt; digits[i] != '\0'; i++) {
*dst++ = digits[i];
zend_freedtoa(digits);
return (buf);
}
+/* }}} */
-
+/* Apache license {{{ */
/* ====================================================================
* Copyright (c) 1995-1998 The Apache Group. All rights reserved.
*
* SIO stdio-replacement strx_* functions by Panos Tsirigotis
* <panos@alumni.cs.colorado.edu> for xinetd.
*/
+/* }}} */
#define FALSE 0
#define TRUE 1
* which is a pointer to the END of the buffer + 1 (i.e. if the buffer
* is declared as buf[ 100 ], buf_end should be &buf[ 100 ])
*/
+/* char *ap_php_conv_10() {{{ */
char * ap_php_conv_10(register wide_int num, register bool_int is_unsigned,
register bool_int * is_negative, char *buf_end, register int *len)
{
*len = buf_end - p;
return (p);
}
+/* }}} */
/* If you change this value then also change bug24640.phpt.
* Also NDIG must be reasonable smaller than NUM_BUF_SIZE.
* The sign is returned in the is_negative argument (and is not placed
* in buf).
*/
+/* PHPAPI char *php_conf_fp() {{{ */
PHPAPI char * php_conv_fp(register char format, register double num,
boolean_e add_dp, int precision, char dec_point, bool_int * is_negative, char *buf, int *len)
{
free(p_orig);
return (buf);
}
+/* }}} */
/*
* Convert num to a base X number where X is a power of 2. nbits determines X.
* which is a pointer to the END of the buffer + 1 (i.e. if the buffer
* is declared as buf[ 100 ], buf_end should be &buf[ 100 ])
*/
-char * ap_php_conv_p2(register u_wide_int num, register int nbits,
- char format, char *buf_end, register int *len)
+char * ap_php_conv_p2(register u_wide_int num, register int nbits, char format, char *buf_end, register int *len) /* {{{ */
{
register int mask = (1 << nbits) - 1;
register char *p = buf_end;
*len = buf_end - p;
return (p);
}
-
+/* }}} */
/*
* NUM_BUF_SIZE is the size of the buffer used for arithmetic conversions
/*
* Do format conversion placing the output in buffer
*/
-static int format_converter(register buffy * odp, const char *fmt,
- va_list ap)
+static int format_converter(register buffy * odp, const char *fmt, va_list ap) /* {{{ */
{
register char *sp;
register char *bep;
odp->nextb = sp;
return (cc);
}
-
+/* }}} */
/*
* This is the general purpose conversion function.
*/
-static void strx_printv(int *ccp, char *buf, size_t len, const char *format,
- va_list ap)
+static void strx_printv(int *ccp, char *buf, size_t len, const char *format, va_list ap) /* {{{ */
{
buffy od;
int cc;
if (ccp)
*ccp = cc;
}
+/* }}} */
-
-PHPAPI int ap_php_slprintf(char *buf, size_t len, const char *format,...)
+PHPAPI int ap_php_slprintf(char *buf, size_t len, const char *format,...) /* {{{ */
{
int cc;
va_list ap;
}
return cc;
}
+/* }}} */
-
-PHPAPI int ap_php_vslprintf(char *buf, size_t len, const char *format, va_list ap)
+PHPAPI int ap_php_vslprintf(char *buf, size_t len, const char *format, va_list ap) /* {{{ */
{
int cc;
}
return cc;
}
+/* }}} */
-PHPAPI int ap_php_snprintf(char *buf, size_t len, const char *format,...)
+PHPAPI int ap_php_snprintf(char *buf, size_t len, const char *format,...) /* {{{ */
{
int cc;
va_list ap;
va_end(ap);
return (cc);
}
+/* }}} */
-
-PHPAPI int ap_php_vsnprintf(char *buf, size_t len, const char *format, va_list ap)
+PHPAPI int ap_php_vsnprintf(char *buf, size_t len, const char *format, va_list ap) /* {{{ */
{
int cc;
strx_printv(&cc, buf, len, format, ap);
return (cc);
}
+/* }}} */
/*
* Local variables: