BSD 4_3 release
[unix-history] / usr / src / usr.bin / f77 / src / f77pass1 / init.c
index f3a0638..8678f2d 100644 (file)
@@ -1,3 +1,37 @@
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)init.c      5.2 (Berkeley) 8/29/85";
+#endif
+
+/*
+ * init.c
+ *
+ * Initializations for f77 compiler, pass 1.
+ *
+ * University of Utah CS Dept modification history:
+ *
+ * $Header: init.c,v 5.2 85/08/10 04:30:57 donn Exp $
+ * $Log:       init.c,v $
+ * Revision 5.2  85/08/10  04:30:57  donn
+ * Jerry Berkman's changes to ifdef 66 code and handle -r8/double flag.
+ * 
+ * Revision 5.1  85/08/10  03:47:33  donn
+ * 4.3 alpha
+ * 
+ * Revision 2.1  84/07/19  12:03:26  donn
+ * Changed comment headers for UofU.
+ * 
+ * Revision 1.3  84/02/28  21:07:53  donn
+ * Added Berkeley changes for call argument temporaries fix.
+ * 
+ * Fixed incorrect check of 'cdatafile' when 'cchkfile' is opened. -- Donn
+ */
+
 #include "defs.h"
 #include "io.h"
 #include <sys/file.h>
 #include "defs.h"
 #include "io.h"
 #include <sys/file.h>
@@ -19,8 +53,11 @@ int needkwd;
 struct Labelblock *thislabel   = NULL;
 flag nowarnflag        = NO;
 flag ftn66flag = NO;
 struct Labelblock *thislabel   = NULL;
 flag nowarnflag        = NO;
 flag ftn66flag = NO;
+#ifdef ONLY66
 flag no66flag  = NO;
 flag noextflag = NO;
 flag no66flag  = NO;
 flag noextflag = NO;
+#endif
+flag dblflag   = NO;
 flag profileflag       = NO;
 flag optimflag = NO;
 flag shiftcase = YES;
 flag profileflag       = NO;
 flag optimflag = NO;
 flag shiftcase = YES;
@@ -112,6 +149,8 @@ struct Chain *curdtp        = NULL;
 flag toomanyinit;
 ftnint curdtelt;
 chainp templist        = NULL;
 flag toomanyinit;
 ftnint curdtelt;
 chainp templist        = NULL;
+chainp argtemplist = CHNULL;
+chainp activearglist = CHNULL;
 chainp holdtemps       = NULL;
 int dorange    = 0;
 struct Entrypoint *entries     = NULL;
 chainp holdtemps       = NULL;
 int dorange    = 0;
 struct Entrypoint *entries     = NULL;
@@ -166,7 +205,7 @@ if (cdatafile < 0)
   fatalstr("cannot open tmp file %s", cdatafname);
 
 cchkfile = open(cchkfname, O_CREAT | O_RDWR, 0600);
   fatalstr("cannot open tmp file %s", cdatafname);
 
 cchkfile = open(cchkfname, O_CREAT | O_RDWR, 0600);
-if (cdatafile < 0)
+if (cchkfile < 0)
   fatalstr("cannot open tmp file %s", cchkfname);
 
 pruse(initfile, USEINIT);
   fatalstr("cannot open tmp file %s", cchkfname);
 
 pruse(initfile, USEINIT);
@@ -279,6 +318,9 @@ ctlstack = ctls - 1;
 for(cp = templist ; cp ; cp = cp->nextp)
        free( (charptr) (cp->datap) );
 frchain(&templist);
 for(cp = templist ; cp ; cp = cp->nextp)
        free( (charptr) (cp->datap) );
 frchain(&templist);
+for (cp = argtemplist; cp; cp = cp->nextp)
+  free((char *) (cp->datap));
+frchain(&argtemplist);
 holdtemps = NULL;
 dorange = 0;
 nregvar = 0;
 holdtemps = NULL;
 dorange = 0;
 nregvar = 0;
@@ -298,7 +340,7 @@ if(undeftype)
        setimpl(TYUNKNOWN, (ftnint) 0, 'a', 'z');
 else
        {
        setimpl(TYUNKNOWN, (ftnint) 0, 'a', 'z');
 else
        {
-       setimpl(TYREAL, (ftnint) 0, 'a', 'z');
+       setimpl(dblflag ? TYDREAL : TYREAL, (ftnint) 0, 'a', 'z');
        setimpl(tyint,  (ftnint) 0, 'i', 'n');
        }
 setimpl(-STGBSS, (ftnint) 0, 'a', 'z');        /* set class */
        setimpl(tyint,  (ftnint) 0, 'i', 'n');
        }
 setimpl(-STGBSS, (ftnint) 0, 'a', 'z');        /* set class */