summaryrefslogtreecommitdiffstats
path: root/usr.bin/f2c/output.c
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1999-02-03 17:23:49 +0000
committerjoerg <joerg@FreeBSD.org>1999-02-03 17:23:49 +0000
commit38d2602fc10af68938b30ae204bbdd4ea9fdb506 (patch)
tree2340d0a1cae271336fb29c80c560f5c3b9d2211b /usr.bin/f2c/output.c
parent4176c26a7a1c550e3ef04ef8c9734bfc83ae9f11 (diff)
downloadFreeBSD-src-38d2602fc10af68938b30ae204bbdd4ea9fdb506.zip
FreeBSD-src-38d2602fc10af68938b30ae204bbdd4ea9fdb506.tar.gz
Update to the most recent version. Among other things, this also solves
the function naming problem for complex double function i've recently aksed for in -committers. (The recently committed rev 1.5 of proc.c was actually also part of this update.) Should the mailing lists come to an agreement that f2c better belongs into the ports, this could be done nevertheless. For the time being, we've at least got a current version now. Thanks, Steve! Submitted by: Steve Kargl <sgk@troutmask.apl.washington.edu>
Diffstat (limited to 'usr.bin/f2c/output.c')
-rw-r--r--usr.bin/f2c/output.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/usr.bin/f2c/output.c b/usr.bin/f2c/output.c
index 03d0ed0..5f650e7 100644
--- a/usr.bin/f2c/output.c
+++ b/usr.bin/f2c/output.c
@@ -443,8 +443,6 @@ out_name(FILE *fp, Namep namep)
} /* out_name */
-static char *Longfmt = "%ld";
-
#define cpd(n) cp->vstg ? cp->Const.cds[n] : dtos(cp->Const.cd[n])
void
@@ -469,7 +467,7 @@ out_const(FILE *fp, register Constp cp)
#ifdef TYQUAD
case TYQUAD:
#endif
- nice_printf (fp, Longfmt, cp->Const.ci); /* don't cast ci! */
+ nice_printf (fp, "%ld", cp->Const.ci); /* don't cast ci! */
break;
case TYREAL:
nice_printf(fp, "%s", flconst(real_buf, cpd(0)));
@@ -1315,10 +1313,11 @@ out_call(FILE *outfile, int op, int ftype, expptr len, expptr name, expptr args)
/* Might be a Constant expression, e.g. string length, character constants */
else if (q -> tag == TCONST) {
- if (tyioint == TYLONG)
- Longfmt = "%ldL";
- out_const(outfile, &q->constblock);
- Longfmt = "%ld";
+ if (q->constblock.vtype == TYLONG)
+ nice_printf(outfile, "(ftnlen)%ld",
+ q->constblock.Const.ci);
+ else
+ out_const(outfile, &q->constblock);
}
/* Must be some other kind of expression, or register var, or constant.
@@ -1329,7 +1328,10 @@ out_call(FILE *outfile, int op, int ftype, expptr len, expptr name, expptr args)
int use_paren = q -> tag == TEXPR &&
op_precedence (q -> exprblock.opcode) <=
op_precedence (OPCOMMA);
-
+ if (q->headblock.vtype == TYREAL && forcereal) {
+ nice_printf(outfile, "(real)");
+ use_paren = 1;
+ }
if (use_paren) nice_printf (outfile, "(");
expr_out (outfile, q);
if (use_paren) nice_printf (outfile, ")");
OpenPOWER on IntegriCloud