jim 97/01/18 13:28:16
Modified: src util_snprintf.c Log: avoid prototype conflicts the right way now Revision Changes Path 1.2 +20 -21 apache/src/util_snprintf.c Index: util_snprintf.c =================================================================== RCS file: /export/home/cvs/apache/src/util_snprintf.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C3 -r1.1 -r1.2 *** util_snprintf.c 1997/01/18 19:17:21 1.1 --- util_snprintf.c 1997/01/18 21:28:15 1.2 *************** *** 64,77 **** #include <sys/types.h> #include <stdarg.h> ! #ifndef HAVE_CVT /* We should really use this anyway */ ! /* ! * Take care of possible prototyping conflicts ! */ ! #define ecvt __ap_ecvt ! #define fcvt __ap_fcvt ! #define gcvt __ap_gcvt /* * cvt.c - IEEE floating point formatting routines for FreeBSD --- 64,76 ---- #include <sys/types.h> #include <stdarg.h> ! #ifdef HAVE_CVT ! # define ap_ecvt ecvt ! # define ap_fcvt fcvt ! # define ap_gcvt gcvt ! ! #else /* * cvt.c - IEEE floating point formatting routines for FreeBSD *************** *** 82,88 **** #include <math.h> /* ! * __ap_ecvt converts to decimal * the number of digits is specified by ndigit * decpt is set to the position of the decimal point * sign is set to 0 for positive, 1 for negative --- 81,87 ---- #include <math.h> /* ! * ap_ecvt converts to decimal * the number of digits is specified by ndigit * decpt is set to the position of the decimal point * sign is set to 0 for positive, 1 for negative *************** *** 91,97 **** #define NDIG 80 static char * ! __ap_cvt(double arg, int ndigits, int *decpt, int *sign, int eflag) { register int r2; double fi, fj; --- 90,96 ---- #define NDIG 80 static char * ! ap_cvt(double arg, int ndigits, int *decpt, int *sign, int eflag) { register int r2; double fi, fj; *************** *** 166,195 **** } static char * ! __ap_ecvt(double arg, int ndigits, int *decpt, int *sign) { ! return (__ap_cvt(arg, ndigits, decpt, sign, 1)); } static char * ! __ap_fcvt(double arg, int ndigits, int *decpt, int *sign) { ! return (__ap_cvt(arg, ndigits, decpt, sign, 0)); } /* ! * __ap_gcvt - Floating output conversion to * minimal length string */ static char * ! __ap_gcvt(double number, int ndigit, char *buf) { int sign, decpt; register char *p1, *p2; register i; ! p1 = __ap_ecvt(number, ndigit, &decpt, &sign); p2 = buf; if (sign) *p2++ = '-'; --- 165,194 ---- } static char * ! ap_ecvt(double arg, int ndigits, int *decpt, int *sign) { ! return (ap_cvt(arg, ndigits, decpt, sign, 1)); } static char * ! ap_fcvt(double arg, int ndigits, int *decpt, int *sign) { ! return (ap_cvt(arg, ndigits, decpt, sign, 0)); } /* ! * ap_gcvt - Floating output conversion to * minimal length string */ static char * ! ap_gcvt(double number, int ndigit, char *buf) { int sign, decpt; register char *p1, *p2; register i; ! p1 = ap_ecvt(number, ndigit, &decpt, &sign); p2 = buf; if (sign) *p2++ = '-'; *************** *** 417,429 **** register char *s = buf; register char *p; int decimal_point; ! char *ecvt(double, int, int *, int *), *fcvt(double, int, int *, int *); char *strcpy(char *, const char *); if (format == 'f') ! p = fcvt(num, precision, &decimal_point, is_negative); else /* either e or E format */ ! p = ecvt(num, precision + 1, &decimal_point, is_negative); /* * Check for Infinity and NaN --- 416,428 ---- register char *s = buf; register char *p; int decimal_point; ! extern char *ap_ecvt(), *ap_fcvt(); char *strcpy(char *, const char *); if (format == 'f') ! p = ap_fcvt(num, precision, &decimal_point, is_negative); else /* either e or E format */ ! p = ap_ecvt(num, precision + 1, &decimal_point, is_negative); /* * Check for Infinity and NaN *************** *** 567,573 **** boolean_e adjust_width; bool_int is_negative; ! char *gcvt(double, int, char *); char *strchr(const char *, int); int isascii(int); --- 566,572 ---- boolean_e adjust_width; bool_int is_negative; ! extern char *ap_gcvt(); char *strchr(const char *, int); int isascii(int); *************** *** 776,782 **** /* * * We use &num_buf[ 1 ], so that we have room for the sign */ ! s = gcvt(va_arg(ap, double), precision, &num_buf[1]); if (*s == '-') prefix_char = *s++; else if (print_sign) --- 775,781 ---- /* * * We use &num_buf[ 1 ], so that we have room for the sign */ ! s = ap_gcvt(va_arg(ap, double), precision, &num_buf[1]); if (*s == '-') prefix_char = *s++; else if (print_sign)