convert namelist structure to use unions
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Fri, 27 Aug 1982 15:32:59 +0000 (07:32 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Fri, 27 Aug 1982 15:32:59 +0000 (07:32 -0800)
SCCS-vsn: usr.bin/pascal/src/p2put.c 1.10
SCCS-vsn: usr.bin/pascal/src/stab.c 1.7
SCCS-vsn: usr.bin/pascal/src/lookup.c 1.2

usr/src/usr.bin/pascal/src/lookup.c
usr/src/usr.bin/pascal/src/p2put.c
usr/src/usr.bin/pascal/src/stab.c

index bfdca82..01f4bdb 100644 (file)
@@ -1,10 +1,12 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)lookup.c 1.1 %G%";
+static char sccsid[] = "@(#)lookup.c 1.2 %G%";
 
 #include "whoami.h"
 #include "0.h"
 
 
 #include "whoami.h"
 #include "0.h"
 
+struct nl *disptab[077+1];
+
 /*
  * Lookup is called to
  * find a symbol in the
 /*
  * Lookup is called to
  * find a symbol in the
index 417f1a2..6513ea7 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)p2put.c 1.9 %G%";
+static char sccsid[] = "@(#)p2put.c 1.10 %G%";
 
     /*
      * functions to help pi put out
 
     /*
      * functions to help pi put out
@@ -212,11 +212,11 @@ putleaf( op , lval , rval , type , name )
      * special cases for registers and for named globals,
      * whose names are their rvalues.
      */
      * special cases for registers and for named globals,
      * whose names are their rvalues.
      */
-putRV( name , level , offset , extra_flags , type )
+putRV( name , level , offset , other_flags , type )
     char       *name;
     int                level;
     int                offset;
     char       *name;
     int                level;
     int                offset;
