[BACK]Return to sym.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / lex

Diff for /src/usr.bin/lex/sym.c between version 1.4 and 1.5

version 1.4, 2001/06/17 07:30:42 version 1.5, 2001/11/19 19:02:14
Line 35 
Line 35 
   
 /* declare functions that have forward references */  /* declare functions that have forward references */
   
 int hashfunct PROTO((register char[], int));  int hashfunct PROTO((char[], int));
   
   
 struct hash_entry *ndtbl[NAME_TABLE_HASH_SIZE];  struct hash_entry *ndtbl[NAME_TABLE_HASH_SIZE];
Line 51 
Line 51 
  */   */
   
 int addsym( sym, str_def, int_def, table, table_size )  int addsym( sym, str_def, int_def, table, table_size )
 register char sym[];  char sym[];
 char *str_def;  char *str_def;
 int int_def;  int int_def;
 hash_table table;  hash_table table;
 int table_size;  int table_size;
         {          {
         int hash_val = hashfunct( sym, table_size );          int hash_val = hashfunct( sym, table_size );
         register struct hash_entry *sym_entry = table[hash_val];          struct hash_entry *sym_entry = table[hash_val];
         register struct hash_entry *new_entry;          struct hash_entry *new_entry;
         register struct hash_entry *successor;          struct hash_entry *successor;
   
         while ( sym_entry )          while ( sym_entry )
                 {                  {
Line 130 
Line 130 
 /* findsym - find symbol in symbol table */  /* findsym - find symbol in symbol table */
   
 struct hash_entry *findsym( sym, table, table_size )  struct hash_entry *findsym( sym, table, table_size )
 register char sym[];  char sym[];
 hash_table table;  hash_table table;
 int table_size;  int table_size;
         {          {
Line 139 
Line 139 
                 (struct hash_entry *) 0, (struct hash_entry *) 0,                  (struct hash_entry *) 0, (struct hash_entry *) 0,
                 (char *) 0, (char *) 0, 0,                  (char *) 0, (char *) 0, 0,
                 } ;                  } ;
         register struct hash_entry *sym_entry =          struct hash_entry *sym_entry =
                 table[hashfunct( sym, table_size )];                  table[hashfunct( sym, table_size )];
   
         while ( sym_entry )          while ( sym_entry )
Line 156 
Line 156 
 /* hashfunct - compute the hash value for "str" and hash size "hash_size" */  /* hashfunct - compute the hash value for "str" and hash size "hash_size" */
   
 int hashfunct( str, hash_size )  int hashfunct( str, hash_size )
 register char str[];  char str[];
 int hash_size;  int hash_size;
         {          {
         register int hashval;          int hashval;
         register int locstr;          int locstr;
   
         hashval = 0;          hashval = 0;
         locstr = 0;          locstr = 0;

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5