idf.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740
  1. /*
  2. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  3. * See the copyright notice in the ACK home directory, in the file "Copyright".
  4. */
  5. /* $Id$ */
  6. /* IDENTIFIER FIDDLING & SYMBOL TABLE HANDLING */
  7. #include <stdlib.h>
  8. #include <stdio.h>
  9. #include <string.h>
  10. #include "lint.h"
  11. #include <em_reg.h>
  12. #include "nofloat.h"
  13. #include "debug.h"
  14. #include "idfsize.h"
  15. #include "botch_free.h"
  16. #include "nopp.h"
  17. #include <alloc.h>
  18. #include "arith.h"
  19. #include "align.h"
  20. #include "LLlex.h"
  21. #include "level.h"
  22. #include "stack.h"
  23. #include "idf.h"
  24. #include "label.h"
  25. #include "def.h"
  26. #include "type.h"
  27. #include "struct.h"
  28. #include "declar.h"
  29. #include "decspecs.h"
  30. #include "sizes.h"
  31. #include "Lpars.h"
  32. #include "assert.h"
  33. #include "specials.h" /* registration of special identifiers */
  34. #include "noRoption.h"
  35. int idfsize = IDFSIZE;
  36. extern char options[];
  37. extern arith NewLocal();
  38. char sp_occurred[SP_TOTAL+1]; /* indicate occurrence of special id */
  39. struct idf *idf_hashtable[HASHSIZE];
  40. /* All identifiers can in principle be reached through
  41. idf_hashtable; idf_hashtable[hc] is the start of a chain of
  42. idf's whose tags all hash to hc. Each idf is the start of
  43. a chain of def's for that idf, sorted according to level,
  44. with the most recent one on top.
  45. Any identifier occurring on a level is entered into this
  46. list, regardless of the nature of its declaration
  47. (variable, selector, structure tag, etc.).
  48. */
  49. struct idf *
  50. idf_hashed(tg, size, hc)
  51. char *tg;
  52. int size; /* includes the '\0' character */
  53. int hc;
  54. {
  55. /* The tag tg with length size and known hash value hc is
  56. looked up in the identifier table; if not found, it is
  57. entered. A pointer to it is returned.
  58. The identifier has already been truncated to idfsize
  59. characters.
  60. */
  61. register struct idf **hook = &idf_hashtable[hc], *notch;
  62. while ((notch = *hook)) {
  63. register char *s1 = tg;
  64. register char *cp = notch->id_text;
  65. register int cmp;
  66. while (!(cmp = (*s1 - *cp++))) {
  67. if (*s1++ == '\0') {
  68. break;
  69. }
  70. }
  71. if (cmp < 0)
  72. break;
  73. if (cmp == 0) {
  74. /* suppose that special identifiers, as
  75. "setjmp", are already inserted
  76. */
  77. sp_occurred[notch->id_special] = 1;
  78. return notch;
  79. }
  80. hook = &notch->next;
  81. }
  82. /* a new struct idf must be inserted at the hook */
  83. notch = new_idf();
  84. notch->next = *hook;
  85. *hook = notch; /* hooked in */
  86. notch->id_text = Salloc(tg, (unsigned) size);
  87. #ifndef NOPP
  88. notch->id_resmac = 0;
  89. #endif /* NOPP */
  90. return notch;
  91. }
  92. #ifdef DEBUG
  93. hash_stat()
  94. {
  95. if (options['h']) {
  96. register int i;
  97. print("Hash table tally:\n");
  98. for (i = 0; i < HASHSIZE; i++) {
  99. register struct idf *notch = idf_hashtable[i];
  100. int cnt = 0;
  101. while (notch) {
  102. cnt++;
  103. notch = notch->next;
  104. }
  105. print("%d %d\n", i, cnt);
  106. }
  107. print("End hash table tally\n");
  108. }
  109. }
  110. #endif /* DEBUG */
  111. struct idf *
  112. str2idf(tg)
  113. char tg[];
  114. {
  115. /* str2idf() returns an entry in the symbol table for the
  116. identifier tg. If necessary, an entry is created.
  117. It is used where the text of the identifier is available
  118. but its hash value is not; otherwise idf_hashed() is to
  119. be used.
  120. */
  121. register char *cp = tg;
  122. register int hash;
  123. register int pos = -1;
  124. register int ch;
  125. char ntg[IDFSIZE + 1];
  126. register char *ncp = ntg;
  127. hash = STARTHASH();
  128. while (++pos < idfsize && (ch = *cp++)) {
  129. *ncp++ = ch;
  130. hash = ENHASH(hash, ch, pos);
  131. }
  132. hash = STOPHASH(hash);
  133. *ncp++ = '\0';
  134. return idf_hashed(ntg, ncp - ntg, hash);
  135. }
  136. struct idf *
  137. gen_idf()
  138. {
  139. /* A new idf is created out of nowhere, to serve as an
  140. anonymous name.
  141. */
  142. static int name_cnt;
  143. struct idf *id;
  144. char *s = Malloc(strlen(dot.tk_file)+50);
  145. sprint(s, "#%d in %s, line %u",
  146. ++name_cnt, dot.tk_file, dot.tk_line);
  147. id = str2idf(s);
  148. free(s);
  149. return id;
  150. }
  151. int
  152. is_anon_idf(idf)
  153. struct idf *idf;
  154. {
  155. return idf->id_text[0] == '#';
  156. }
  157. declare_idf(ds, dc, lvl)
  158. struct decspecs *ds;
  159. struct declarator *dc;
  160. {
  161. /* The identifier inside dc is declared on the level lvl, with
  162. properties deduced from the decspecs ds and the declarator
  163. dc.
  164. The level is given explicitly to be able to insert, e.g.,
  165. labels on the outermost level inside the function.
  166. This routine implements the rich semantics of C
  167. declarations.
  168. */
  169. register struct idf *idf = dc->dc_idf;
  170. register int sc = ds->ds_sc;
  171. /* This local copy is essential:
  172. char b(), c;
  173. makes b GLOBAL and c AUTO.
  174. */
  175. register struct def *def = idf->id_def; /* may be NULL */
  176. register struct type *type;
  177. struct stack_level *stl = stack_level_of(lvl);
  178. char formal_array = 0;
  179. /* determine the present type */
  180. if (ds->ds_type == 0) {
  181. /* at the L_FORMAL1 level there is no type specified yet
  182. */
  183. ASSERT(lvl == L_FORMAL1);
  184. type = int_type; /* may change at L_FORMAL2 */
  185. }
  186. else {
  187. /* combine the decspecs and the declarator into one type */
  188. type = declare_type(ds->ds_type, dc);
  189. if (type->tp_size <= (arith)0 &&
  190. actual_declaration(sc, type)) {
  191. if (type->tp_size == (arith) -1) {
  192. /* the type is not yet known,
  193. but it has to be:
  194. */
  195. extern char *symbol2str();
  196. error("unknown %s-type",
  197. symbol2str(type->tp_fund));
  198. }
  199. else if (type->tp_fund != LABEL) {
  200. /* CJ */
  201. warning("%s has size 0", idf->id_text);
  202. }
  203. }
  204. }
  205. /* some additional work for formal definitions */
  206. if (lvl == L_FORMAL2) {
  207. switch (type->tp_fund) {
  208. case FUNCTION:
  209. warning("%s is a function; cannot be formal",
  210. idf->id_text);
  211. type = construct_type(POINTER, type, (arith)0);
  212. break;
  213. case ARRAY: /* RM 10.1 */
  214. type = construct_type(POINTER, type->tp_up, (arith)0);
  215. formal_array = 1;
  216. break;
  217. #ifndef NOFLOAT
  218. case FLOAT: /* RM 10.1 */
  219. type = double_type;
  220. break;
  221. #endif /* NOFLOAT */
  222. case CHAR:
  223. case SHORT:
  224. /* The RM is not clear about this: we must
  225. convert the parameter from int (they have
  226. been pushed as ints) to the specified type.
  227. The conversion to type int or uint is not
  228. allowed.
  229. */
  230. break;
  231. }
  232. }
  233. /* The tests on types, postponed from do_decspecs(), can now
  234. be performed.
  235. */
  236. /* update the storage class */
  237. if (type && type->tp_fund == FUNCTION) {
  238. if (sc == 0 || (ds->ds_sc_given && sc == AUTO)) /* RM 8.1 */
  239. sc = GLOBAL;
  240. else
  241. if (sc == REGISTER) {
  242. error("function storage class cannot be register");
  243. ds->ds_sc = sc = GLOBAL;
  244. }
  245. }
  246. else /* non-FUNCTION */
  247. if (sc == 0)
  248. sc = lvl == L_GLOBAL ? GLOBAL
  249. : lvl == L_FORMAL1 || lvl == L_FORMAL2 ? FORMAL
  250. : AUTO;
  251. #ifndef NOROPTION
  252. if (options['R']) { /* some special K & R tests */
  253. /* is it also an enum? */
  254. if (idf->id_enum && idf->id_enum->tg_level == level)
  255. warning("%s is also an enum tag", idf->id_text);
  256. /* is it a universal typedef? */
  257. if (def && def->df_level == L_UNIVERSAL)
  258. warning("redeclaring reserved word %s", idf->id_text);
  259. }
  260. #endif
  261. #ifdef LINT
  262. check_hiding(idf, lvl, sc); /* of some idf by this idf */
  263. #endif /* LINT */
  264. if (def &&
  265. ( def->df_level == lvl ||
  266. ( lvl != L_GLOBAL && def->df_level > lvl )
  267. )
  268. ) {
  269. /* There is already a declaration for idf on this
  270. level, or even more inside.
  271. The rules differ for different levels.
  272. */
  273. switch (lvl) {
  274. case L_GLOBAL:
  275. global_redecl(idf, sc, type);
  276. def->df_file = idf->id_file;
  277. def->df_line = idf->id_line;
  278. break;
  279. case L_FORMAL1: /* formal declaration */
  280. error("formal %s redeclared", idf->id_text);
  281. break;
  282. case L_FORMAL2: /* formal definition */
  283. default: /* local */
  284. error("%s redeclared", idf->id_text);
  285. break;
  286. }
  287. }
  288. else /* the idf is unknown on this level */
  289. if (lvl == L_FORMAL2 && sc != ENUM && good_formal(def, idf)) {
  290. /* formal declaration, update only */
  291. def->df_type = type;
  292. def->df_formal_array = formal_array;
  293. def->df_sc = sc;
  294. def->df_level = L_FORMAL2; /* CJ */
  295. def->df_file = idf->id_file;
  296. def->df_line = idf->id_line;
  297. }
  298. else
  299. if ( lvl >= L_LOCAL &&
  300. (type->tp_fund == FUNCTION || sc == EXTERN)
  301. ) {
  302. /* extern declaration inside function is treated the
  303. same way as global extern declaration
  304. */
  305. #ifndef NOROPTION
  306. if ( options['R'] &&
  307. (sc == STATIC && type->tp_fund == FUNCTION)
  308. )
  309. if (!is_anon_idf(idf))
  310. warning("non-global static function %s",
  311. idf->id_text);
  312. #endif
  313. declare_idf(ds, dc, L_GLOBAL);
  314. }
  315. else { /* fill in the def block */
  316. register struct def *newdef = new_def();
  317. newdef->next = def;
  318. newdef->df_level = lvl;
  319. newdef->df_type = type;
  320. newdef->df_sc = sc;
  321. newdef->df_file = idf->id_file;
  322. newdef->df_line = idf->id_line;
  323. #ifdef LINT
  324. newdef->df_set = 0;
  325. newdef->df_firstbrace = 0;
  326. #endif /* LINT */
  327. /* link it into the name list in the proper place */
  328. idf->id_def = newdef;
  329. update_ahead(idf);
  330. stack_idf(idf, stl);
  331. /* We now calculate the address.
  332. Globals have names and don't get addresses, they
  333. get numbers instead (through data_label()).
  334. Formals are handled by declare_formals().
  335. So here we hand out local addresses only.
  336. */
  337. if (lvl >= L_LOCAL) {
  338. ASSERT(sc);
  339. switch (sc) {
  340. case REGISTER:
  341. case AUTO:
  342. if (type->tp_size == (arith)-1) {
  343. error("size of local %s unknown",
  344. idf->id_text);
  345. /** type = idf->id_def->df_type = int_type; **/
  346. }
  347. newdef->df_address =
  348. NewLocal(type->tp_size,
  349. type->tp_align,
  350. regtype(type),
  351. sc);
  352. break;
  353. case STATIC:
  354. newdef->df_address = (arith) data_label();
  355. break;
  356. }
  357. }
  358. }
  359. }
  360. actual_declaration(sc, tp)
  361. int sc;
  362. struct type *tp;
  363. {
  364. /* An actual_declaration needs space, right here and now.
  365. */
  366. register int fund = tp->tp_fund;
  367. if (sc == ENUM || sc == TYPEDEF) /* virtual declarations */
  368. return 0;
  369. if (fund == FUNCTION || fund == ARRAY)
  370. /* allocation solved in other ways */
  371. return 0;
  372. /* to be allocated */
  373. return 1;
  374. }
  375. global_redecl(idf, new_sc, tp)
  376. register struct idf *idf;
  377. register struct type *tp;
  378. {
  379. /* A global identifier may be declared several times,
  380. provided the declarations do not conflict; they might
  381. conflict in type (or supplement each other in the case of
  382. an array) or they might conflict or supplement each other
  383. in storage class.
  384. */
  385. register struct def *def = idf->id_def;
  386. if (tp != def->df_type) {
  387. register struct type *otp = def->df_type;
  388. if ( tp->tp_fund != ARRAY || otp->tp_fund != ARRAY ||
  389. tp->tp_up != otp->tp_up
  390. ) {
  391. error("redeclaration of %s with different type",
  392. idf->id_text);
  393. return;
  394. }
  395. /* Multiple array declaration; this may be interesting */
  396. if (tp->tp_size < 0) { /* new decl has [] */
  397. /* nothing new */
  398. }
  399. else
  400. if (otp->tp_size < 0) { /* old decl has [] */
  401. def->df_type = tp;
  402. }
  403. else
  404. if (tp->tp_size != otp->tp_size)
  405. error("inconsistent size in redeclaration of array %s",
  406. idf->id_text);
  407. }
  408. /* Now we may be able to update the storage class.
  409. Clean out this mess as soon as we know all the possibilities
  410. for new_sc.
  411. For now we have:
  412. EXTERN: we have seen the word "extern"
  413. GLOBAL: the item was declared on the outer
  414. level, without either "extern" or
  415. "static".
  416. STATIC: we have seen the word "static"
  417. IMPLICIT: function declaration inferred from
  418. call
  419. */
  420. if (new_sc == IMPLICIT)
  421. return; /* no new information */
  422. switch (def->df_sc) { /* the old storage class */
  423. case EXTERN:
  424. switch (new_sc) { /* the new storage class */
  425. case EXTERN:
  426. case GLOBAL:
  427. break;
  428. case STATIC:
  429. if (def->df_initialized) {
  430. error("cannot redeclare %s to static",
  431. idf->id_text);
  432. }
  433. else {
  434. warning("%s redeclared to static",
  435. idf->id_text);
  436. }
  437. def->df_sc = new_sc;
  438. break;
  439. default:
  440. crash("bad storage class");
  441. /*NOTREACHED*/
  442. }
  443. break;
  444. case GLOBAL:
  445. switch (new_sc) { /* the new storage class */
  446. case EXTERN:
  447. def->df_sc = EXTERN;
  448. break;
  449. case GLOBAL:
  450. break;
  451. case STATIC:
  452. if (def->df_initialized)
  453. error("cannot redeclare %s to static",
  454. idf->id_text);
  455. else {
  456. #ifdef LINT
  457. /* warn unconditionally */
  458. warning("%s redeclared to static",
  459. idf->id_text);
  460. #else /* LINT */
  461. #ifndef NOROPTION
  462. /* warn conditionally */
  463. if (options['R'])
  464. warning("%s redeclared to static",
  465. idf->id_text);
  466. #endif /* NOROPTION */
  467. #endif /* LINT */
  468. def->df_sc = STATIC;
  469. }
  470. break;
  471. default:
  472. crash("bad storage class");
  473. /*NOTREACHED*/
  474. }
  475. break;
  476. case STATIC:
  477. switch (new_sc) { /* the new storage class */
  478. case EXTERN:
  479. if (def->df_initialized)
  480. error("cannot redeclare %s to extern",
  481. idf->id_text);
  482. else {
  483. warning("%s redeclared to extern",
  484. idf->id_text);
  485. def->df_sc = EXTERN;
  486. }
  487. break;
  488. case GLOBAL:
  489. case STATIC:
  490. if (def->df_type->tp_fund != FUNCTION)
  491. warning("%s was already static",
  492. idf->id_text);
  493. break;
  494. default:
  495. crash("bad storage class");
  496. /*NOTREACHED*/
  497. }
  498. break;
  499. case IMPLICIT:
  500. switch (new_sc) { /* the new storage class */
  501. case EXTERN:
  502. case GLOBAL:
  503. def->df_sc = new_sc;
  504. break;
  505. case STATIC:
  506. #ifndef NOROPTION
  507. if (options['R'])
  508. warning("%s was implicitly declared as extern",
  509. idf->id_text);
  510. #endif
  511. def->df_sc = new_sc;
  512. break;
  513. default:
  514. crash("bad storage class");
  515. /*NOTREACHED*/
  516. }
  517. break;
  518. case ENUM:
  519. case TYPEDEF:
  520. error("illegal redeclaration of %s", idf->id_text);
  521. break;
  522. default:
  523. crash("bad storage class");
  524. /*NOTREACHED*/
  525. }
  526. }
  527. int
  528. good_formal(def, idf)
  529. register struct def *def;
  530. register struct idf *idf;
  531. {
  532. /* Succeeds if def is a proper L_FORMAL1 definition and
  533. gives an error message otherwise.
  534. */
  535. if (!def || def->df_level != L_FORMAL1) { /* not in parameter list */
  536. if (!is_anon_idf(idf))
  537. error("%s not in parameter list", idf->id_text);
  538. return 0;
  539. }
  540. ASSERT(def->df_sc == FORMAL); /* CJ */
  541. return 1;
  542. }
  543. declare_params(dc)
  544. register struct declarator *dc;
  545. {
  546. /* Declares the formal parameters if they exist.
  547. */
  548. register struct formal *fm = dc->dc_formal;
  549. while (fm) {
  550. declare_parameter(fm->fm_idf);
  551. fm = fm->next;
  552. }
  553. free_formals(dc->dc_formal);
  554. dc->dc_formal = 0;
  555. }
  556. init_idf(idf)
  557. register struct idf *idf;
  558. {
  559. /* The topmost definition of idf is set to initialized.
  560. */
  561. register struct def *def = idf->id_def; /* the topmost */
  562. if (def->df_initialized)
  563. error("multiple initialization of %s", idf->id_text);
  564. if (def->df_sc == TYPEDEF) {
  565. warning("typedef cannot be initialized");
  566. def->df_sc = EXTERN; /* ??? *//* What else ? */
  567. }
  568. def->df_initialized = 1;
  569. }
  570. declare_parameter(idf)
  571. struct idf *idf;
  572. {
  573. /* idf is declared as a formal.
  574. */
  575. add_def(idf, FORMAL, int_type, level);
  576. }
  577. declare_enum(tp, idf, l)
  578. struct type *tp;
  579. struct idf *idf;
  580. arith l;
  581. {
  582. /* idf is declared as an enum constant with value l.
  583. */
  584. add_def(idf, ENUM, tp, level);
  585. idf->id_def->df_address = l;
  586. }
  587. declare_formals(fp)
  588. arith *fp;
  589. {
  590. /* Declares those formals as int that haven't been declared
  591. by the user.
  592. An address is assigned to each formal parameter.
  593. The total size of the formals is returned in *fp;
  594. */
  595. register struct stack_entry *se = stack_level_of(L_FORMAL1)->sl_entry;
  596. arith f_offset = (arith)0;
  597. #ifdef DEBUG
  598. if (options['t'])
  599. dumpidftab("start declare_formals", 0);
  600. #endif /* DEBUG */
  601. while (se) {
  602. register struct def *def = se->se_idf->id_def;
  603. def->df_address = f_offset;
  604. /* the alignment convention for parameters is: align on
  605. word boundaries, i.e. take care that the following
  606. parameter starts on a new word boundary.
  607. */
  608. f_offset = align(f_offset + def->df_type->tp_size, (int) word_size);
  609. formal_cvt(def); /* cvt int to char or short, if necessary */
  610. def->df_level = L_FORMAL2; /* CJ */
  611. RegisterAccount(def->df_address, def->df_type->tp_size,
  612. regtype(def->df_type),
  613. def->df_sc);
  614. #ifdef DBSYMTAB
  615. if (options['g']) {
  616. stb_string(def, FORMAL, se->se_idf->id_text);
  617. }
  618. #endif /* DBSYMTAB */
  619. se = se->next;
  620. }
  621. *fp = f_offset;
  622. }
  623. int
  624. regtype(tp)
  625. struct type *tp;
  626. {
  627. switch(tp->tp_fund) {
  628. case INT:
  629. case LONG:
  630. return reg_any;
  631. #ifndef NOFLOAT
  632. case FLOAT:
  633. case DOUBLE:
  634. return reg_float;
  635. #endif /* NOFLOAT */
  636. case POINTER:
  637. return reg_pointer;
  638. }
  639. return -1;
  640. }
  641. add_def(idf, sc, tp, lvl)
  642. struct idf *idf;
  643. struct type *tp;
  644. int lvl;
  645. int sc;
  646. {
  647. /* The identifier idf is declared on level lvl with storage
  648. class sc and type tp, through a faked C declaration.
  649. This is probably the wrong way to structure the problem,
  650. but it will have to do for the time being.
  651. */
  652. struct decspecs Ds; struct declarator Dc;
  653. Ds = null_decspecs;
  654. Ds.ds_type = tp;
  655. Ds.ds_sc = sc;
  656. Dc = null_declarator;
  657. Dc.dc_idf = idf;
  658. declare_idf(&Ds, &Dc, lvl);
  659. }
  660. update_ahead(idf)
  661. register struct idf *idf;
  662. {
  663. /* The tk_symb of the token ahead is updated in the light of new
  664. information about the identifier idf.
  665. */
  666. register int tk_symb = AHEAD;
  667. if ( (tk_symb == IDENTIFIER || tk_symb == TYPE_IDENTIFIER) &&
  668. ahead.tk_idf == idf
  669. )
  670. AHEAD = idf->id_def && idf->id_def->df_sc == TYPEDEF ?
  671. TYPE_IDENTIFIER : IDENTIFIER;
  672. }
  673. free_formals(fm)
  674. register struct formal *fm;
  675. {
  676. while (fm) {
  677. struct formal *tmp = fm->next;
  678. free_formal(fm);
  679. fm = tmp;
  680. }
  681. }
  682. char hmask[IDFSIZE];
  683. init_hmask()
  684. {
  685. /* A simple congruence random number generator, as
  686. described in Knuth, vol 2.
  687. */
  688. register int h, rnd = HASH_X;
  689. for (h = 0; h < IDFSIZE; h++) {
  690. hmask[h] = rnd;
  691. rnd = (HASH_A * rnd + HASH_C) & HASHMASK;
  692. }
  693. }