*** /old/src/lib/cpp/cpp.c	Mon Dec 26 14:18:12 1988
--- /usr/src/lib/cpp/cpp.c	Tue Aug 13 07:31:47 1991
***************
*** 1,6 ****
! #ifndef lint
! static char sccsid[] = "@(#)cpp.c	1.8 5/16/84";
! #endif lint
  
  #ifdef FLEXNAMES
  #define	NCPS	128
--- 1,4 ----
! /* static char sccsid[] = "@(#)cpp.c	1.8 5/16/84"; */
  
  #ifdef FLEXNAMES
  #define	NCPS	128
***************
*** 112,118 ****
  char buffer[NCPS+BUFSIZ+BUFSIZ+NCPS];
  
  #ifdef pdp11
! # define SBSIZE ((unsigned)0112160)	/* PDP compiler doesn't like 41000 */
  short	sbff[SBSIZE/2];
  # define sbf ((char *)sbff)
  #else !pdp11
--- 110,116 ----
  char buffer[NCPS+BUFSIZ+BUFSIZ+NCPS];
  
  #ifdef pdp11
! # define SBSIZE ((unsigned)0114130)	/* PDP compiler doesn't like 39024 */
  short	sbff[SBSIZE/2];
  # define sbf ((char *)sbff)
  #else !pdp11
***************
*** 639,644 ****
--- 637,644 ----
  	char *oldval,*oldsavch;
  	char *formal[MAXFRM]; /* formal[n] is name of nth formal */
  	char formtxt[BUFSIZ]; /* space for formal names */
+ 	int spasscom = passcom;
+ 	passcom = 0;		/* strip comments from defines to save space */
  
  	if (savch>sbf+SBSIZE-BUFSIZ) {pperror("too much defining"); return(p);}
  	oldsavch=savch; /* to reclaim space if redefinition */
***************
*** 719,725 ****
  			np->value=psav-1;
  		} else psav=oldsavch; /* identical redef.; reclaim space */
  	} else np->value=psav-1;
! 	--flslvl; inp=pin; savch=psav; return(p);
  }
  
  #define fasscan() ptrtab=fastab+COFF
--- 719,725 ----
  			np->value=psav-1;
  		} else psav=oldsavch; /* identical redef.; reclaim space */
  	} else np->value=psav-1;
! 	--flslvl; inp=pin; savch=psav; passcom = spasscom; return(p);
  }
  
  #define fasscan() ptrtab=fastab+COFF
