delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2004/01/03/15:54:05

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
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

<HTML><FONT FACE=3Darial,helvetica><HTML><FONT  SIZE=3D3 PTSIZE=3D12 FAMILY=
=3D"SERIF" FACE=3D"Georgia" LANG=3D"0">There continues to be a conflict with=
 symbol 'roundl' in doprnt.c and the C99 function roundl().&nbsp; A suggeste=
d fix that works is:<BR>
<BR>
--- src/libc/ansi/stdio/doprnt.c    2003-11-08 07:19:40.000000000 -0500<BR>
+++ c:/gputil/doprnt.c  2004-01-03 15:36:26.000000000 -0500<BR>
@@ -69,7 +69,7 @@ static __inline__ char tochar(int n)<BR>
 <BR>
 static int cvtl(long double number, int prec, int flags, char *signp,<BR>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned char fmtch, char *st=
artp, char *endp);<BR>
-static char *roundl(long double fract, int *expv, char *start, char *end,<B=
R>
+static char *__roundl(long double fract, int *expv, char *start, char *end,=
<BR>
        &nbsp;&nbsp;&nbsp; char ch, char *signp);<BR>
 static char *exponentl(char *p, int expv, unsigned char fmtch);<BR>
 #ifdef __GO32__<BR>
@@ -615,7 +615,7 @@ cvtl(long double number, int prec, int f<BR>
    &nbsp; *t++ =3D tochar((int)tmp);<BR>
    } while (--prec &amp;&amp; fract);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (fract)<BR>
-   startp =3D roundl(fract, (int *)NULL, startp,<BR>
+   startp =3D __roundl(fract, (int *)NULL, startp,<BR>
            t - 1, (char)0, signp);<BR>
&nbsp;&nbsp;&nbsp;&nbsp; }<BR>
&nbsp;&nbsp;&nbsp;&nbsp; for (; prec--; *t++ =3D '0');<BR>
@@ -639,7 +639,7 @@ cvtl(long double number, int prec, int f<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!prec &amp;&amp; ++p &lt; endp)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>
    fract =3D 0;<BR>
-   startp =3D roundl((long double)0.0L, &amp;expcnt,<BR>
+   startp =3D __roundl((long double)0.0L, &amp;expcnt,<BR>
            startp, t - 1, *p, signp);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* adjust expcnt for digit in front of=20=
decimal */<BR>
@@ -701,7 +701,7 @@ cvtl(long double number, int prec, int f<BR>
    &nbsp; *t++ =3D tochar((int)tmp);<BR>
    } while (--prec &amp;&amp; fract);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (fract)<BR>
-   startp =3D roundl(fract, &amp;expcnt, startp,<BR>
+   startp =3D __roundl(fract, &amp;expcnt, startp,<BR>
            t - 1, (char)0, signp);<BR>
&nbsp;&nbsp;&nbsp;&nbsp; }<BR>
&nbsp;&nbsp;&nbsp;&nbsp; /* if requires more precision */<BR>
@@ -781,7 +781,7 @@ cvtl(long double number, int prec, int f<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>
&nbsp;&nbsp;&nbsp;&nbsp; }<BR>
&nbsp;&nbsp;&nbsp;&nbsp; if (fract)<BR>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; startp =3D roundl(fract, (int *)NULL, startp=
, t - 1,<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; startp =3D __roundl(fract, (int *)NULL, star=
tp, t - 1,<BR>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (char)0, signp);<BR>
&nbsp;&nbsp;&nbsp;&nbsp; /* alternate format, adds 0's for precision, else t=
rim 0's */<BR>
&nbsp;&nbsp;&nbsp;&nbsp; if (flags&amp;ALT)<BR>
@@ -797,7 +797,7 @@ cvtl(long double number, int prec, int f<BR>
 }<BR>
 <BR>
 static char *<BR>
-roundl(long double fract, int *expv, char *start, char *end, char ch,<BR>
+__roundl(long double fract, int *expv, char *start, char *end, char ch,<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char *signp)<BR>
 {<BR>
&nbsp;&nbsp; long double tmp;<BR>
</FONT></HTML>
--part1_185.2489dbc9.2d2885a2_boundary--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019