-    char       extra_flags;
+    char       other_flags;
     int                type;
     {
        char    extname[ BUFSIZ ];
     int                type;
     {
        char    extname[ BUFSIZ ];
@@ -225,14 +225,14 @@ putRV( name , level , offset , extra_flags , type )
 
        if ( !CGENNING )
            return;
 
        if ( !CGENNING )
            return;
-       if ( extra_flags & NREGVAR ) {
+       if ( other_flags & NREGVAR ) {
            if ( ( offset < 0 ) || ( offset > P2FP ) ) {
                panic( "putRV regvar" );
            }
            putleaf( P2REG , 0 , offset , type , 0 );
            return;
        }
            if ( ( offset < 0 ) || ( offset > P2FP ) ) {
                panic( "putRV regvar" );
            }
            putleaf( P2REG , 0 , offset , type , 0 );
            return;
        }
-       if ( whereis( level , offset , extra_flags ) == GLOBALVAR ) {
+       if ( whereis( level , offset , other_flags ) == GLOBALVAR ) {
            if ( name != 0 ) {
                if ( name[0] != '_' ) {
                        sprintf( extname , EXTFORMAT , name );
            if ( name != 0 ) {
                if ( name[0] != '_' ) {
                        sprintf( extname , EXTFORMAT , name );
@@ -246,7 +246,7 @@ putRV( name , level , offset , extra_flags , type )
                panic( "putRV no name" );
            }
        }
                panic( "putRV no name" );
            }
        }
-       putLV( name , level , offset , extra_flags , type );
+       putLV( name , level , offset , other_flags , type );
        putop( P2UNARY P2MUL , type );
     }
 
        putop( P2UNARY P2MUL , type );
     }
 
@@ -256,11 +256,11 @@ putRV( name , level , offset , extra_flags , type )
      * special case for
      *     named globals, whose lvalues are just their names as constants.
      */
      * special case for
      *     named globals, whose lvalues are just their names as constants.
      */
-putLV( name , level , offset , extra_flags , type )
+putLV( name , level , offset , other_flags , type )
     char       *name;
     int                level;
     int                offset;
     char       *name;
     int                level;
     int                offset;
-    char       extra_flags;
+    char       other_flags;
     int                type;
 {
     char               extname[ BUFSIZ ];
     int                type;
 {
     char               extname[ BUFSIZ ];
@@ -268,10 +268,10 @@ putLV( name , level , offset , extra_flags , type )
 
     if ( !CGENNING )
        return;
 
     if ( !CGENNING )
        return;
-    if ( extra_flags & NREGVAR ) {
+    if ( other_flags & NREGVAR ) {
        panic( "putLV regvar" );
     }
        panic( "putLV regvar" );
     }
-    switch ( whereis( level , offset , extra_flags ) ) {
+    switch ( whereis( level , offset , other_flags ) ) {
        case GLOBALVAR:
            if ( ( name != 0 ) ) {
                if ( name[0] != '_' ) {
        case GLOBALVAR:
            if ( ( name != 0 ) ) {
                if ( name[0] != '_' ) {
@@ -315,8 +315,8 @@ putLV( name , level , offset , extra_flags , type )
      * the constant is declared in aligned data space
      * and a P2NAME leaf put out for it
      */
      * the constant is declared in aligned data space
      * and a P2NAME leaf put out for it
      */
-putCON8( value )
-    double     value;
+putCON8( val )
+    double     val;
     {
        int     label;
        char    name[ BUFSIZ ];
     {
        int     label;
        char    name[ BUFSIZ ];
@@ -327,7 +327,7 @@ putCON8( value )
        putprintf( "    .align 2" , 0 );
        label = getlab();
        putlab( label );
        putprintf( "    .align 2" , 0 );
        label = getlab();
        putlab( label );
-       putprintf( "    .double 0d%.20e" , 0 , value );
+       putprintf( "    .double 0d%.20e" , 0 , val );
        putprintf( "    .text" , 0 );
        sprintf( name , PREFIXFORMAT , LABELPREFIX , label );
        putleaf( P2NAME , 0 , 0 , P2DOUBLE , name );
        putprintf( "    .text" , 0 );
        sprintf( name , PREFIXFORMAT , LABELPREFIX , label );
        putleaf( P2NAME , 0 , 0 , P2DOUBLE , name );
index e81c262..d1447da 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1980 Regents of the University of California */
 
 /* Copyright (c) 1980 Regents of the University of California */
 
-static char sccsid[] = "@(#)stab.c 1.6 %G%";
+static char sccsid[] = "@(#)stab.c 1.7 %G%";
 
     /*
      * procedures to put out sdb symbol table information.
 
     /*
      * procedures to put out sdb symbol table information.
@@ -152,9 +152,9 @@ stabrbrac( level )
     /*
      * functions
      */
     /*
      * functions
      */
-stabfunc( name , class , line , level )
+stabfunc( name , typeclass , line , level )
     char       *name;
     char       *name;
-    int                class;
+    int                typeclass;
     int                line;
     long       level;
     {
     int                line;
     long       level;
     {
@@ -166,10 +166,10 @@ stabfunc( name , class , line , level )
             *  for separate compilation
             */
        if ( level == 1 ) {
             *  for separate compilation
             */
        if ( level == 1 ) {
-           if ( class == FUNC ) {
+           if ( typeclass == FUNC ) {
                putprintf( "    .stabs  \"%s\",0x%x,0,0x%x,0x%x" , 0 
                            , name , N_PC , N_PGFUNC , ABS( line ) );
                putprintf( "    .stabs  \"%s\",0x%x,0,0x%x,0x%x" , 0 
                            , name , N_PC , N_PGFUNC , ABS( line ) );
-           } else if ( class == PROC ) {
+           } else if ( typeclass == PROC ) {
                putprintf( "    .stabs  \"%s\",0x%x,0,0x%x,0x%x" , 0 
                            , name , N_PC , N_PGPROC , ABS( line ) );
            }
                putprintf( "    .stabs  \"%s\",0x%x,0,0x%x,0x%x" , 0 
                            , name , N_PC , N_PGPROC , ABS( line ) );
            }
@@ -304,16 +304,16 @@ stabgtype( type , line )
     /*
      * external functions and procedures
      */        
     /*
      * external functions and procedures
      */        
-stabefunc( name , class , line )
+stabefunc( name , typeclass , line )
     char       *name;
     char       *name;
-    int                class;
+    int                typeclass;
     int                line;
     {
        int     type;
 
     int                line;
     {
        int     type;
 
-       if ( class == FUNC ) {
+       if ( typeclass == FUNC ) {
            type = N_PEFUNC;
            type = N_PEFUNC;
-       } else if ( class == PROC ) {
+       } else if ( typeclass == PROC ) {
            type = N_PEPROC;
        } else {
            return;
            type = N_PEPROC;
        } else {
            return;