***************
*** 1013,1019 ****
  {
  	register int i,c;
  	register char *p;
! 	char *tf,**cp2;
  
  # if gcos
  	if (setjmp(env)) return (exfail);
--- 1013,1019 ----
  {
  	register int i,c;
  	register char *p;
! 	char *tf,**cp2, obuf[BUFSIZ];
  
  # if gcos
  	if (setjmp(env)) return (exfail);
***************
*** 1147,1157 ****
--- 1147,1159 ----
  		if (tf!=(char *)0)
  			infile = tf + 1;
  		mout=fout;
+ 		setbuf(mout, (char *)NULL);
  		if (NULL==(fout=fopen("/dev/null", "w"))) {
  			pperror("Can't open /dev/null");
  			exit(8);
  		}
  	}
+ 	setbuf(fout, obuf);
  	fins[ifno]=fin;
  	exfail = 0;
  		/* after user -I files here are the standard include libraries */
*** /old/src/lib/cpp/yylex.c	Mon Oct 20 22:23:52 1986
--- /usr/src/lib/cpp/yylex.c	Wed Aug  7 05:13:34 1991
***************
*** 1,6 ****
! #ifndef lint
! static char sccsid[] = "@(#)yylex.c	1.3 7/1/83";
! #endif lint
  
  #define isid(a)  ((fastab+COFF)[a]&IB)
  #define IB 1
--- 1,4 ----
! /* static char sccsid[] = "@(#)yylex.c	1.3 7/1/83"; */
  
  #define isid(a)  ((fastab+COFF)[a]&IB)
  #define IB 1
*** /old/src/lib/libc/pdp/csu/Makefile	Fri Aug  3 09:13:37 1990
--- /usr/src/lib/libc/pdp/csu/Makefile	Mon Mar 30 14:26:14 1992
***************
*** 13,18 ****
--- 13,19 ----
  SRCS=	crt0.s mon.c mcount.s gmon.c
  #OBJS=	crt0.o mcrt0.o gcrt0.o mon.o gmon.o
  OBJS=	crt0.o mcrt0.o mon.o
+ CFLAGS=	-O ${DEFS}
  TAGSFILE=tags
  
  all: ${OBJS}
***************
*** 41,47 ****
  	ld -x -r -o mcrt0.o moncrt0.o mon.o
  
  mon.o: mon.c mcount.s mon.ex
! 	cc -S ${DEFS} ${DFLAGS} mon.c
  	ex - mon.s < mon.ex
  	cat mon.s mcount.s > x.s
  	/lib/cpp ${DEFS} ${DFLAGS} x.s | sed 's;^#;/;' > xx.s
--- 42,48 ----
  	ld -x -r -o mcrt0.o moncrt0.o mon.o
  
  mon.o: mon.c mcount.s mon.ex
! 	cc ${CFLAGS} -S ${DFLAGS} mon.c
  	ex - mon.s < mon.ex
  	cat mon.s mcount.s > x.s
  	/lib/cpp ${DEFS} ${DFLAGS} x.s | sed 's;^#;/;' > xx.s
***************
*** 50,56 ****
  	rm -f x.o x.s xx.s mon.s
  
  gmon.o: gmon.c gmon.h gmon.ex
! 	cc -S ${DEFS} ${DFLAGS} gmon.c
  	ex - gmon.s < gmon.ex
  	as -o x.o gmon.s
  	ld -x -r -o gmon.o x.o
--- 51,57 ----
  	rm -f x.o x.s xx.s mon.s
  
  gmon.o: gmon.c gmon.h gmon.ex
! 	cc ${CFLAGS} -S ${DFLAGS} gmon.c
  	ex - gmon.s < gmon.ex
  	as -o x.o gmon.s
  	ld -x -r -o gmon.o x.o
*** /old/src/lib/libc/pdp/csu/mon.c	Thu May  7 16:56:56 1987
--- /usr/src/lib/libc/pdp/csu/mon.c	Mon Mar 30 14:26:18 1992
***************
*** 5,11 ****
   */
  
  #if defined(LIBC_SCCS) && !defined(lint)
! static char sccsid[] = "@(#)mon.c	5.4 (Berkeley) 5/3/87";
  #endif LIBC_SCCS and not lint
  
  #define ARCDENSITY	1	/* density of routines per 100 bytes */
--- 5,11 ----
   */
  
  #if defined(LIBC_SCCS) && !defined(lint)
! static char sccsid[] = "@(#)mon.c	5.5 (GTE) 3/23/92";
  #endif LIBC_SCCS and not lint
  
  #define ARCDENSITY	1	/* density of routines per 100 bytes */
***************
*** 38,52 ****
  	char *lowpc;
  	char *highpc;
  {
! 	int cntsize, monsize;
  	char *buffer;
  	extern char *sbrk();
  	extern char *minbrk;
  
! 	cntsize = (highpc - lowpc) * ARCDENSITY / 100;
  	if (cntsize < MINARCS)
  		cntsize = MINARCS;
! 	monsize = (highpc - lowpc + HISTFRACTION - 1) / HISTFRACTION
  		+ sizeof(struct phdr) + cntsize * sizeof(struct cnt);
  	monsize = (monsize + 1) & ~1;
  	buffer = sbrk(monsize);
--- 38,52 ----
  	char *lowpc;
  	char *highpc;
  {
! 	unsigned int cntsize, monsize;
  	char *buffer;
  	extern char *sbrk();
  	extern char *minbrk;
  
! 	cntsize = (unsigned)(highpc - lowpc) * ARCDENSITY / 100;
  	if (cntsize < MINARCS)
  		cntsize = MINARCS;
! 	monsize = (unsigned)(highpc - lowpc + HISTFRACTION - 1) / HISTFRACTION
  		+ sizeof(struct phdr) + cntsize * sizeof(struct cnt);
  	monsize = (monsize + 1) & ~1;
  	buffer = sbrk(monsize);
*** /old/src/lib/libc/pdp/stdio/doprnt.s	Thu Dec 31 16:10:52 1987
--- /usr/src/lib/libc/pdp/stdio/doprnt.s	Tue Aug 25 19:42:46 1992
***************
*** 5,11 ****
   */
  
  #ifdef LIBC_SCCS
! 	<@(#)doprnt.s	5.4 (Berkeley) 1/25/87\0>
  	.even
  #endif LIBC_SCCS
  
--- 5,12 ----
   */
  
  #ifdef LIBC_SCCS
! /*	<@(#)doprnt.s	5.4 (Berkeley) 1/25/87\0> */
! 	<@(#)doprnt.s	5.5 (GTE) 8/25/92\0>
  	.even
  #endif LIBC_SCCS
  
***************
*** 34,40 ****
  	longorunsg;	'l
  	longorunsg;	'L
  	unsigned;	'u
- 	remote;		'r
  	long;		'D
  	loct;		'O
  	lhex;		'X
--- 35,40 ----
***************
*** 244,251 ****
  charac:
  	mov	$' ,zfill(r5)
  	mov	(r4)+,r0
- 	bic	$!377,r0
- 	beq	prbuf
  	movb	r0,(r3)+
  	br	prbuf
  
--- 244,249 ----
***************
*** 282,293 ****
  1:
  	mov	pc,r2
  	jsr	pc,pscien
- 	br	prbuf
- 
- remote:
- 	mov	(r4)+,r4
- 	mov	(r4)+,formp(r5)
- 	jmp	loop
  
  prbuf:
  	mov	sp,r2
--- 280,285 ----
*** /old/src/lib/mip/allo.c	Sat Jan 11 11:46:12 1986
--- /usr/src/lib/mip/allo.c	Sat Aug 17 13:33:22 1991
***************
*** 1,4 ****
! #ifndef lint
  static char *sccsid ="@(#)allo.c	4.8 (Berkeley) 1/8/86";
  #endif lint
  
--- 1,4 ----
! #if	!defined(lint) && defined(DOSCCS)
  static char *sccsid ="@(#)allo.c	4.8 (Berkeley) 1/8/86";
  #endif lint
  
***************
*** 34,40 ****
  
  # ifndef ALLO
  allo( p, q ) NODE *p; struct optab *q; {
! 
  	register n, i, j;
  	int either;
  
--- 34,40 ----
  
  # ifndef ALLO
  allo( p, q ) NODE *p; struct optab *q; {
! 	OFFSZ freetemp();
  	register n, i, j;
  	int either;
  
***************
*** 117,129 ****
  	}
  # endif
  
! extern unsigned int offsz;
  freetemp( k ){ /* allocate k integers worth of temp space */
  	/* we also make the convention that, if the number of words is more than 1,
  	/* it must be aligned for storing doubles... */
  
  # ifndef BACKTEMP
! 	int t;
  
  	if( k>1 ){
  		SETOFF( tmpoff, ALDOUBLE );
--- 117,131 ----
  	}
  # endif
  
! extern OFFSZ offsz;
! 
! OFFSZ
  freetemp( k ){ /* allocate k integers worth of temp space */
  	/* we also make the convention that, if the number of words is more than 1,
  	/* it must be aligned for storing doubles... */
  
  # ifndef BACKTEMP
! 	OFFSZ t;
  
  	if( k>1 ){
  		SETOFF( tmpoff, ALDOUBLE );
***************
*** 424,430 ****
  
  	qq = recres;
  
! 	if( rw&RLEFT) *qq++ = getlr( p, 'L' );;
  	if( rw&RRIGHT ) *qq++ = getlr( p, 'R' );
  	if( rw&RESC1 ) *qq++ = &resc[0];
  	if( rw&RESC2 ) *qq++ = &resc[1];
--- 426,432 ----
  
  	qq = recres;
  
! 	if( rw&RLEFT) *qq++ = getlr( p, 'L' );
  	if( rw&RRIGHT ) *qq++ = getlr( p, 'R' );
  	if( rw&RESC1 ) *qq++ = &resc[0];
  	if( rw&RESC2 ) *qq++ = &resc[1];
*** /old/src/lib/mip/cgram.y	Sun Aug 25 13:55:53 1985
--- /usr/src/lib/mip/cgram.y	Sat Aug 17 13:38:53 1991
***************
*** 380,386 ****
  			    if( blevel == 1 ) blevel = 0;
  			    clearst( blevel );
  			    checkst( blevel );
! 			    autooff = *--psavbc;
  			    regvar = *--psavbc;
  			    }
  		;
--- 380,386 ----
  			    if( blevel == 1 ) blevel = 0;
  			    clearst( blevel );
  			    checkst( blevel );
! 			    autooff = (unsigned)*--psavbc;
  			    regvar = *--psavbc;
  			    }
  		;
***************
*** 390,396 ****
  			    if( blevel == 1 ) blevel = 0;
  			    clearst( blevel );
  			    checkst( blevel );
! 			    autooff = *--psavbc;
  			    regvar = *--psavbc;
  			    }
  		;
--- 390,396 ----
  			    if( blevel == 1 ) blevel = 0;
  			    clearst( blevel );
  			    checkst( blevel );
! 			    autooff = (unsigned)*--psavbc;
  			    regvar = *--psavbc;
  			    }
  		;
***************
*** 819,825 ****
  	return( q );
  	}
  
! dstash( n ){ /* put n into the dimension table */
  	if( curdim >= DIMTABSZ-1 ){
  		cerror( "dimension table overflow");
  		}
--- 819,825 ----
  	return( q );
  	}
  
! dstash( n ) OFFSZ n;{ /* put n into the dimension table */
  	if( curdim >= DIMTABSZ-1 ){
  		cerror( "dimension table overflow");
  		}
*** /old/src/lib/mip/common.c	Sun Aug 25 13:55:53 1985
--- /usr/src/lib/mip/common.c	Sat Aug  3 12:07:11 1991
***************
*** 20,31 ****
  
  int nerrors = 0;  /* number of errors */
  
! extern unsigned int offsz;
  
! unsigned caloff(){
  	register i;
! 	unsigned int temp;
! 	unsigned int off;
  	temp = 1;
  	i = 0;
  	do {
--- 20,40 ----
  
  int nerrors = 0;  /* number of errors */
  
! extern OFFSZ offsz;
  
! /* 
!  * this strangeness is due to offsets being measured in terms of bits
!  * rather than bytes.  normally "i=16" and "off=0100000" are returned,
!  * but this is not enough to measure structures/arrays greater than
!  * 32k bits (4kb).  We return
!  * the return value from this is multiplied by 8 (# bits/byte).
! */
! 
! OFFSZ caloff(){
  	register i;
! 	OFFSZ temp;
! 	OFFSZ off;
! #ifndef	pdp11
  	temp = 1;
  	i = 0;
  	do {
***************
*** 33,38 ****
--- 42,50 ----
  		++i;
  		} while( temp != 0 );
  	off = 1 << (i-1);
+ #else
+ 	off = 02000000L;		/* enough for 64kb */
+ #endif
  	return (off);
  	}
  
***************
*** 56,69 ****
  	/* VARARGS1 */
  cerror( s, a, b, c ) char *s; { /* compiler error: die */
  	where('c');
! 	if( nerrors && nerrors <= 30 ){ /* give the compiler the benefit of the doubt */
  		fprintf( stderr, "cannot recover from earlier errors: goodbye!\n" );
- 		}
- 	else {
- 		fprintf( stderr, "compiler error: " );
- 		fprintf( stderr, s, a, b, c );
- 		fprintf( stderr, "\n" );
- 		}
  #ifdef BUFSTDERR
  	fflush(stderr);
  #endif
--- 68,78 ----
  	/* VARARGS1 */
  cerror( s, a, b, c ) char *s; { /* compiler error: die */
  	where('c');
! 	fprintf( stderr, "compiler error: " );
! 	fprintf( stderr, s, a, b, c );
! 	fprintf( stderr, "\n" );
! 	if( nerrors && nerrors <= 30 ) /* give the compiler the benefit of the doubt */
  		fprintf( stderr, "cannot recover from earlier errors: goodbye!\n" );
  #ifdef BUFSTDERR
  	fflush(stderr);
  #endif
***************
*** 213,219 ****
  int dope[ DSIZE ];
  char *opst[DSIZE];
  
! struct dopest { int dopeop; char opst[8]; int dopeval; } indope[] = {
  
  	NAME, "NAME", LTYPE,
  	STRING, "STRING", LTYPE,
--- 222,228 ----
  int dope[ DSIZE ];
  char *opst[DSIZE];
  
! struct dopest { int dopeop; char *opst; int dopeval; } indope[] = {
  
  	NAME, "NAME", LTYPE,
  	STRING, "STRING", LTYPE,
***************
*** 341,348 ****
  # endif
  
  #ifdef FLEXNAMES
! #define	NTSTRBUF	40
! #define	TSTRSZ		2048
  char	itstrbuf[TSTRSZ];
  char	*tstrbuf[NTSTRBUF] = { itstrbuf };
  char	**curtstr = tstrbuf;
--- 350,357 ----
  # endif
  
  #ifdef FLEXNAMES
! #define	NTSTRBUF	25		/* was 40 */
! #define	TSTRSZ		512		/* was 2048 */
  char	itstrbuf[TSTRSZ];
  char	*tstrbuf[NTSTRBUF] = { itstrbuf };
  char	**curtstr = tstrbuf;
*** /old/src/lib/mip/config.h	Sun Aug 25 13:55:53 1985
--- /usr/src/lib/mip/config.h	Thu Aug 15 16:29:25 1991
***************
*** 20,31 ****
  /*
   * Table sizes.
   */
  #define TREESZ		1000		/* parse tree table size */
  #define BCSZ		100		/* break/continue table size */
! #define SYMTSZ		3000		/* symbol table size */
! #define DIMTABSZ 	4200		/* dimension/size table size */
! #define PARAMSZ		300		/* parameter stack size */
! #define SWITSZ		500		/* switch table size */
  #define	DELAYS		20		/* delayed evaluation table size */
  #define NRECUR		(10*TREESZ)	/* maximum eval recursion depth */
  #define	MAXSCOPES	(SYMTSZ/30)	/* maximum active scopes */
--- 20,35 ----
  /*
   * Table sizes.
   */
+ #ifndef	FORT
+ #define	TREESZ		300
+ #else
  #define TREESZ		1000		/* parse tree table size */
+ #endif
  #define BCSZ		100		/* break/continue table size */
! #define SYMTSZ		800		/* symbol table size */
! #define DIMTABSZ 	990		/* dimension/size table size */
! #define PARAMSZ		130		/* parameter stack size */
! #define SWITSZ		210		/* switch table size */
  #define	DELAYS		20		/* delayed evaluation table size */
  #define NRECUR		(10*TREESZ)	/* maximum eval recursion depth */
  #define	MAXSCOPES	(SYMTSZ/30)	/* maximum active scopes */
*** /old/src/lib/mip/fort.c	Sun Aug 25 13:55:53 1985
--- /usr/src/lib/mip/fort.c	Sat Aug 17 13:43:19 1991
***************
*** 1,4 ****
! #ifndef lint
  static char *sccsid ="@(#)fort.c	4.7 (Berkeley) 8/22/85";
  #endif lint
  
--- 1,4 ----
! #if	!defined(lint) && defined(DOSCCS)
  static char *sccsid ="@(#)fort.c	4.7 (Berkeley) 8/22/85";
  #endif lint
  
***************
*** 91,99 ****
  # ifndef NOLCCOPY
  lccopy( n ) register n; {
  	register i;
! 	static char fbuf[BUFSIZ];
  	if( n > 0 ){
! 		if( n > BUFSIZ/4 ) cerror( "lccopy asked to copy too much" );
  		if( fread( fbuf, 4, n, lrd ) != n ) cerror( "intermediate file read error" );
  		for( i=4*n; fbuf[i-1] == '\0' && i>0; --i ) { /* VOID */ }
  		if( i ) {
--- 91,99 ----
  # ifndef NOLCCOPY
  lccopy( n ) register n; {
  	register i;
! 	static char fbuf[128];
  	if( n > 0 ){
! 		if( n > sizeof(fbuf)/4 ) cerror( "lccopy asked to copy too much" );
  		if( fread( fbuf, 4, n, lrd ) != n ) cerror( "intermediate file read error" );
  		for( i=4*n; fbuf[i-1] == '\0' && i>0; --i ) { /* VOID */ }
  		if( i ) {
***************
*** 110,117 ****
  NODE * fstack[NSTACKSZ];
  NODE ** fsp;  /* points to next free position on the stack */
  
! unsigned int offsz;
! unsigned int caloff();
  mainp2( argc, argv ) char *argv[]; {
  	int files;
  	register long x;
--- 110,117 ----
  NODE * fstack[NSTACKSZ];
  NODE ** fsp;  /* points to next free position on the stack */
  
! OFFSZ offsz;
! OFFSZ caloff();
  mainp2( argc, argv ) char *argv[]; {
  	int files;
  	register long x;
*** /old/src/lib/mip/match.c	Sun Aug 25 13:55:53 1985
--- /usr/src/lib/mip/match.c	Sat Aug 17 13:44:24 1991
***************
*** 1,4 ****
! #ifndef lint
  static char *sccsid ="@(#)match.c	4.4 (Berkeley) 8/22/85";
  #endif lint
  
--- 1,4 ----
! #if	!defined(lint) && defined(DOSCCS)
  static char *sccsid ="@(#)match.c	4.4 (Berkeley) 8/22/85";
  #endif lint
  
*** /old/src/lib/mip/optim.c	Sat Jan 11 11:46:13 1986
--- /usr/src/lib/mip/optim.c	Sat Aug 17 13:45:26 1991
***************
*** 1,4 ****
! #ifndef lint
  static char *sccsid ="@(#)optim.c	4.7 (Berkeley) 1/8/86";
  #endif lint
  
--- 1,4 ----
! #if	!defined(lint) && defined(DOSCCS)
  static char *sccsid ="@(#)optim.c	4.7 (Berkeley) 1/8/86";
  #endif lint
  
*** /old/src/lib/mip/pass1.h	Sun Aug 25 13:55:54 1985
--- /usr/src/lib/mip/pass1.h	Sun Jul 28 14:31:03 1991
***************
*** 24,30 ****
  	char	sclass;		/* storage class */
  	char	slevel;		/* scope level */
  	char	sflags;		/* flags, see below */
! 	int	offset;		/* offset or value */
  	short	dimoff;		/* offset into the dimension table */
  	short	sizoff;		/* offset into the size table */
  	int	suse;		/* line number of last use of the variable */
--- 24,30 ----
  	char	sclass;		/* storage class */
  	char	slevel;		/* scope level */
  	char	sflags;		/* flags, see below */
! 	OFFSZ	offset;		/* offset or value */
  	short	dimoff;		/* offset into the dimension table */
  	short	sizoff;		/* offset into the size table */
  	int	suse;		/* line number of last use of the variable */
***************
*** 124,138 ****
  extern	double dcon;
  
  extern	char ftitle[];
  extern	char ititle[];
  extern	struct symtab stab[];
  extern	int curftn;
  extern	int curclass;
  extern	int curdim;
! extern	int dimtab[];
! extern	int paramstk[];
  extern	int paramno;
! extern	int autooff, argoff, strucoff;
  extern	int regvar;
  extern	int minrvar;
  extern	int brkflag;
--- 124,140 ----
  extern	double dcon;
  
  extern	char ftitle[];
+ #ifndef	LINT
  extern	char ititle[];
+ #endif
  extern	struct symtab stab[];
  extern	int curftn;
  extern	int curclass;
  extern	int curdim;
! extern	OFFSZ dimtab[];
! extern	OFFSZ paramstk[];
  extern	int paramno;
! extern	OFFSZ autooff, argoff, strucoff;
  extern	int regvar;
  extern	int minrvar;
  extern	int brkflag;
*** /old/src/lib/mip/pass2.h	Tue Apr  2 11:56:28 1985
--- /usr/src/lib/mip/pass2.h	Sat Jul 20 14:59:39 1991
***************
*** 197,206 ****
  #endif
  
  /* macros for doing double indexing */
! #define R2PACK(x,y,z)	(0200*((x)+1)+y+040000*z)	/* pack 3 regs */
  #define R2UPK1(x)	((((x)>>7)-1)&0177)		/* unpack reg 1 */
  #define R2UPK2(x)	((x)&0177)			/* unpack reg 2 */
- #define R2UPK3(x)	(x>>14)				/* unpack reg 3 */
  #define R2TEST(x)	((x)>=0200)			/* test if packed */
  
  #ifdef MULTILEVEL
--- 197,205 ----
  #endif
  
  /* macros for doing double indexing */
! #define R2PACK(x,y)	(0200*((x)+1)+y)		/* pack 2 regs */
  #define R2UPK1(x)	((((x)>>7)-1)&0177)		/* unpack reg 1 */
  #define R2UPK2(x)	((x)&0177)			/* unpack reg 2 */
  #define R2TEST(x)	((x)>=0200)			/* test if packed */
  
  #ifdef MULTILEVEL
*** /old/src/lib/mip/pftn.c	Tue Nov 24 09:57:17 1987
--- /usr/src/lib/mip/pftn.c	Sat Aug 17 13:58:56 1991
***************
*** 1,16 ****
! #ifndef lint
  static char *sccsid ="@(#)pftn.c	1.12 (Berkeley) 4/21/86";
  #endif lint
  
  # include "pass1.h"
  
! unsigned int offsz;
  
  struct symtab *schain[MAXSCOPES];	/* sym chains for clearst */
  int chaintop;				/* highest active entry */
  
  struct instk {
! 	int in_sz;   /* size of array element */
  	int in_x;    /* current index for structure member in structure initializations */
  	int in_n;    /* number of initializations seen */
  	int in_s;    /* sizoff */
--- 1,16 ----
! #if	!defined(lint) && defined(DOSCCS)
  static char *sccsid ="@(#)pftn.c	1.12 (Berkeley) 4/21/86";
  #endif lint
  
  # include "pass1.h"
  
! OFFSZ offsz;
  
  struct symtab *schain[MAXSCOPES];	/* sym chains for clearst */
  int chaintop;				/* highest active entry */
  
  struct instk {
! 	OFFSZ in_sz; /* size of array element */
  	int in_x;    /* current index for structure member in structure initializations */
  	int in_n;    /* number of initializations seen */
  	int in_s;    /* sizoff */
***************
*** 147,153 ****
  		/* redefinition */
  		if( !falloc( p, class&FLDSIZ, 1, NIL ) ) {
  			/* successful allocation */
! 			psave( idp );
  			return;
  			}
  		/* blew it: resume at end of switch... */
--- 147,153 ----
  		/* redefinition */
  		if( !falloc( p, class&FLDSIZ, 1, NIL ) ) {
  			/* successful allocation */
! 			psave( (OFFSZ)idp );
  			return;
  			}
  		/* blew it: resume at end of switch... */
***************
*** 184,190 ****
  	case LABEL:
  		if( scl == ULABEL ){
  			p->sclass = LABEL;
! 			deflab( p->offset );
  			return;
  			}
  		break;
--- 184,190 ----
  	case LABEL:
  		if( scl == ULABEL ){
  			p->sclass = LABEL;
! 			deflab( (int)p->offset );
  			return;
  			}
  		break;
***************
*** 210,216 ****
  		if( scl == class ) {
  			if( oalloc( p, &strucoff ) ) break;
  			if( class == MOU ) strucoff = 0;
! 			psave( idp );
  			return;
  			}
  		break;
--- 210,216 ----
  		if( scl == class ) {
  			if( oalloc( p, &strucoff ) ) break;
  			if( class == MOU ) strucoff = 0;
! 			psave( (OFFSZ)idp );
  			return;
  			}
  		break;
***************
*** 218,224 ****
  	case MOE:
  		if( scl == class ){
  			if( p->offset!= strucoff++ ) break;
! 			psave( idp );
  			}
  		break;
  
--- 218,224 ----
  	case MOE:
  		if( scl == class ){
  			if( p->offset!= strucoff++ ) break;
! 			psave( (OFFSZ)idp );
  			}
  		break;
  
***************
*** 250,256 ****
  	/* allow nonunique structure/union member names */
  
  	if( class==MOU || class==MOS || class & FIELD ){/* make a new entry */
! 		register int *memp;
  		p->sflags |= SNONUNIQ;  /* old entry is nonunique */
  		/* determine if name has occurred in this structure/union */
  		if (paramno > 0) for( memp = &paramstk[paramno-1];
--- 250,256 ----
  	/* allow nonunique structure/union member names */
  
  	if( class==MOU || class==MOS || class & FIELD ){/* make a new entry */
! 		register OFFSZ *memp;
  		p->sflags |= SNONUNIQ;  /* old entry is nonunique */
  		/* determine if name has occurred in this structure/union */
  		if (paramno > 0) for( memp = &paramstk[paramno-1];
***************
*** 303,312 ****
  	p->suse = lineno;
  	if( class == STNAME || class == UNAME || class == ENAME ) {
  		p->sizoff = curdim;
! 		dstash( 0 );  /* size */
! 		dstash( -1 ); /* index to members of str or union */
! 		dstash( ALSTRUCT );  /* alignment */
! 		dstash( idp );
  		}
  	else {
  		switch( BTYPE(type) ){
--- 303,312 ----
  	p->suse = lineno;
  	if( class == STNAME || class == UNAME || class == ENAME ) {
  		p->sizoff = curdim;
! 		dstash( (OFFSZ)0 );  /* size */
! 		dstash( (OFFSZ)-1 ); /* index to members of str or union */
! 		dstash( (OFFSZ)ALSTRUCT );  /* alignment */
! 		dstash( (OFFSZ)idp );
  		}
  	else {
  		switch( BTYPE(type) ){
***************
*** 327,333 ****
  	/* allocate offsets */
  	if( class&FIELD ){
  		falloc( p, class&FLDSIZ, 0, NIL );  /* new entry */
! 		psave( idp );
  		}
  	else switch( class ){
  
--- 327,333 ----
  	/* allocate offsets */
  	if( class&FIELD ){
  		falloc( p, class&FLDSIZ, 0, NIL );  /* new entry */
! 		psave( (OFFSZ)idp );
  		}
  	else switch( class ){
  
***************
*** 345,351 ****
  		p->slevel = 2;
  		if( class == LABEL ){
  			locctr( PROG );
! 			deflab( p->offset );
  			}
  		break;
  
--- 345,351 ----
  		p->slevel = 2;
  		if( class == LABEL ){
  			locctr( PROG );
! 			deflab( (int)p->offset );
  			}
  		break;
  
***************
*** 359,370 ****
  	case MOS:
  		oalloc( p, &strucoff );
  		if( class == MOU ) strucoff = 0;
! 		psave( idp );
  		break;
  
  	case MOE:
  		p->offset = strucoff++;
! 		psave( idp );
  		break;
  	case REGISTER:
  		p->offset = regvar--;
--- 359,370 ----
  	case MOS:
  		oalloc( p, &strucoff );
  		if( class == MOU ) strucoff = 0;
! 		psave( (OFFSZ)idp );
  		break;
  
  	case MOE:
  		p->offset = strucoff++;
! 		psave( (OFFSZ)idp );
  		break;
  	case REGISTER:
  		p->offset = regvar--;
***************
*** 395,401 ****
  
  	}
  
! psave( i ){
  	if( paramno >= PARAMSZ ){
  		cerror( "parameter stack overflow");
  		}
--- 395,401 ----
  
  	}
  
! psave( i ) OFFSZ i;{
  	if( paramno >= PARAMSZ ){
  		cerror( "parameter stack overflow");
  		}
***************
*** 428,434 ****
  	}
  
  dclargs(){
! 	register i, j;
  	register struct symtab *p;
  	register NODE *q;
  	argoff = ARGINIT;
--- 428,435 ----
  	}
  
  dclargs(){
! 	register i;
! 	OFFSZ	j;
  	register struct symtab *p;
  	register NODE *q;
  	argoff = ARGINIT;
***************
*** 447,453 ****
  # endif
  		if( p->stype == FARG ) {
  			q = block(FREE,NIL,NIL,INT,0,INT);
! 			q->tn.rval = j;
  			defid( q, PARAM );
  			}
  		FIXARG(p); /* local arg hook, eg. for sym. debugger */
--- 448,454 ----
  # endif
  		if( p->stype == FARG ) {
  			q = block(FREE,NIL,NIL,INT,0,INT);
! 			q->tn.rval = (int)j;
  			defid( q, PARAM );
  			}
  		FIXARG(p); /* local arg hook, eg. for sym. debugger */
***************
*** 504,511 ****
  bstruct( idn, soru ){ /* begining of structure or union declaration */
  	register NODE *q;
  
! 	psave( instruct );
! 	psave( curclass );
  	psave( strucoff );
  	strucoff = 0;
  	instruct = soru;
--- 505,512 ----
  bstruct( idn, soru ){ /* begining of structure or union declaration */
  	register NODE *q;
  
! 	psave( (OFFSZ)instruct );
! 	psave( (OFFSZ)curclass );
  	psave( strucoff );
  	strucoff = 0;
  	instruct = soru;
***************
*** 526,532 ****
  		q->in.type = ENUMTY;
  		if( idn >= 0 ) defid( q, ENAME );
  		}
! 	psave( idn = q->tn.rval );
  	/* the "real" definition is where the members are seen */
  	if ( idn >= 0 ) stab[idn].suse = lineno;
  	return( paramno-4 );
--- 527,533 ----
  		q->in.type = ENUMTY;
  		if( idn >= 0 ) defid( q, ENAME );
  		}
! 	psave( (OFFSZ)(idn = q->tn.rval) );
  	/* the "real" definition is where the members are seen */
  	if ( idn >= 0 ) stab[idn].suse = lineno;
  	return( paramno-4 );
***************
*** 535,543 ****
  NODE *
  dclstruct( oparam ){
  	register struct symtab *p;
! 	register i, al, sa, j, sz, szindex;
  	register TWORD temp;
! 	register high, low;
  
  	/* paramstack contains:
  		paramstack[ oparam ] = previous instruct
--- 536,546 ----
  NODE *
  dclstruct( oparam ){
  	register struct symtab *p;
! 	register sa, al;
! 	int szindex;
! 	OFFSZ sz, i, j;
  	register TWORD temp;
! 	OFFSZ high, low;
  
  	/* paramstack contains:
  		paramstack[ oparam ] = previous instruct
***************
*** 549,561 ****
  
  		*/
  
- 
  	if( (i=paramstk[oparam+3]) < 0 ){
  		szindex = curdim;
! 		dstash( 0 );  /* size */
! 		dstash( -1 );  /* index to member names */
! 		dstash( ALSTRUCT );  /* alignment */
! 		dstash( -lineno );	/* name of structure */
  		}
  	else {
  		szindex = stab[i].sizoff;
--- 552,563 ----
  
  		*/
  
  	if( (i=paramstk[oparam+3]) < 0 ){
  		szindex = curdim;
! 		dstash( (OFFSZ)0 );  /* size */
! 		dstash( (OFFSZ)-1 );  /* index to member names */
! 		dstash( (OFFSZ)ALSTRUCT );  /* alignment */
! 		dstash( (OFFSZ)-lineno );	/* name of structure */
  		}
  	else {
  		szindex = stab[i].sizoff;
***************
*** 606,612 ****
  		SETOFF( al, sa );
  		/* set al, the alignment, to the lcm of the alignments of the members */
  		}
! 	dstash( -1 );  /* endmarker */
  	SETOFF( strucoff, al );
  
  	if( temp == ENUMTY ){
--- 608,614 ----
  		SETOFF( al, sa );
  		/* set al, the alignment, to the lcm of the alignments of the members */
  		}
! 	dstash( (OFFSZ)-1 );  /* endmarker */
  	SETOFF( strucoff, al );
  
  	if( temp == ENUMTY ){
***************
*** 631,643 ****
  	FIXSTRUCT( szindex, oparam ); /* local hook, eg. for sym debugger */
  # ifndef BUG1
  	if( ddebug>1 ){
! 		printf( "\tdimtab[%d,%d,%d] = %d,%d,%d\n", szindex,szindex+1,szindex+2,
  				dimtab[szindex],dimtab[szindex+1],dimtab[szindex+2] );
! 		for( i = dimtab[szindex+1]; dimtab[i] >= 0; ++i ){
  #ifndef FLEXNAMES
! 			printf( "\tmember %.8s(%d)\n", stab[dimtab[i]].sname, dimtab[i] );
  #else
! 			printf( "\tmember %s(%d)\n", stab[dimtab[i]].sname, dimtab[i] );
  #endif
  			}
  		}
--- 633,645 ----
  	FIXSTRUCT( szindex, oparam ); /* local hook, eg. for sym debugger */
  # ifndef BUG1
  	if( ddebug>1 ){
! 		printf( "\tdimtab[%d,%d,%d] = %ld,%ld,%ld\n", szindex,szindex+1,szindex+2,
  				dimtab[szindex],dimtab[szindex+1],dimtab[szindex+2] );
! 		for( i = (int)dimtab[szindex+1]; dimtab[i] >= 0; ++i ){
  #ifndef FLEXNAMES
! 			printf( "\tmember %.8s(%ld)\n", stab[dimtab[i]].sname, dimtab[i] );
  #else
! 			printf( "\tmember %s(%ld)\n", stab[dimtab[i]].sname, dimtab[i] );
  #endif
  			}
  		}
***************
*** 686,692 ****
  		}
  	stab[idn].stype = FARG;
  	stab[idn].sclass = PARAM;
! 	psave( idn );
  	}
  
  talign( ty, s) register unsigned ty; register s; {
--- 688,694 ----
  		}
  	stab[idn].stype = FARG;
  	stab[idn].sclass = PARAM;
! 	psave( (OFFSZ)idn );
  	}
  
  talign( ty, s) register unsigned ty; register s; {
***************
*** 758,764 ****
  		case PTR:
  			return( SZPOINT * mult );
  		case ARY:
! 			mult *= (unsigned int) dimtab[ d++ ];
  			continue;
  		case 0:
  			break;
--- 760,766 ----
  		case PTR:
  			return( SZPOINT * mult );
  		case ARY:
! 			mult *= dimtab[ d++ ];
  			continue;
  		case 0:
  			break;
***************
*** 773,779 ****
  			uerror( "unknown size");
  		return( SZINT );
  		}
! 	return( (unsigned int) dimtab[ s ] * mult );
  	}
  
  inforce( n ) OFFSZ n; {  /* force inoff to have the value n */
--- 775,781 ----
  			uerror( "unknown size");
  		return( SZINT );
  		}
! 	return( dimtab[ s ] * mult );
  	}
  
  inforce( n ) OFFSZ n; {  /* force inoff to have the value n */
***************
*** 816,822 ****
  
  	}
  
! vfdalign( n ){ /* make inoff have the offset the next alignment of n */
  	OFFSZ m;
  
  	m = inoff;
--- 818,824 ----
  
  	}
  
! vfdalign( n ) OFFSZ n;{ /* make inoff have the offset the next alignment of n */
  	OFFSZ m;
  
  	m = inoff;
***************
*** 881,887 ****
  
  	for(;;){
  # ifndef BUG1
! 		if( idebug ) printf( "instk((%d, %o,%d,%d, %d)\n", id, t, d, s, off );
  # endif
  
  		/* save information on the stack */
--- 883,889 ----
  
  	for(;;){
  # ifndef BUG1
! 		if( idebug ) printf( "instk((%d, %o,%d,%d, %ld)\n", id, t, d, s, off );
  # endif
  
  		/* save information on the stack */
***************
*** 925,931 ****
  				iclass = -1;
  				return;
  				}
! 			id = dimtab[pstk->in_x];
  			p = &stab[id];
  			if( p->sclass != MOS && !(p->sclass&FIELD) ) cerror( "insane structure member list" );
  			t = p->stype;
--- 927,933 ----
  				iclass = -1;
  				return;
  				}
! 			id = (int)dimtab[pstk->in_x];
  			p = &stab[id];
  			if( p->sclass != MOS && !(p->sclass&FIELD) ) cerror( "insane structure member list" );
  			t = p->stype;
***************
*** 952,958 ****
  		inforce( pstk->in_off );
  		/* if the array is inflexible (not top level), pass in the size and
  			be prepared to throw away unwanted initializers */
! 		lxstr((pstk-1)!=instack?dimtab[(pstk-1)->in_d]:0);  /* get the contents */
  		irbrace();  /* simulate } */
  		return( NIL );
  		}
--- 954,960 ----
  		inforce( pstk->in_off );
  		/* if the array is inflexible (not top level), pass in the size and
  			be prepared to throw away unwanted initializers */
! 		lxstr((pstk-1)!=instack?(int)dimtab[(pstk-1)->in_d]:0);  /* get the contents */
  		irbrace();  /* simulate } */
  		return( NIL );
  		}
***************
*** 959,965 ****
  	else { /* make a label, and get the contents and stash them away */
  		if( iclass != SNULL ){ /* initializing */
  			/* fill out previous word, to permit pointer */
! 			vfdalign( ALPOINT );
  			}
  		temp = locctr( blevel==0?ISTRNG:STRNG ); /* set up location counter */
  		deflab( l = getlab() );
--- 961,967 ----
  	else { /* make a label, and get the contents and stash them away */
  		if( iclass != SNULL ){ /* initializing */
  			/* fill out previous word, to permit pointer */
! 			vfdalign( (OFFSZ)ALPOINT );
  			}
  		temp = locctr( blevel==0?ISTRNG:STRNG ); /* set up location counter */
  		deflab( l = getlab() );
***************
*** 982,991 ****
  
  endinit(){
  	register TWORD t;
! 	register d, s, n, d1;
  
  # ifndef BUG1
! 	if( idebug ) printf( "endinit(), inoff = %d\n", inoff );
  # endif
  
  	switch( iclass ){
--- 984,994 ----
  
  endinit(){
  	register TWORD t;
! 	register d, n, d1;
! 	int s;
  
  # ifndef BUG1
! 	if( idebug ) printf( "endinit(), inoff = %ld\n", inoff );
  # endif
  
  	switch( iclass ){
***************
*** 1005,1011 ****
  	n = pstk->in_n;
  
  	if( ISARY(t) ){
! 		d1 = dimtab[d];
  
  		vfdalign( pstk->in_sz );  /* fill out part of the last element, if needed */
  		n = inoff/pstk->in_sz;  /* real number of initializers */
--- 1008,1014 ----
  	n = pstk->in_n;
  
  	if( ISARY(t) ){
! 		d1 = (int)dimtab[d];
  
  		vfdalign( pstk->in_sz );  /* fill out part of the last element, if needed */
  		n = inoff/pstk->in_sz;  /* real number of initializers */
***************
*** 1029,1035 ****
  	else inforce( tsize(t,d,s) );
  
  	paramno = 0;
! 	vfdalign( AL_INIT );
  	inoff = 0;
  	iclass = SNULL;
  
--- 1032,1038 ----
  	else inforce( tsize(t,d,s) );
  
  	paramno = 0;
! 	vfdalign( (OFFSZ)AL_INIT );
  	inoff = 0;
  	iclass = SNULL;
  
***************
*** 1041,1047 ****
  	/* inoff has the current offset (last bit written)
  		in the current word being generated */
  
! 	register sz, d, s;
  	register TWORD t;
  	int o;
  
--- 1044,1051 ----
  	/* inoff has the current offset (last bit written)
  		in the current word being generated */
  
! 	register d, s;
! 	OFFSZ sz;
  	register TWORD t;
  	int o;
  
***************
*** 1142,1148 ****
  
  		if( t == STRTY ){
  			ix = ++pstk->in_x;
! 			if( (id=dimtab[ix]) < 0 ) continue;
  
  			/* otherwise, put next element on the stack */
  
--- 1146,1152 ----
  
  		if( t == STRTY ){
  			ix = ++pstk->in_x;
! 			if( (id=(int)dimtab[ix]) < 0 ) continue;
  
  			/* otherwise, put next element on the stack */
  
***************
*** 1219,1230 ****
  
  	}
  
! upoff( size, alignment, poff ) register alignment, *poff; {
  	/* update the offset pointed to by poff; return the
  	/* offset of a value of size `size', alignment `alignment',
  	/* given that off is increasing */
  
! 	register off;
  
  	off = *poff;
  	SETOFF( off, alignment );
--- 1223,1235 ----
  
  	}
  
! OFFSZ
! upoff( size, alignment, poff ) OFFSZ size; register alignment; register OFFSZ *poff; {
  	/* update the offset pointed to by poff; return the
  	/* offset of a value of size `size', alignment `alignment',
  	/* given that off is increasing */
  
! 	OFFSZ off;
  
  	off = *poff;
  	SETOFF( off, alignment );
***************
*** 1236,1245 ****
  	return( off );
  	}
  
! oalloc( p, poff ) register struct symtab *p; register *poff; {
  	/* allocate p with offset *poff, and update *poff */
! 	register al, off, tsz;
! 	int noff;
  
  	al = talign( p->stype, p->sizoff );
  	noff = off = *poff;
--- 1241,1250 ----
  	return( off );
  	}
  
! oalloc( p, poff ) register struct symtab *p; register OFFSZ *poff; {
  	/* allocate p with offset *poff, and update *poff */
! 	OFFSZ al, off, tsz;
! 	OFFSZ noff;
  
  	al = talign( p->stype, p->sizoff );
  	noff = off = *poff;
***************
*** 1254,1260 ****
  	else
  #endif
  		if( p->sclass == PARAM && ( tsz < SZINT ) ){
! 			off = upoff( SZINT, ALINT, &noff );
  # ifndef RTOLBYTES
  			off = noff - tsz;
  #endif
--- 1259,1265 ----
  	else
  #endif
  		if( p->sclass == PARAM && ( tsz < SZINT ) ){
! 			off = upoff( (OFFSZ)SZINT, ALINT, &noff );
  # ifndef RTOLBYTES
  			off = noff - tsz;
  #endif
***************
*** 1261,1267 ****
  			}
  		else
  		{
! 		off = upoff( tsz, al, &noff );
  		}
  
  	if( p->sclass != REGISTER ){ /* in case we are allocating stack space for register arguments */
--- 1266,1272 ----
  			}
  		else
  		{
! 		off = upoff( tsz, (int)al, &noff );
  		}
  
  	if( p->sclass != REGISTER ){ /* in case we are allocating stack space for register arguments */
***************
*** 1512,1518 ****
  
  	/* build a type, and stash away dimensions, from a parse tree of the declaration */
  	/* the type is build top down, the dimensions bottom up */
! 	register o, temp;
  	register unsigned t;
  
  	o = p->in.op;
--- 1517,1524 ----
  
  	/* build a type, and stash away dimensions, from a parse tree of the declaration */
  	/* the type is build top down, the dimensions bottom up */
! 	register o;
! 	CONSZ temp;
  	register unsigned t;
  
  	o = p->in.op;
***************
*** 1736,1742 ****
  	/* look up name: must agree with s w.r.t. STAG, SMOS and SHIDDEN */
  
  	register char *p, *q;
! 	int i, j, ii;
  	register struct symtab *sp;
  
  	/* compute initial hash index */
--- 1742,1748 ----
  	/* look up name: must agree with s w.r.t. STAG, SMOS and SHIDDEN */
  
  	register char *p, *q;
! 	unsigned int i, j, ii;
  	register struct symtab *sp;
  
  	/* compute initial hash index */
*** /old/src/lib/mip/reader.c	Sun Aug 25 13:55:54 1985
--- /usr/src/lib/mip/reader.c	Sat Aug 17 14:00:46 1991
***************
*** 1,4 ****
! #ifndef lint
  static char *sccsid ="@(#)reader.c	4.4 (Berkeley) 8/22/85";
  #endif lint
  
--- 1,4 ----
! #if	!defined(lint) && defined(DOSCCS)
  static char *sccsid ="@(#)reader.c	4.4 (Berkeley) 8/22/85";
  #endif lint
  
***************
*** 124,131 ****
  
  # ifndef NOMAIN
  
! unsigned int caloff();
! unsigned int offsz;
  mainp2( argc, argv ) char *argv[]; {
  	register files;
  	register temp;
--- 124,131 ----
  
  # ifndef NOMAIN
  
! OFFSZ caloff();
! OFFSZ offsz;
  mainp2( argc, argv ) char *argv[]; {
  	register files;
  	register temp;
***************
*** 148,154 ****
  		}
  	while( (c=getchar()) > 0 ) switch( c ){
  	case ')':
- 	default:
  		/* copy line unchanged */
  		if ( c != ')' )
  			PUTCHAR( c );  /*  initial tab  */
--- 148,153 ----
***************
*** 161,167 ****
  	case BBEG:
  		/* beginning of a block */
  		temp = rdin(10);  /* ftnno */
! 		tmpoff = baseoff = (unsigned int) rdin(10); /* autooff for block gives max offset of autos in block */
  		maxtreg = rdin(10);
  		if( getchar() != '\n' ) cerror( "intermediate file format error");
  
--- 160,166 ----
  	case BBEG:
  		/* beginning of a block */
  		temp = rdin(10);  /* ftnno */
! 		tmpoff = baseoff = rdin(10); /* autooff for block gives max offset of autos in block */
  		maxtreg = rdin(10);
  		if( getchar() != '\n' ) cerror( "intermediate file format error");
  
*** /old/src/lib/mip/scan.c	Wed Apr 23 19:44:34 1986
--- /usr/src/lib/mip/scan.c	Sat Aug 17 14:02:12 1991
***************
*** 1,4 ****
! #ifndef lint
  static char *sccsid ="@(#)scan.c	2.1 (Berkeley) 4/23/86";
  #endif lint
  
--- 1,4 ----
! #if	!defined(lint) && defined(DOSCCS)
  static char *sccsid ="@(#)scan.c	2.1 (Berkeley) 4/23/86";
  #endif lint
  
***************
*** 56,62 ****
  #ifndef FLEXNAMES
  # define LXTSZ 100
  #else
! #define	LXTSZ	BUFSIZ
  #endif
  char yytext[LXTSZ];
  char * lxgcp;
--- 56,62 ----
  #ifndef FLEXNAMES
  # define LXTSZ 100
  #else
! #define	LXTSZ	512		/* was BUFSIZ */
  #endif
  char yytext[LXTSZ];
  char * lxgcp;
***************
*** 70,76 ****
  extern int lastloc;
  #endif
  
! unsigned caloff();
  	/* ARGSUSED */
  mainp1( argc, argv ) int argc; char *argv[]; {  /* control multiple files */
  
--- 70,76 ----
  extern int lastloc;
  #endif
  
! OFFSZ caloff();
  	/* ARGSUSED */
  mainp1( argc, argv ) int argc; char *argv[]; {  /* control multiple files */
  
***************
*** 78,86 ****
  	register char *cp;
  	extern int idebug, bdebug, tdebug, edebug;
  	extern int ddebug, xdebug, gdebug, adebug;
! 	extern unsigned int offsz;
  	int fdef = 0;
! 	char *release = "PCC/2.1 (Berkeley) 4/23/86";
  
  	offsz = caloff();
  	for( i=1; i<argc; ++i ){
--- 78,86 ----
  	register char *cp;
  	extern int idebug, bdebug, tdebug, edebug;
  	extern int ddebug, xdebug, gdebug, adebug;
! 	extern OFFSZ offsz;
  	int fdef = 0;
! 	char *release = "PCC/3.0 (2.11BSD) 7/23/91";
  
  	offsz = caloff();
  	for( i=1; i<argc; ++i ){
***************
*** 114,129 ****
--- 114,133 ----
  				case 'P':	/* profiling */
  					++proflg;
  					break;
+ #ifdef	never
  				case 'g':
  					++gdebug;
  					break;
+ #endif
  				case 'a':
  					++adebug;
  					break;
+ #ifdef	never
  				case 'G':
  					++gdebug;
  					oldway = 1;
  					break;
+ #endif
  					}
  				}
  			}
***************
*** 1049,1056 ****
  		}
  	}
  
! #ifdef FLEXNAMES
! #define	NSAVETAB	4096
  char	*savetab;
  int	saveleft;
  
--- 1053,1059 ----
  		}
  	}
  
! #define	NSAVETAB	512		/* was 4096 */
  char	*savetab;
  int	saveleft;
  
***************
*** 1079,1086 ****
  /*
   * The definition for the segmented hash tables.
   */
! #define	MAXHASH	20
! #define	HASHINC	1013
  struct ht {
  	char	**ht_low;
  	char	**ht_high;
--- 1082,1089 ----
  /*
   * The definition for the segmented hash tables.
   */
! #define	MAXHASH	16		/* was 20 */
! #define	HASHINC	257		/* was 1013 */
  struct ht {
  	char	**ht_low;
  	char	**ht_high;
***************
*** 1149,1153 ****
  		} while (i < HASHINC);
  	}
  	cerror("ran out of hash tables");
  }
- #endif
--- 1152,1156 ----
  		} while (i < HASHINC);
  	}
  	cerror("ran out of hash tables");
+ /* NOTREACHED */
  }
*** /old/src/lib/mip/trees.c	Sat Jan 11 11:46:17 1986
--- /usr/src/lib/mip/trees.c	Sat Aug 17 14:04:54 1991
***************
*** 1,4 ****
! #ifndef lint
  static char *sccsid ="@(#)trees.c	4.10 (Berkeley) 1/8/86";
  #endif
  
--- 1,4 ----
! #if	!defined(lint) && defined(DOSCCS)
  static char *sccsid ="@(#)trees.c	4.10 (Berkeley) 1/8/86";
  #endif
  
***************
*** 405,411 ****
  					else werror( "struct/union or struct/union pointer required" );
  					}
  				else if( (j=l->fn.csiz+1)<0 ) cerror( "undefined structure or union" );
! 				else if( !chkstr( i, dimtab[j], DECREF(l->in.type) ) ){
  #ifndef FLEXNAMES
  					werror( "illegal member use: %.8s", stab[i].sname );
  #else
--- 405,411 ----
  					else werror( "struct/union or struct/union pointer required" );
  					}
  				else if( (j=l->fn.csiz+1)<0 ) cerror( "undefined structure or union" );
! 				else if( !chkstr( i, (int)dimtab[j], DECREF(l->in.type) ) ){
  #ifndef FLEXNAMES
  					werror( "illegal member use: %.8s", stab[i].sname );
  #else
***************
*** 617,623 ****
  # endif
  	if( (k = j) < 0 ) uerror( "undefined structure or union" );
  	else {
! 		for( ; (kk = dimtab[k] ) >= 0; ++k ){
  			if( kk >= SYMTSZ ){
  				cerror( "gummy structure" );
  				return(1);
--- 617,623 ----
  # endif
  	if( (k = j) < 0 ) uerror( "undefined structure or union" );
  	else {
! 		for( ; (kk = (int)dimtab[k] ) >= 0; ++k ){
  			if( kk >= SYMTSZ ){
  				cerror( "gummy structure" );
  				return(1);
***************
*** 628,634 ****
  			case STRTY:
  			case UNIONTY:
  				if( type == STRTY ) continue;  /* no recursive looking for strs */
! 				if( hflag && chkstr( i, dimtab[stab[kk].sizoff+1], stab[kk].stype ) ){
  					if( stab[kk].sname[0] == '$' ) return(0);  /* $FAKE */
  					werror(
  #ifndef FLEXNAMES
--- 628,634 ----
  			case STRTY:
  			case UNIONTY:
  				if( type == STRTY ) continue;  /* no recursive looking for strs */
! 				if( hflag && chkstr( i, (int)dimtab[stab[kk].sizoff+1], stab[kk].stype ) ){
  					if( stab[kk].sname[0] == '$' ) return(0);  /* $FAKE */
  					werror(
  #ifndef FLEXNAMES
***************
*** 898,904 ****
  	}
  
  NODE *
! bcon( i ){ /* make a constant node with value i */
  	register NODE *p;
  
  	p = block( ICON, NIL, NIL, INT, 0, INT );
--- 898,904 ----
  	}
  
  NODE *
! bcon( i ) int i;{ /* make a constant node with value i */
  	register NODE *p;
  
  	p = block( ICON, NIL, NIL, INT, 0, INT );
***************
*** 1678,1684 ****
  	case STCALL:
  	case UNARY STCALL:
  		/* set up size parameters */
! 		p->stn.stsize = (tsize(STRTY,p->in.left->fn.cdim,p->in.left->fn.csiz)+SZCHAR-1)/SZCHAR;
  		p->stn.stalign = talign(STRTY,p->in.left->fn.csiz)/SZCHAR;
  		break;
  
--- 1678,1684 ----
  	case STCALL:
  	case UNARY STCALL:
  		/* set up size parameters */
! 		p->stn.stsize = (tsize(STRTY,p->in.left->fn.cdim, (OFFSZ)p->in.left->fn.csiz)+SZCHAR-1)/SZCHAR;
  		p->stn.stalign = talign(STRTY,p->in.left->fn.csiz)/SZCHAR;
  		break;
  
*** /old/src/lib/mip/xdefs.c	Tue Mar 19 13:10:51 1985
--- /usr/src/lib/mip/xdefs.c	Sat Aug 17 14:06:32 1991
***************
*** 1,4 ****
! #ifndef lint
  static char *sccsid ="@(#)xdefs.c	4.3 (Berkeley) 3/19/85";
  #endif lint
  
--- 1,4 ----
! #if	!defined(lint) && defined(DOSCCS)
  static char *sccsid ="@(#)xdefs.c	4.3 (Berkeley) 3/19/85";
  #endif lint
  
***************
*** 6,13 ****
  
  /*	communication between lexical routines	*/
  
! char	ftitle[100] = "";   	/* title of the file */
! char	ititle[100] = "";   	/* title of initial file */
  int	lineno;		/* line number of the input file */
  
  CONSZ lastcon;  /* the last constant read by the lexical analyzer */
--- 6,15 ----
  
  /*	communication between lexical routines	*/
  
! char	ftitle[100];   		/* title of the file */
! #ifndef	LINT
! char	ititle[100];   		/* title of initial file */
! #endif
  int	lineno;		/* line number of the input file */
  
  CONSZ lastcon;  /* the last constant read by the lexical analyzer */
***************
*** 28,39 ****
  	blevel,		/* block level: 0 for extern, 1 for ftn args, >=2 inside function */
  	curdim;		/* current offset into the dimension table */
  	
! int	dimtab[ DIMTABSZ ];
  
! int	paramstk[ PARAMSZ ];  /* used in the definition of function parameters */
  int	paramno;	  /* the number of parameters */
! int	autooff,	/* the next unused automatic offset */
! 	argoff,	/* the next unused argument offset */
  	strucoff;	/*  the next structure offset position */
  int	regvar;		/* the next free register for register variables */
  int	minrvar;	/* the smallest that regvar gets witing a function */
--- 30,47 ----
  	blevel,		/* block level: 0 for extern, 1 for ftn args, >=2 inside function */
  	curdim;		/* current offset into the dimension table */
  	
! OFFSZ	dimtab[ DIMTABSZ ];	/* same comments as below.  bit addressing
! 				 * everything forces this to be large.
! 				*/
  
! OFFSZ	paramstk[ PARAMSZ ];  /* used in definition of function parameters */
! 			      /* ordinarily 'int' would be enough, but the
! 			       * "bit address" in 'strucoff' (for structures
! 			       * over 4kb) needs a 'long' *sigh*
! 			      */
  int	paramno;	  /* the number of parameters */
! OFFSZ	autooff,	/* the next unused automatic offset */
! 	argoff,		/* the next unused argument offset */
  	strucoff;	/*  the next structure offset position */
  int	regvar;		/* the next free register for register variables */
  int	minrvar;	/* the smallest that regvar gets witing a function */
*** /old/src/lib/pcc/Makefile	Mon Jul 24 15:42:27 1989
--- /usr/src/lib/pcc/Makefile	Sun Aug  4 09:57:03 1991
***************
*** 1,80 ****
! INSTALL=${DESTDIR}/usr/lib/ccom
! M=/usr/src/lib/mip
! CFLAGS=-O
! head:  ccom ;
  
! all:	ccom
  
! cp:	ccom
! 	cp ccom ${DESTDIR}/usr/lib/ccom
! 	rm *.o cgram.c ccom
  
! cmp:	ccom
! 	cmp ccom ${DESTDIR}/usr/lib/ccom
! 	rm *.o cgram.c
  
! ccom: cgram.o xdefs.o scan.o pftn.o trees.o optim.o code.o local.o reader.o local2.o order.o match.o allo.o comm1.o table.o
! 	cc $(CFLAGS) -s -o ccom -i cgram.o xdefs.o scan.o pftn.o trees.o optim.o code.o local.o reader.o local2.o order.o match.o allo.o comm1.o table.o
! trees.o: $M/manifest macdefs $M/mfile1 $M/trees.c
! 	cc -c $(CFLAGS) -I$M -I. $M/trees.c
! optim.o: $M/manifest macdefs $M/mfile1 $M/optim.c
! 	cc -c $(CFLAGS) -I$M -I. $M/optim.c
! pftn.o: $M/manifest macdefs $M/mfile1 $M/pftn.c
! 	cc -c $(CFLAGS) -I$M -I. $M/pftn.c
! code.o: $M/manifest macdefs $M/mfile1
! 	cc -c $(CFLAGS) -I$M -I. code.c
! local.o: $M/manifest macdefs $M/mfile1
! 	cc -c $(CFLAGS) -I$M -I. local.c
! scan.o: $M/manifest macdefs $M/mfile1 $M/scan.c
! 	cc -c $(CFLAGS) -I$M -I. $M/scan.c
! xdefs.o: $M/manifest $M/mfile1 macdefs $M/xdefs.c
! 	cc -c $(CFLAGS) -I$M -I. $M/xdefs.c
! cgram.o: $M/manifest $M/mfile1 macdefs cgram.c
! 	cc -c $(CFLAGS) -I$M -I. cgram.c
! cgram.c: $M/cgram.y
! 	yacc $M/cgram.y
  	mv y.tab.c cgram.c
! comm1.o: $M/manifest $M/mfile1 $M/common macdefs $M/comm1.c
! 	cc -c $(CFLAGS) -I. -I$M $M/comm1.c
! table.o: $M/manifest $M/mfile2 mac2defs macdefs table.c
! 	cc -c $(CFLAGS) -I$M -I. table.c
! reader.o: $M/manifest $M/mfile2 mac2defs macdefs $M/reader.c
! 	cc -c $(CFLAGS) -I$M -I. $M/reader.c
! local2.o: $M/manifest $M/mfile2 mac2defs macdefs
! 	cc -c $(CFLAGS) -I$M -I. local2.c
! order.o: $M/manifest $M/mfile2 mac2defs macdefs
! 	cc -c $(CFLAGS) -I$M -I. order.c
! match.o: $M/manifest $M/mfile2 mac2defs macdefs $M/match.c
! 	cc -c $(CFLAGS) -I$M -I. $M/match.c
! allo.o: $M/manifest $M/mfile2 mac2defs macdefs $M/allo.c
! 	cc -c $(CFLAGS) -I$M -I. $M/allo.c
! shrink:
! 	rm *.o ccom
! lintall:
! 	lint -hpv -I. -I$M  cgram.c xdefs.c $M/scan.c $M/pftn.c $M/trees.c $M/optim.c code.c local.c $M/reader.c local2.c order.c $M/match.c $M/allo.c $M/comm1.c table.c
! fort: ccom fort.o freader.o fallo.o fmatch.o ftable.o forder.o flocal2.o fcomm2.o
! 	cc -i $(CFLAGS) fort.o freader.o fallo.o fmatch.o ftable.o forder.o flocal2.o fcomm2.o
! 	mv a.out fort
! fort.o: fort.h $M/fort.c
! 	cc -c $(CFLAGS) -I$M -I. $M/fort.c
! freader.o: reader.o
! 	cc -c $(CFLAGS) -I$M -I. $M/freader.c
! fallo.o: allo.o
! 	cc -c $(CFLAGS) -I$M -I. $M/fallo.c
! fmatch.o: match.o
! 	cc -c $(CFLAGS) -I$M -I. $M/fmatch.c
! ftable.o: table.o
! 	cc -c $(CFLAGS) -I$M -I. $M/ftable.c
! forder.o: order.o
! 	cc -c $(CFLAGS) -I$M -I. $M/forder.c
! flocal2.o: local2.o
! 	cc -c $(CFLAGS) -I$M -I. $M/flocal2.c
! fcomm2.o: $M/common
! 	cc -c $(CFLAGS) -I$M -I. $M/fcomm2.c
! fort.o freader.o fallo.o fmatch.o ftable.o forder.o flocal2.o fcomm2.o: $M/mfile2 $M/manifest macdefs mac2defs
! install:
! 	cp ccom $(INSTALL)
! 	cp macdefs mac2defs local.c code.c local2.c order.c table.c ${DESTDIR}/usr/src/cmd/pcc
  
  clean:
! 	rm -f *.o
--- 1,104 ----
! #
! #	Makefile	1.13	86/03/11
! #
! # Makefile for PCC
! #
! #	FIXSTRUCT	no trickery (just output structure)
! #
! # Some symbols are specific to certain compilers:
! #	ONEPASS		compile pass 1 and pass 2 together
! #	SPRECC		do single precision in single not double
! #	FORT		get f77-style pass 2
! #
! CONFIG=	-DONEPASS "-DFIXSTRUCT=outstruct"
! O = -O
! CFLAGS = $(O) -I. -I$(M) $(CONFIG)
! COPTS = $(CFLAGS)
! LDFLAGS = -i
  
! RM=	/bin/rm -f
! LN=	/bin/ln -s
  
! P1INCS=	$M/pass1.h macdefs.h $M/manifest.h pcclocal.h $M/config.h $M/ndu.h \
! 	/usr/include/stdio.h
! P1ONEP=	$(P1INCS) $M/onepass.h
! P2INCS=	$M/pass2.h macdefs.h mac2defs.h $M/manifest.h pcclocal.h $M/config.h \
! 	$M/ndu.h /usr/include/stdio.h
! P2ONEP=	$(P2INCS) $M/onepass.h
  
! M=../mip
! TESTDIR = .
  
! all: ccom 
! 
! #
! # 'ccom' is a one-pass C compiler.
! #
! ccom: cgram.o xdefs.o scan.o pftn.o trees.o optim.o code.o local.o \
! 	reader.o local2.o order.o match.o allo.o comm1.o table.o stab.o
! 	$(CC) $(LDFLAGS) xdefs.o scan.o pftn.o trees.o \
! 		optim.o code.o local.o reader.o order.o match.o \
! 		allo.o -Z comm1.o cgram.o -Z local2.o -Y table.o stab.o \
! 		-o $(TESTDIR)/ccom
! 
! trees.o: $(P1ONEP) $M/trees.c
! 	$(CC) -c $(COPTS) $M/trees.c
! optim.o: $(P1ONEP) $M/optim.c
! 	$(CC) -c $(COPTS) $M/optim.c
! pftn.o: $(P1ONEP) $M/pftn.c
! 	$(CC) -c $(COPTS) $M/pftn.c
! code.o: $(P1ONEP) code.c
! 	$(CC) -c $(COPTS) code.c
! local.o: $(P1ONEP) local.c
! 	$(CC) -c $(COPTS) local.c
! scan.o: $(P1ONEP) $M/scan.c
! 	$(CC) -c $(COPTS) $M/scan.c
! xdefs.o: $(P1ONEP) $M/xdefs.c
! 	$(CC) -c $(COPTS) $M/xdefs.c
! cgram.o: $(P1ONEP) cgram.c
! 	$(CC) -c $(COPTS) cgram.c
! cgram.c: $M/cgram.y pcctokens
! 	cat pcctokens $M/cgram.y > gram.in
! 	$(YACC) gram.in
  	mv y.tab.c cgram.c
! comm1.o: $(P1ONEP) $M/common.c
! 	$(LN) $M/common.c comm1.c
! 	$(CC) -c $(COPTS) -DPASS1COMMON comm1.c
! 	$(RM) comm1.c
! table.o: $(P2ONEP) table.c
! 	$(CC) -c $(COPTS) table.c
! reader.o: $(P2ONEP) $M/reader.c
! 	$(CC) -c $(COPTS) $M/reader.c
! local2.o: $(P2ONEP) local2.c
! 	$(CC) -c $(COPTS) local2.c
! order.o: $(P2ONEP) order.c
! 	$(CC) -c $(COPTS) order.c
! match.o: $(P2ONEP) $M/match.c
! 	$(CC) -c $(COPTS) $M/match.c
! allo.o: $(P2ONEP) $M/allo.c
! 	$(CC) -c $(COPTS) $M/allo.c
! stab.o: $(P2ONEP) stab.c
! 	$(CC) -c $(COPTS) stab.c
  
+ install: all
+ 	install -s ${TESTDIR}/ccom ${DESTDIR}/lib/ccom
+ 
+ GREP=	egrep
+ 
+ pcclocal.h: localdefs.h /usr/include/pcc.h
+ 	$(RM) pcclocal.h
+ 	cat /usr/include/pcc.h localdefs.h | $(GREP) '^#[ 	]*(define[ 	][ 	]*PCC(F|T|TM|OM)?_|ifdef|ifndef|endif)' | sed -e 's/PCC[A-Z]*_//' > pcclocal.h 
+ 
+ pcctokens: localdefs.h /usr/include/pcc.h
+ 	$(RM) pcctokens
+ 	cat /usr/include/pcc.h localdefs.h | $(GREP) '^#[ 	]*define[ 	][ 	]*PCC_' | sed -e 's/^#[ 	]*define[ 	][ 	]*PCC_/%term	/' > pcctokens
+ 
+ shrink:
+ 	$(RM) *.o ccom
  clean:
! 	$(RM) *.o ccom cgram.c pcctokens pcclocal.h gram.in
! lintall:
! 	lint -hax -I. -I$M -DONEPASS -DPASS1COMMON cgram.c $M/xdefs.c \
! 		$M/scan.c $M/pftn.c $M/trees.c $M/optim.c code.c \
! 		local.c $M/reader.c local2.c order.c $M/match.c $M/allo.c \
! 		$M/common.c table.c stab.c
