Add support for printing long doubles.

PR:		36783
This commit is contained in:
Tim J. Robbins 2002-05-17 06:12:25 +00:00
parent ae3f633bae
commit 828663767a
3 changed files with 12 additions and 1 deletions

View File

@ -117,6 +117,7 @@ print(pr, bp)
PR *pr;
u_char *bp;
{
long double ldbl;
double f8;
float f4;
int16_t s2;
@ -149,6 +150,10 @@ print(pr, bp)
bcopy(bp, &f8, sizeof(f8));
(void)printf(pr->fmt, f8);
break;
case sizeof(long double):
bcopy(bp, &ldbl, sizeof(ldbl));
(void)printf(pr->fmt, ldbl);
break;
}
break;
case F_INT:

View File

@ -276,7 +276,7 @@ Four byte default, one, two and four byte counts supported.
.Li \&%E , \&%e , \&%f ,
.Li \&%G , \&%g
.Xc
Eight byte default, four byte counts supported.
Eight byte default, four and twelve byte counts supported.
.El
.Pp
The amount of data interpreted by each format string is the sum of the

View File

@ -313,6 +313,12 @@ isint: cs[2] = '\0';
case 4:
pr->bcnt = 4;
break;
case sizeof(long double):
cs[2] = '\0';
cs[1] = cs[0];
cs[0] = 'L';
pr->bcnt = sizeof(long double);
break;
default:
p1[1] = '\0';
badcnt(p1);