X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f From: Kbwms AT aol DOT com Message-ID: <185.2489dbc9.2d2885a2@aol.com> Date: Sat, 3 Jan 2004 15:52:50 EST Subject: Patch for doprnt.c in djgpp v204 Beta To: djgpp-workers AT delorie DOT com MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="part1_185.2489dbc9.2d2885a2_boundary" X-Mailer: 8.0 for Windows sub 6021 Reply-To: djgpp-workers AT delorie DOT com --part1_185.2489dbc9.2d2885a2_boundary Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit There continues to be a conflict with symbol 'roundl' in doprnt.c and the C99 function roundl(). A suggested fix that works is: --- src/libc/ansi/stdio/doprnt.c 2003-11-08 07:19:40.000000000 -0500 +++ c:/gputil/doprnt.c 2004-01-03 15:36:26.000000000 -0500 @@ -69,7 +69,7 @@ static __inline__ char tochar(int n) static int cvtl(long double number, int prec, int flags, char *signp, unsigned char fmtch, char *startp, char *endp); -static char *roundl(long double fract, int *expv, char *start, char *end, +static char *__roundl(long double fract, int *expv, char *start, char *end, char ch, char *signp); static char *exponentl(char *p, int expv, unsigned char fmtch); #ifdef __GO32__ @@ -615,7 +615,7 @@ cvtl(long double number, int prec, int f *t++ = tochar((int)tmp); } while (--prec && fract); if (fract) - startp = roundl(fract, (int *)NULL, startp, + startp = __roundl(fract, (int *)NULL, startp, t - 1, (char)0, signp); } for (; prec--; *t++ = '0'); @@ -639,7 +639,7 @@ cvtl(long double number, int prec, int f if (!prec && ++p < endp) { fract = 0; - startp = roundl((long double)0.0L, &expcnt, + startp = __roundl((long double)0.0L, &expcnt, startp, t - 1, *p, signp); } /* adjust expcnt for digit in front of decimal */ @@ -701,7 +701,7 @@ cvtl(long double number, int prec, int f *t++ = tochar((int)tmp); } while (--prec && fract); if (fract) - startp = roundl(fract, &expcnt, startp, + startp = __roundl(fract, &expcnt, startp, t - 1, (char)0, signp); } /* if requires more precision */ @@ -781,7 +781,7 @@ cvtl(long double number, int prec, int f } } if (fract) - startp = roundl(fract, (int *)NULL, startp, t - 1, + startp = __roundl(fract, (int *)NULL, startp, t - 1, (char)0, signp); /* alternate format, adds 0's for precision, else trim 0's */ if (flags&ALT) @@ -797,7 +797,7 @@ cvtl(long double number, int prec, int f } static char * -roundl(long double fract, int *expv, char *start, char *end, char ch, +__roundl(long double fract, int *expv, char *start, char *end, char ch, char *signp) { long double tmp; --part1_185.2489dbc9.2d2885a2_boundary Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable There continues to be a conflict with= symbol 'roundl' in doprnt.c and the C99 function roundl().  A suggeste= d fix that works is:

--- src/libc/ansi/stdio/doprnt.c 2003-11-08 07:19:40.000000000 -0500
+++ c:/gputil/doprnt.c 2004-01-03 15:36:26.000000000 -0500
@@ -69,7 +69,7 @@ static __inline__ char tochar(int n)

static int cvtl(long double number, int prec, int flags, char *signp,
        unsigned char fmtch, char *st= artp, char *endp);
-static char *roundl(long double fract, int *expv, char *start, char *end, +static char *__roundl(long double fract, int *expv, char *start, char *end,=
    char ch, char *signp);
static char *exponentl(char *p, int expv, unsigned char fmtch);
#ifdef __GO32__
@@ -615,7 +615,7 @@ cvtl(long double number, int prec, int f
  *t++ =3D tochar((int)tmp);
} while (--prec && fract);
       if (fract)
- startp =3D roundl(fract, (int *)NULL, startp,
+ startp =3D __roundl(fract, (int *)NULL, startp,
t - 1, (char)0, signp);
     }
     for (; prec--; *t++ =3D '0');
@@ -639,7 +639,7 @@ cvtl(long double number, int prec, int f
       if (!prec && ++p < endp)
       {
fract =3D 0;
- startp =3D roundl((long double)0.0L, &expcnt,
+ startp =3D __roundl((long double)0.0L, &expcnt,
startp, t - 1, *p, signp);
       }
       /* adjust expcnt for digit in front of=20= decimal */
@@ -701,7 +701,7 @@ cvtl(long double number, int prec, int f
  *t++ =3D tochar((int)tmp);
} while (--prec && fract);
       if (fract)
- startp =3D roundl(fract, &expcnt, startp,
+ startp =3D __roundl(fract, &expcnt, startp,
t - 1, (char)0, signp);
     }
     /* if requires more precision */
@@ -781,7 +781,7 @@ cvtl(long double number, int prec, int f
       }
     }
     if (fract)
-      startp =3D roundl(fract, (int *)NULL, startp= , t - 1,
+      startp =3D __roundl(fract, (int *)NULL, star= tp, t - 1,
      (char)0, signp);
     /* alternate format, adds 0's for precision, else t= rim 0's */
     if (flags&ALT)
@@ -797,7 +797,7 @@ cvtl(long double number, int prec, int f
}

static char *
-roundl(long double fract, int *expv, char *start, char *end, char ch,
+__roundl(long double fract, int *expv, char *start, char *end, char ch,
        char *signp)
{
   long double tmp;
--part1_185.2489dbc9.2d2885a2_boundary--