Subject: patches to port lint from 4.3 to 2.11 Index: usr.bin/lint 2.11BSD Description: 'lint' as distributed with 2.11BSD was broken. Repeat-By: Try to compile and run 'lint' as present in the 2.11BSD distribution. Note the copious errors at both compile and runtime. Fix: This fix depends on the /usr/src/usr.bin/PORT directory being present. If this directory has been removed to save space you will have to extract it temporarily from the distribution tapes. The diffs below are relative to the 4.3BSD version of 'lint' provided in /usr/src/usr.bin/PORT/lint.tar.Z. Two shell scripts are provided (/tmp/s and /tmp/libs). The first can be used to do much of the work of unpacking the 4.3BSD files and cleaning up the directory, or you may perform the steps manually using the script as a guide. In either case be sure to remove the llib-* files (they are not correct for 2.11BSD systems). The second script (/tmp/libs) is to be installed in the lint source directory (must be marked executable). It is used by "make install" to create the compiled lint libraries in /usr/lib/lint. The third file (/tmp/c) is the file to be fed into patch like this: cd /usr/src/usr.bin/lint patch '/tmp/s' X#! /bin/sh -v Xcd /usr/src/usr.bin Xrm lint/* Xzcat PORT/lint.tar.Z | tar xf - Xcd lint Xrm :yyfix llib-* Xcp -p /tmp/libs libs SHAR_EOF chmod +x '/tmp/s' fi if test -f '/tmp/libs' then echo shar: "will not over-write existing file '/tmp/libs'" else sed 's/^X//' << \SHAR_EOF > '/tmp/libs' X#! /bin/sh -v X Xcd /usr/lib/lint X/lib/cpp -C -Dlint llib-port | ./lint1 -puv > llib-port.ln X/lib/cpp -C -Dlint llib-ldbm | ./lint1 -uv > llib-ldbm.ln X/lib/cpp -C -Dlint llib-lm | ./lint1 -uv > llib-lm.ln X/lib/cpp -C -Dlint llib-lmp | ./lint1 -uv > llib-lmp.ln X/lib/cpp -C -Dlint llib-lplot | ./lint1 -uv > llib-lplot.ln X/lib/cpp -C -Dlint llib-ltermcap | ./lint1 -uv > llib-ltermcap.ln X/lib/cpp -C -Dlint llib-lc | ./lint1 -v > llib-lc.ln X/lib/cpp -C -Dlint llib-lcurses | ./lint1 -v > llib-lcurses.ln SHAR_EOF chmod +x '/tmp/libs' fi if test -f '/tmp/c' then echo shar: "will not over-write existing file '/tmp/c'" else sed 's/^X//' << \SHAR_EOF > '/tmp/c' Xdiff -c lint.old/Makefile lint/Makefile X*** lint.old/Makefile Fri Apr 8 12:15:57 1988 X--- lint/Makefile Sat Aug 17 19:27:53 1991 X*************** X*** 3,54 **** X # X M=/usr/src/lib/mip X P=/usr/src/lib/pcc X! CFLAGS=-O X! LINTLIBS=llib-port.ln llib-lc.ln llib-lcurses.ln llib-ldbm.ln llib-lm.ln \ X! llib-lmp.ln llib-lplot.ln llib-ltermcap.ln X SRCS= $M/cgram.y $M/common.c $M/optim.c $M/pftn.c $M/scan.c $M/trees.c \ X $M/xdefs.c lint.c hash.c $M/pass1.h $M/manifest.h macdefs.h \ X lpass2.c X X! all: lpass1 lpass2 ${LINTLIBS} X X! lpass1: cgram.o rodata.o comm1.o optim.o pftn.o scan.o trees.o xdefs.o \ X! lint.o hash.o X! ${CC} ${CFLAGS} cgram.o rodata.o comm1.o optim.o pftn.o scan.o \ X! trees.o xdefs.o lint.o hash.o -o lpass1 X X cgram.o: $M/manifest.h $M/pass1.h pcclocal.h macdefs.h cgram.c X- $(CC) -c $(CFLAGS) -I$M -I. cgram.c X X! rodata.o: rodata.c X! $(CC) -c $(CFLAGS) -R rodata.c X X comm1.o: $M/manifest.h $M/pass1.h pcclocal.h $M/common.c macdefs.h X ln $M/common.c comm1.c X! $(CC) -c $(CFLAGS) -I$M -I. -DPASS1COMMON comm1.c X rm -f comm1.c X X optim.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/optim.c X- $(CC) -c $(CFLAGS) -I$M -I. $M/optim.c X X pftn.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/pftn.c X- $(CC) -c $(CFLAGS) -I$M -I. $M/pftn.c X X scan.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/scan.c X- $(CC) -c $(CFLAGS) -I$M -I. $M/scan.c X X trees.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/trees.c X- $(CC) -c $(CFLAGS) -I$M -I. $M/trees.c X X xdefs.o: $M/manifest.h $M/pass1.h pcclocal.h macdefs.h $M/xdefs.c X- $(CC) -c $(CFLAGS) -I$M -I. $M/xdefs.c X X! rodata.c cgram.c: $M/cgram.y pcctokens X cat pcctokens $M/cgram.y > gram.in X $(YACC) gram.in X! rm -f rodata.c X! sh ./:yyfix yyexca yyact yypact yypgo yyr1 yyr2 yychk yydef X! mv y.tab.c cgram.c X X GREP= egrep X X--- 3,62 ---- X # X M=/usr/src/lib/mip X P=/usr/src/lib/pcc X! VPATH= $M X! XSTR= /usr/ucb/xstr X! X! # turn off the debugging to save string space X! CFLAGS=-O -I$M -I. -DBUG1 -DBUG2 -DBUG3 -DBUG4 X! LFLAGS=-i X SRCS= $M/cgram.y $M/common.c $M/optim.c $M/pftn.c $M/scan.c $M/trees.c \ X $M/xdefs.c lint.c hash.c $M/pass1.h $M/manifest.h macdefs.h \ X lpass2.c X X! .c.o: X! ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c - X! ${CC} -c ${CFLAGS} x.c X! mv -f x.o $*.o X! rm -f x.c X X! all: lpass1 lpass2 X X+ lpass1: cgram.o comm1.o optim.o pftn.o scan.o trees.o xdefs.o \ X+ lint.o hash.o strings.o X+ ${CC} ${LFLAGS} ${CFLAGS} cgram.o comm1.o optim.o pftn.o \ X+ scan.o trees.o xdefs.o lint.o hash.o strings.o -o lpass1 X+ X cgram.o: $M/manifest.h $M/pass1.h pcclocal.h macdefs.h cgram.c X X! strings.o: strings X! ${XSTR} X! ${CC} -c xs.c X! mv -f xs.o strings.o X! rm -f xs.c X X comm1.o: $M/manifest.h $M/pass1.h pcclocal.h $M/common.c macdefs.h X ln $M/common.c comm1.c X! ${CC} -E ${CFLAGS} -DPASS1COMMON comm1.c | ${XSTR} -c - X! ${CC} -c ${CFLAGS} -DPASS1COMMON x.c X! mv -f x.o comm1.o X! rm -f x.c X rm -f comm1.c X X optim.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/optim.c X X pftn.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/pftn.c X X scan.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/scan.c X X trees.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/trees.c X X xdefs.o: $M/manifest.h $M/pass1.h pcclocal.h macdefs.h $M/xdefs.c X X! cgram.c: $M/cgram.y pcctokens X cat pcctokens $M/cgram.y > gram.in X $(YACC) gram.in X! fgrep -v "static char yaccpar_sccsid" y.tab.c >cgram.c X! rm -f y.tab.c X X GREP= egrep X X*************** X*** 61,94 **** X cat /usr/include/pcc.h $P/localdefs.h | $(GREP) '^#[ ]*define[ ][ ]*PCC_' | sed -e 's/^#[ ]*define[ ][ ]*PCC_/%term /' > pcctokens X X lint.o: $M/manifest.h macdefs.h $M/pass1.h lmanifest.h X- ${CC} -c ${CFLAGS} -I$M -I. lint.c X X- llib-port.ln: llib-port lpass1 X- -(/lib/cpp -C -Dlint llib-port | ./lpass1 -puv > llib-port.ln ) X- X- llib-ldbm.ln: llib-ldbm lpass1 X- -(/lib/cpp -C -Dlint llib-ldbm | ./lpass1 -uv > llib-ldbm.ln ) X- X- llib-lm.ln: llib-lm lpass1 X- -(/lib/cpp -C -Dlint llib-lm | ./lpass1 -uv > llib-lm.ln ) X- X- llib-lmp.ln: llib-lmp lpass1 X- -(/lib/cpp -C -Dlint llib-lmp | ./lpass1 -uv > llib-lmp.ln ) X- X- llib-lplot.ln: llib-lplot lpass1 X- -(/lib/cpp -C -Dlint llib-lplot | ./lpass1 -uv > llib-lplot.ln ) X- X- llib-ltermcap.ln: llib-ltermcap lpass1 X- -(/lib/cpp -C -Dlint llib-ltermcap | ./lpass1 -uv > llib-ltermcap.ln ) X- X- llib-lc.ln: llib-lc lpass1 X- -(/lib/cpp -C -Dlint llib-lc | ./lpass1 -v > llib-lc.ln ) X- X- llib-lcurses.ln: llib-lcurses lpass1 X- -(/lib/cpp -C -Dlint llib-lcurses | ./lpass1 -v > llib-lcurses.ln ) X- X lpass2: lpass2.o hash.o X! ${CC} ${CFLAGS} lpass2.o hash.o -o lpass2 X X lpass2.o: $M/manifest.h lmanifest.h pcclocal.h macdefs.h X ${CC} ${CFLAGS} -c -I$M -I. lpass2.c X--- 69,77 ---- X cat /usr/include/pcc.h $P/localdefs.h | $(GREP) '^#[ ]*define[ ][ ]*PCC_' | sed -e 's/^#[ ]*define[ ][ ]*PCC_/%term /' > pcctokens X X lint.o: $M/manifest.h macdefs.h $M/pass1.h lmanifest.h X X lpass2: lpass2.o hash.o X! ${CC} ${LFLAGS} ${CFLAGS} lpass2.o hash.o -o lpass2 X X lpass2.o: $M/manifest.h lmanifest.h pcclocal.h macdefs.h X ${CC} ${CFLAGS} -c -I$M -I. lpass2.c X*************** X*** 97,109 **** X ${CC} ${CFLAGS} -c -I$M -I. hash.c X X lintall: X! lint -hpv -I. -I$M $M/cgram.c $M/xdefs.c $M/scan.c \ X! $M/pftn.c $M/trees.c $M/optim.c lint.c X X install: all SHELL X install -s lpass1 ${DESTDIR}/usr/lib/lint/lint1 X install -s lpass2 ${DESTDIR}/usr/lib/lint/lint2 X! for i in llib-*; do install -c -m 644 $$i ${DESTDIR}/usr/lib/lint; done X -rm -f ${DESTDIR}/usr/lib/lint/llib-ltermlib* X ln -s llib-ltermcap ${DESTDIR}/usr/lib/lint/llib-ltermlib X ln -s llib-ltermcap.ln ${DESTDIR}/usr/lib/lint/llib-ltermlib.ln X--- 80,92 ---- X ${CC} ${CFLAGS} -c -I$M -I. hash.c X X lintall: X! lint -hpav -I. -I$M -DPASS1COMMON cgram.c $M/xdefs.c $M/scan.c \ X! $M/common.c $M/pftn.c $M/trees.c $M/optim.c hash.c lint.c X X install: all SHELL X install -s lpass1 ${DESTDIR}/usr/lib/lint/lint1 X install -s lpass2 ${DESTDIR}/usr/lib/lint/lint2 X! ./libs X -rm -f ${DESTDIR}/usr/lib/lint/llib-ltermlib* X ln -s llib-ltermcap ${DESTDIR}/usr/lib/lint/llib-ltermlib X ln -s llib-ltermcap.ln ${DESTDIR}/usr/lib/lint/llib-ltermlib.ln X*************** X*** 110,119 **** X install -c SHELL ${DESTDIR}/usr/bin/lint X X shrink: X! rm -f *.o errs rodata.c pcctokens pcclocal.h X X clean: shrink X! rm -f lpass1 lpass2 cgram.c gram.in tags ${LINTLIBS} X X tags: ${SRCS} X ctags -w ${SRCS} X--- 93,102 ---- X install -c SHELL ${DESTDIR}/usr/bin/lint X X shrink: X! rm -f *.o errs pcctokens pcclocal.h x.c xs.c strings X X clean: shrink X! rm -f lpass1 lpass2 cgram.c gram.in tags X X tags: ${SRCS} X ctags -w ${SRCS} Xdiff -c lint.old/hash.c lint/hash.c X*** lint.old/hash.c Fri Apr 8 12:14:57 1988 X--- lint/hash.c Sat Aug 17 18:53:52 1991 X*************** X*** 1,4 **** X! #ifndef lint X static char sccsid[] = "@(#)hash.c 1.1 (Berkeley) 3/29/83"; X #endif lint X X--- 1,4 ---- X! #if !defined(lint) && defined(DOSCCS) X static char sccsid[] = "@(#)hash.c 1.1 (Berkeley) 3/29/83"; X #endif lint X Xdiff -c lint.old/lint.c lint/lint.c X*** lint.old/lint.c Thu Mar 20 21:06:42 1986 X--- lint/lint.c Sat Aug 17 19:29:41 1991 X*************** X*** 1,4 **** X! #ifndef lint X static char sccsid[] = "@(#)lint.c 1.10 (Berkeley) 3/20/86"; X #endif lint X X--- 1,4 ---- X! #if !defined(lint) && defined(DOSCCS) X static char sccsid[] = "@(#)lint.c 1.10 (Berkeley) 3/20/86"; X #endif lint X X*************** X*** 37,43 **** X int zflag = 0; /* no 'structure never defined' error */ X int Cflag = 0; /* filter out certain output, for generating libraries */ X char *libname = 0; /* name of the library we're generating */ X! X /* flags for the "outdef" function */ X # define USUAL (-101) X # define DECTY (-102) X--- 37,43 ---- X int zflag = 0; /* no 'structure never defined' error */ X int Cflag = 0; /* filter out certain output, for generating libraries */ X char *libname = 0; /* name of the library we're generating */ X! char *hash(); X /* flags for the "outdef" function */ X # define USUAL (-101) X # define DECTY (-102) X*************** X*** 172,180 **** X werror( "lint's little mind is blown" ); X } X else { X! j = dimtab[i+3]; X if( j<0 || j>SYMTSZ ){ X! k = dimtab[i]; X l = X_NONAME | stab[j].suse; X } X else { X--- 172,180 ---- X werror( "lint's little mind is blown" ); X } X else { X! j = (int)dimtab[i+3]; X if( j<0 || j>SYMTSZ ){ X! k = (int)dimtab[i]; X l = X_NONAME | stab[j].suse; X } X else { X*************** X*** 187,193 **** X stab[j].sname ); X } X else { X! k = dimtab[i]; X #ifdef FLEXNAMES X l = hashstr(stab[j].sname); X #else X--- 187,193 ---- X stab[j].sname ); X } X else { X! k = (int)dimtab[i]; X #ifdef FLEXNAMES X l = hashstr(stab[j].sname); X #else X*************** X*** 204,216 **** X else return( 0 ); X } X X! bfcode( a, n ) int a[]; { X /* code for the beginning of a function; a is an array of X indices in stab for the arguments; n is the number */ X /* this must also set retlab */ X register i; X register struct symtab *cfp; X! static ATYPE t; X X retlab = 1; X X--- 204,216 ---- X else return( 0 ); X } X X! bfcode( a, n ) OFFSZ a[]; { X /* code for the beginning of a function; a is an array of X indices in stab for the arguments; n is the number */ X /* this must also set retlab */ X register i; X register struct symtab *cfp; X! ATYPE t; /* XXX static */ X X retlab = 1; X X*************** X*** 272,278 **** X } X X lpta( p ) NODE *p; { X! static ATYPE t; X X if( p->in.op == CM ){ X lpta( p->in.left ); X--- 272,278 ---- X } X X lpta( p ) NODE *p; { X! ATYPE t; /* XXX static */ X X if( p->in.op == CM ){ X lpta( p->in.left ); X*************** X*** 651,657 **** X X register o; X register unsigned t, tl; X! int s; X X switch( o = p->in.op ){ X X--- 651,657 ---- X X register o; X register unsigned t, tl; X! CONSZ s; X X switch( o = p->in.op ){ X X*************** X*** 732,738 **** X } X X X! cinit( p, sz ) NODE *p; { /* initialize p into size sz */ X inoff += sz; X if( p->in.op == INIT ){ X if( p->in.left->in.op == ICON ) return; X--- 732,738 ---- X } X X X! cinit( p, sz ) NODE *p; OFFSZ sz; { /* initialize p into size sz */ X inoff += sz; X if( p->in.op == INIT ){ X if( p->in.left->in.op == ICON ) return; X*************** X*** 759,769 **** X X char * X strip(s) char *s; { X! #ifndef FLEXNAMES X! static char x[LFNM+1]; X! #else X! static char x[BUFSIZ]; X! #endif X register char *p; X static int stripping = 0; X X--- 759,765 ---- X X char * X strip(s) char *s; { X! static char x[128]; /* was BUFSIZ */ X register char *p; X static int stripping = 0; X X*************** X*** 772,783 **** X stripping++; X for( p=x; *s; ++s ){ X if( *s != '"' ){ X! #ifndef FLEXNAMES X! /* PATCHED by ROBERT HENRY on 8Jul80 to fix 14 character file name bug */ X! if( p >= &x[LFNM] ) X! #else X! if( p >= &x[BUFSIZ] ) X! #endif X cerror( "filename too long" ); X *p++ = *s; X } X--- 768,774 ---- X stripping++; X for( p=x; *s; ++s ){ X if( *s != '"' ){ X! if( p >= &x[sizeof (x)] ) X cerror( "filename too long" ); X *p++ = *s; X } X*************** X*** 784,822 **** X } X stripping = 0; X *p = '\0'; X- #ifndef FLEXNAMES X- return( x ); X- #else X return( hash(x) ); X- #endif X } X X fsave( s ) char *s; { X static union rec fsname; X s = strip( s ); X- #ifndef FLEXNAMES X- if( strncmp( s, fsname.f.fn, LFNM ) ) X- #else X if (fsname.f.fn == NULL || strcmp(s, fsname.f.fn)) X- #endif X { X /* new one */ X- #ifndef FLEXNAMES X- strncpy( fsname.f.fn, s, LFNM ); X- #else X fsname.f.fn = s; X- #endif X fsname.f.decflag = LFN; X fwrite( (char *)&fsname, sizeof(fsname), 1, stdout ); X- #ifdef FLEXNAMES X /* if generating a library, prefix with the library name */ X- /* only do this for flexnames */ X if( libname ){ X fwrite( libname, strlen(libname), 1, stdout ); X putchar( ':' ); X } X fwrite( fsname.f.fn, strlen(fsname.f.fn)+1, 1, stdout ); X- #endif X } X } X X--- 775,799 ---- X } X stripping = 0; X *p = '\0'; X return( hash(x) ); X } X X fsave( s ) char *s; { X static union rec fsname; X+ X s = strip( s ); X if (fsname.f.fn == NULL || strcmp(s, fsname.f.fn)) X { X /* new one */ X fsname.f.fn = s; X fsname.f.decflag = LFN; X fwrite( (char *)&fsname, sizeof(fsname), 1, stdout ); X /* if generating a library, prefix with the library name */ X if( libname ){ X fwrite( libname, strlen(libname), 1, stdout ); X putchar( ':' ); X } X fwrite( fsname.f.fn, strlen(fsname.f.fn)+1, 1, stdout ); X } X } X X*************** X*** 850,855 **** X--- 827,835 ---- X main( argc, argv ) char *argv[]; { X char *p; X int i; X+ char ibuf[BUFSIZ]; X+ X+ setbuf(stdin, ibuf); X X /* handle options */ X Xdiff -c lint.old/lmanifest.h lint/lmanifest.h X*** lint.old/lmanifest.h Fri Apr 5 19:40:13 1985 X--- lint/lmanifest.h Sun Aug 4 11:53:52 1991 X*************** X*** 24,33 **** X X # define LFN 01000 /* filename record */ X X! /* number of chars in NAME, and filename */ X #ifndef FLEXNAMES X # define LCHNM 8 X- # define LFNM 14 X #endif X X typedef struct ty { X--- 24,32 ---- X X # define LFN 01000 /* filename record */ X X! /* number of chars in NAME */ X #ifndef FLEXNAMES X # define LCHNM 8 X #endif X X typedef struct ty { X*************** X*** 54,63 **** X struct line l; X struct { X short decflag; X- #ifndef FLEXNAMES X- char fn[LFNM]; X- #else X char *fn; X- #endif X } f; X }; X--- 53,58 ---- Xdiff -c lint.old/lpass2.c lint/lpass2.c X*** lint.old/lpass2.c Fri Feb 21 22:02:53 1986 X--- lint/lpass2.c Sat Aug 17 18:53:19 1991 X*************** X*** 1,4 **** X! #ifndef lint X static char sccsid[] = "@(#)lpass2.c 1.6 (Berkeley) 2/21/86"; X #endif lint X X--- 1,4 ---- X! #if !defined(lint) && defined(DOSCCS) X static char sccsid[] = "@(#)lpass2.c 1.6 (Berkeley) 2/21/86"; X #endif lint X X*************** X*** 12,21 **** X # define RVAL 010 X # define VARARGS 0100 X X! # define NSZ 4096 X! # define TYSZ 3500 X! # define FSZ 500 X! # define NTY 50 X X typedef struct sty STYPE; X struct sty { ATYPE t; STYPE *next; }; X--- 12,21 ---- X # define RVAL 010 X # define VARARGS 0100 X X! # define NSZ 1630 /* was 4096 */ X! # define TYSZ 1150 /* was 3500 */ X! # define FSZ 200 /* was 500 must be less than 256 */ X! # define NTY 32 /* was 50 */ X X typedef struct sty STYPE; X struct sty { ATYPE t; STYPE *next; }; X*************** X*** 26,36 **** X #else X char *name; X #endif X- short nargs; X int decflag; X int fline; X STYPE symty; X! int fno; X int use; X } STAB; X X--- 26,36 ---- X #else X char *name; X #endif X int decflag; X int fline; X STYPE symty; X! unsigned char nargs; X! unsigned char fno; X int use; X } STAB; X X*************** X*** 40,55 **** X STYPE tary[TYSZ]; X STYPE *tget(); X X- #ifndef FLEXNAMES X- char fnm[FSZ][LFNM]; X- #else X char *fnm[FSZ]; X! #endif X X- #ifdef FLEXNAMES X- char *getstr(); X- #endif X- X int tfree; /* used to allocate types */ X int ffree; /* used to save filenames */ X X--- 40,48 ---- X STYPE tary[TYSZ]; X STYPE *tget(); X X char *fnm[FSZ]; X! char *getstr(), *hash(); X X int tfree; /* used to allocate types */ X int ffree; /* used to save filenames */ X X*************** X*** 69,74 **** X--- 62,68 ---- X X main( argc, argv ) char *argv[]; { X register char *p; X+ char ibuf[BUFSIZ], obuf[BUFSIZ]; X X /* first argument is intermediate file */ X /* second argument is - options */ X*************** X*** 113,118 **** X--- 107,114 ---- X error( "cannot open intermediate file" ); X exit( 1 ); X } X+ setbuf(stdin, ibuf); X+ setbuf(stdout, obuf); X if( Pflag ){ X pfile(); X return( 0 ); X*************** X*** 145,153 **** X if( fread( (char *)&r, sizeof(r), 1, stdin ) <= 0 ) return(0); X if( r.l.decflag & LFN ){ X /* new filename */ X- #ifdef FLEXNAMES X r.f.fn = getstr(); X- #endif X if( Pflag ) return( 1 ); X setfno( r.f.fn ); X continue; X--- 141,147 ---- X*************** X*** 170,180 **** X X /* now look up s */ X for( i=0; i= FSZ ) error( "more than %d files", FSZ ); X- #ifndef FLEXNAMES X- strncpy( fnm[ffree], s, LFNM ); X- #else X fnm[ffree] = s; X- #endif X cfno = ffree++; X } X X--- 172,178 ---- X*************** X*** 193,203 **** X /* VARARGS */ X error( s, a ) char *s; { X X- #ifndef FLEXNAMES X- fprintf( stderr, "pass 2 error:(file %.*s) ", LFNM, fnm[cfno] ); X- #else X fprintf( stderr, "pass 2 error:(file %s) ", fnm[cfno] ); X- #endif X fprintf( stderr, s, a ); X fprintf( stderr, "\n" ); X exit(1); X--- 179,185 ---- X*************** X*** 209,215 **** X #ifndef FLEXNAMES X h = hashstr(r.l.name, LCHNM) % NSZ; X #else X! h = (int)r.l.name % NSZ; X #endif X { register STAB *p, *q; X for( p=q= &stab[h]; q->decflag; ){ X--- 191,197 ---- X #ifndef FLEXNAMES X h = hashstr(r.l.name, LCHNM) % NSZ; X #else X! h = (unsigned int)r.l.name % NSZ; X #endif X { register STAB *p, *q; X for( p=q= &stab[h]; q->decflag; ){ X*************** X*** 337,351 **** X X viceversa(q) STAB *q; { X /* print out file comparison */ X! #ifndef FLEXNAMES X! printf( " %.*s(%d) :: %.*s(%d)\n", X! LFNM, fnm[q->fno], q->fline, X! LFNM, fnm[cfno], r.l.fline ); X! #else X printf( " %s(%d) :: %s(%d)\n", X fnm[q->fno], q->fline, X fnm[cfno], r.l.fline ); X- #endif X } X X /* messages for defintion/use */ X--- 319,328 ---- X X viceversa(q) STAB *q; { X /* print out file comparison */ X! X printf( " %s(%d) :: %s(%d)\n", X fnm[q->fno], q->fline, X fnm[cfno], r.l.fline ); X } X X /* messages for defintion/use */ X*************** X*** 353,361 **** X mess[2][2] ={ X "", X #ifndef FLEXNAMES X! "%.8s used( %.*s(%d) ), but not defined\n", X! "%.8s defined( %.*s(%d) ), but never used\n", X! "%.8s declared( %.*s(%d) ), but never used or defined\n" X #else X "%s used( %s(%d) ), but not defined\n", X "%s defined( %s(%d) ), but never used\n", X--- 330,338 ---- X mess[2][2] ={ X "", X #ifndef FLEXNAMES X! "%.8s used( %s(%d) ), but not defined\n", X! "%.8s defined( %s(%d) ), but never used\n", X! "%.8s declared( %s(%d) ), but never used or defined\n" X #else X "%s used( %s(%d) ), but not defined\n", X "%s defined( %s(%d) ), but never used\n", X*************** X*** 397,419 **** X } X } X if( uflag && ( nu || nd ) ) X- #ifndef FLEXNAMES X- printf( mess[nu][nd], q->name, LFNM, fnm[q->fno], q->fline ); X- #else X printf( mess[nu][nd], q->name, fnm[q->fno], q->fline ); X- #endif X X if( (uses&(RVAL+EUSED)) == (RVAL+EUSED) ){ X /* if functions is static, then print the file name too */ X if( q->decflag & LST ) X- #ifndef FLEXNAMES X- printf( "%.*s(%d):", LFNM, fnm[q->fno], q->fline ); X- #else X printf( "%s(%d):", fnm[q->fno], q->fline ); X- #endif X #ifndef FLEXNAMES X! printf( "%.*s returns value which is %s ignored\n", X! LCHNM, q->name, uses&VUSED ? "sometimes" : "always" ); X #else X printf( "%s returns value which is %s ignored\n", X q->name, uses&VUSED ? "sometimes" : "always" ); X--- 374,388 ---- X } X } X if( uflag && ( nu || nd ) ) X printf( mess[nu][nd], q->name, fnm[q->fno], q->fline ); X X if( (uses&(RVAL+EUSED)) == (RVAL+EUSED) ){ X /* if functions is static, then print the file name too */ X if( q->decflag & LST ) X printf( "%s(%d):", fnm[q->fno], q->fline ); X #ifndef FLEXNAMES X! printf( "%.8s returns value which is %s ignored\n", X! q->name, uses&VUSED ? "sometimes" : "always" ); X #else X printf( "%s returns value which is %s ignored\n", X q->name, uses&VUSED ? "sometimes" : "always" ); X*************** X*** 422,435 **** X X if( (uses&(RVAL+VUSED)) == (VUSED) && (q->decflag&(LDI|LIB|LST)) ){ X if( q->decflag & LST ) X- #ifndef FLEXNAMES X- printf( "%.*s(%d):", LFNM, fnm[q->fno], q->fline ); X- #else X printf( "%s(%d):", fnm[q->fno], q->fline ); X- #endif X #ifndef FLEXNAMES X! printf( "%.*s value is used, but none returned\n", X! LCHNM, q->name); X #else X printf( "%s value is used, but none returned\n", q->name); X #endif X--- 391,399 ---- X X if( (uses&(RVAL+VUSED)) == (VUSED) && (q->decflag&(LDI|LIB|LST)) ){ X if( q->decflag & LST ) X printf( "%s(%d):", fnm[q->fno], q->fline ); X #ifndef FLEXNAMES X! printf( "%.8s value is used, but none returned\n", q->name); X #else X printf( "%s value is used, but none returned\n", q->name); X #endif X*************** X*** 444,450 **** X exit(0); X } X X! setuse(q) STAB *q; { /* check new type to ensure that it is used */ X X if( !q->decflag ){ /* new one */ X q->decflag = r.l.decflag; X--- 408,414 ---- X exit(0); X } X X! setuse(q) register STAB *q; { /* check new type to ensure that it is used */ X X if( !q->decflag ){ /* new one */ X q->decflag = r.l.decflag; X*************** X*** 580,596 **** X ptb( r.l.decflag, dfs ); X putchar( '\n' ); X if( r.l.decflag & LFN ){ X- #ifdef FLEXNAMES X printf( "fn\t\t%s\n", r.f.fn ); X- #else X- printf( "fn\t%\t.*s\n", LFNM, r.f.fn ); X- #endif X } X else { X #ifdef FLEXNAMES X printf( "name\t%s\n", r.l.name ); X #else X! printf( "name\t%.*s\n", LCHNM, r.l.name ); X #endif X printf( "nargs\t%d\n", r.l.nargs ); X printf( "fline\t%d\n", r.l.fline ); X--- 544,556 ---- X ptb( r.l.decflag, dfs ); X putchar( '\n' ); X if( r.l.decflag & LFN ){ X printf( "fn\t\t%s\n", r.f.fn ); X } X else { X #ifdef FLEXNAMES X printf( "name\t%s\n", r.l.name ); X #else X! printf( "name\t%.8s\n", r.l.name ); X #endif X printf( "nargs\t%d\n", r.l.nargs ); X printf( "fline\t%d\n", r.l.fline ); X*************** X*** 666,672 **** X } X } X X- #ifdef FLEXNAMES X char * X getstr() X { X--- 626,631 ---- X*************** X*** 686,692 **** X return (hash(buf)); X } X X! #define NSAVETAB 4096 X char *savetab; X int saveleft; X X--- 645,651 ---- X return (hash(buf)); X } X X! #define NSAVETAB 1024 /* was 4096 */ X char *savetab; X int saveleft; X X*************** X*** 717,724 **** X /* X * The definition for the segmented hash tables. X */ X! #define MAXHASH 20 X! #define HASHINC 1013 X struct ht { X char **ht_low; X char **ht_high; X--- 676,683 ---- X /* X * The definition for the segmented hash tables. X */ X! #define MAXHASH 30 X! #define HASHINC 111 /* was 1013 */ X struct ht { X char **ht_low; X char **ht_high; X*************** X*** 782,785 **** X exit(1); X } X char *tstrbuf[1]; X- #endif X--- 741,743 ---- SHAR_EOF fi exit 0 # End of shell archive