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

Diff for /src/usr.bin/m4/main.c between version 1.18 and 1.19

version 1.18, 1999/11/17 15:34:13 version 1.19, 1999/11/20 17:48:59
Line 440 
Line 440 
         char *name = tp;          char *name = tp;
         char *etp = tp+MAXTOK;          char *etp = tp+MAXTOK;
         ndptr p;          ndptr p;
         unsigned long h = 0;          unsigned h = 0;
   
         while ((isalnum(c = gpbc()) || c == '_') && tp < etp)          while ((isalnum(c = gpbc()) || c == '_') && tp < etp)
                 h = (h << 5) + h + (*tp++ = c);                  h = (h << 5) + h + (*tp++ = c);
Line 450 
Line 450 
   
         *tp = EOS;          *tp = EOS;
   
         for (p = hashtab[h%HASHSIZE]; p != nil; p = p->nxtptr)          for (p = hashtab[h % HASHSIZE]; p != nil; p = p->nxtptr)
                 if (STREQ(name, p->name))                  if (h == p->hv && STREQ(name, p->name))
                         break;                          break;
         return p;          return p;
 }  }
Line 467 
Line 467 
 initkwds()  initkwds()
 {  {
         size_t i;          size_t i;
         int h;          unsigned h;
         ndptr p;          ndptr p;
   
         for (i = 0; i < MAXKEYS; i++) {          for (i = 0; i < MAXKEYS; i++) {
                 h = hash(keywrds[i].knam);                  h = hash(keywrds[i].knam);
                 p = (ndptr) xalloc(sizeof(struct ndblock));                  p = (ndptr) xalloc(sizeof(struct ndblock));
                 p->nxtptr = hashtab[h];                  p->nxtptr = hashtab[h % HASHSIZE];
                 hashtab[h] = p;                  hashtab[h % HASHSIZE] = p;
                 p->name = keywrds[i].knam;                  p->name = keywrds[i].knam;
                 p->defn = null;                  p->defn = null;
                   p->hv = h;
                 p->type = keywrds[i].ktyp | STATIC;                  p->type = keywrds[i].ktyp | STATIC;
         }          }
 }  }

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19