comparison src/elhash.c @ 2286:04bc9d2f42c7

[xemacs-hg @ 2004-09-20 19:18:55 by james] Mark all unused parameters as unused. Also eliminate some unneeded local variables.
author james
date Mon, 20 Sep 2004 19:20:08 +0000
parents a8d8f419b459
children ba4677f54a05
comparison
equal deleted inserted replaced
2285:914c5afaac33 2286:04bc9d2f42c7
295 295
296 /* This is not a great hash function, but it _is_ correct and fast. 296 /* This is not a great hash function, but it _is_ correct and fast.
297 Examining all entries is too expensive, and examining a random 297 Examining all entries is too expensive, and examining a random
298 subset does not yield a correct hash function. */ 298 subset does not yield a correct hash function. */
299 static Hashcode 299 static Hashcode
300 hash_table_hash (Lisp_Object hash_table, int depth) 300 hash_table_hash (Lisp_Object hash_table, int UNUSED (depth))
301 { 301 {
302 return XHASH_TABLE (hash_table)->count; 302 return XHASH_TABLE (hash_table)->count;
303 } 303 }
304 304
305 305
354 354
355 write_c_string (printcharfun, ")"); 355 write_c_string (printcharfun, ")");
356 } 356 }
357 357
358 static void 358 static void
359 print_hash_table (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) 359 print_hash_table (Lisp_Object obj, Lisp_Object printcharfun,
360 int UNUSED (escapeflag))
360 { 361 {
361 Lisp_Hash_Table *ht = XHASH_TABLE (obj); 362 Lisp_Hash_Table *ht = XHASH_TABLE (obj);
362 363
363 write_c_string (printcharfun, 364 write_c_string (printcharfun,
364 print_readably ? "#s(hash-table" : "#<hash-table"); 365 print_readably ? "#s(hash-table" : "#<hash-table");
597 598
598 /* Validation functions: each keyword provides its own validation 599 /* Validation functions: each keyword provides its own validation
599 function. The errors should maybe be continuable, but it is 600 function. The errors should maybe be continuable, but it is
600 unclear how this would cope with ERRB. */ 601 unclear how this would cope with ERRB. */
601 static int 602 static int
602 hash_table_size_validate (Lisp_Object keyword, Lisp_Object value, 603 hash_table_size_validate (Lisp_Object UNUSED (keyword), Lisp_Object value,
603 Error_Behavior errb) 604 Error_Behavior errb)
604 { 605 {
605 if (NATNUMP (value)) 606 if (NATNUMP (value))
606 return 1; 607 return 1;
607 608
608 maybe_signal_error_1 (Qwrong_type_argument, list2 (Qnatnump, value), 609 maybe_signal_error_1 (Qwrong_type_argument, list2 (Qnatnump, value),
609 Qhash_table, errb); 610 Qhash_table, errb);
610 return 0; 611 return 0;
611 } 612 }
612 613
613 static Elemcount 614 static Elemcount
614 decode_hash_table_size (Lisp_Object obj) 615 decode_hash_table_size (Lisp_Object obj)
615 { 616 {
616 return NILP (obj) ? HASH_TABLE_DEFAULT_SIZE : XINT (obj); 617 return NILP (obj) ? HASH_TABLE_DEFAULT_SIZE : XINT (obj);
617 } 618 }
618 619
619 static int 620 static int
620 hash_table_weakness_validate (Lisp_Object keyword, Lisp_Object value, 621 hash_table_weakness_validate (Lisp_Object UNUSED (keyword), Lisp_Object value,
621 Error_Behavior errb) 622 Error_Behavior errb)
622 { 623 {
623 if (EQ (value, Qnil)) return 1; 624 if (EQ (value, Qnil)) return 1;
624 if (EQ (value, Qt)) return 1; 625 if (EQ (value, Qt)) return 1;
625 if (EQ (value, Qkey)) return 1; 626 if (EQ (value, Qkey)) return 1;
659 invalid_constant ("Invalid hash table weakness", obj); 660 invalid_constant ("Invalid hash table weakness", obj);
660 RETURN_NOT_REACHED (HASH_TABLE_NON_WEAK); 661 RETURN_NOT_REACHED (HASH_TABLE_NON_WEAK);
661 } 662 }
662 663
663 static int 664 static int
664 hash_table_test_validate (Lisp_Object keyword, Lisp_Object value, 665 hash_table_test_validate (Lisp_Object UNUSED (keyword), Lisp_Object value,
665 Error_Behavior errb) 666 Error_Behavior errb)
666 { 667 {
667 if (EQ (value, Qnil)) return 1; 668 if (EQ (value, Qnil)) return 1;
668 if (EQ (value, Qeq)) return 1; 669 if (EQ (value, Qeq)) return 1;
669 if (EQ (value, Qequal)) return 1; 670 if (EQ (value, Qequal)) return 1;
670 if (EQ (value, Qeql)) return 1; 671 if (EQ (value, Qeql)) return 1;
671 672
672 maybe_invalid_constant ("Invalid hash table test", 673 maybe_invalid_constant ("Invalid hash table test",
673 value, Qhash_table, errb); 674 value, Qhash_table, errb);
674 return 0; 675 return 0;
675 } 676 }
676 677
677 static enum hash_table_test 678 static enum hash_table_test
678 decode_hash_table_test (Lisp_Object obj) 679 decode_hash_table_test (Lisp_Object obj)
685 invalid_constant ("Invalid hash table test", obj); 686 invalid_constant ("Invalid hash table test", obj);
686 RETURN_NOT_REACHED (HASH_TABLE_EQ); 687 RETURN_NOT_REACHED (HASH_TABLE_EQ);
687 } 688 }
688 689
689 static int 690 static int
690 hash_table_rehash_size_validate (Lisp_Object keyword, Lisp_Object value, 691 hash_table_rehash_size_validate (Lisp_Object UNUSED (keyword),
691 Error_Behavior errb) 692 Lisp_Object value, Error_Behavior errb)
692 { 693 {
693 if (!FLOATP (value)) 694 if (!FLOATP (value))
694 { 695 {
695 maybe_signal_error_1 (Qwrong_type_argument, list2 (Qfloatp, value), 696 maybe_signal_error_1 (Qwrong_type_argument, list2 (Qfloatp, value),
696 Qhash_table, errb); 697 Qhash_table, errb);
716 { 717 {
717 return NILP (rehash_size) ? -1.0 : XFLOAT_DATA (rehash_size); 718 return NILP (rehash_size) ? -1.0 : XFLOAT_DATA (rehash_size);
718 } 719 }
719 720
720 static int 721 static int
721 hash_table_rehash_threshold_validate (Lisp_Object keyword, Lisp_Object value, 722 hash_table_rehash_threshold_validate (Lisp_Object UNUSED (keyword),
722 Error_Behavior errb) 723 Lisp_Object value, Error_Behavior errb)
723 { 724 {
724 if (!FLOATP (value)) 725 if (!FLOATP (value))
725 { 726 {
726 maybe_signal_error_1 (Qwrong_type_argument, list2 (Qfloatp, value), 727 maybe_signal_error_1 (Qwrong_type_argument, list2 (Qfloatp, value),
727 Qhash_table, errb); 728 Qhash_table, errb);
747 { 748 {
748 return NILP (rehash_threshold) ? -1.0 : XFLOAT_DATA (rehash_threshold); 749 return NILP (rehash_threshold) ? -1.0 : XFLOAT_DATA (rehash_threshold);
749 } 750 }
750 751
751 static int 752 static int
752 hash_table_data_validate (Lisp_Object keyword, Lisp_Object value, 753 hash_table_data_validate (Lisp_Object UNUSED (keyword), Lisp_Object value,
753 Error_Behavior errb) 754 Error_Behavior errb)
754 { 755 {
755 int len; 756 int len;
756 757
757 GET_EXTERNAL_LIST_LENGTH (value, len); 758 GET_EXTERNAL_LIST_LENGTH (value, len);
758 759