comparison src/elhash.c @ 578:190b164ddcac

[xemacs-hg @ 2001-05-25 11:26:50 by ben] device-msw.c, eldap.c, emodules.c, hpplay.c, process-unix.c, sound.h, tooltalk.c, win32.c: Revert Martin's attempted compile-warnings fix. It does fix the warnings, but not the right way. We are trying to eliminate the raw use of `char' and `unsigned char' absolutely everywhere. There is never an occasion to reintroduce these. buffer.h: Instead, we fix these macros so they don't care about the type of their lvalues. We already do this for the non-C-string equivalents of these, and it's correct because it should be OK to pass in an SBufbyte *, for example. In any case, we do not need any type-correctness checking here -- errors will be caught for sure as soon as we remove the -Wno-sign-compare switch. mule-charset.c: Use invalid_argument, not generic signal_error (Qerror, ). alloc.c, chartab.c, console-gtk.c, console-msw.c, console-stream.c, console-stream.h, console-tty.c, console-tty.h, console-x.c, console.c, console.h, device-x.c, device.c, elhash.c, eval.c, faces.c, faces.h, fns.c, glyphs.c, glyphs.h, gui.c, gui.h, lisp.h, lread.c, nt.c, objects-gtk.c, objects-gtk.h, objects-msw.c, objects-tty.c, objects-x.c, objects.c, process-unix.c, rangetab.c, search.c, specifier.c, toolbar.c, window.c, window.h: Rename Error_behavior to Error_Behavior, to be consistent with general naming practices (Lisp_Object, Char_Binary, etc.).
author ben
date Fri, 25 May 2001 11:27:01 +0000
parents 183866b06e0b
children af57a77cbc92
comparison
equal deleted inserted replaced
577:910449c92002 578:190b164ddcac
571 /* Validation functions: each keyword provides its own validation 571 /* Validation functions: each keyword provides its own validation
572 function. The errors should maybe be continuable, but it is 572 function. The errors should maybe be continuable, but it is
573 unclear how this would cope with ERRB. */ 573 unclear how this would cope with ERRB. */
574 static int 574 static int
575 hash_table_size_validate (Lisp_Object keyword, Lisp_Object value, 575 hash_table_size_validate (Lisp_Object keyword, Lisp_Object value,
576 Error_behavior errb) 576 Error_Behavior errb)
577 { 577 {
578 if (NATNUMP (value)) 578 if (NATNUMP (value))
579 return 1; 579 return 1;
580 580
581 maybe_signal_error_1 (Qwrong_type_argument, list2 (Qnatnump, value), 581 maybe_signal_error_1 (Qwrong_type_argument, list2 (Qnatnump, value),
589 return NILP (obj) ? HASH_TABLE_DEFAULT_SIZE : XINT (obj); 589 return NILP (obj) ? HASH_TABLE_DEFAULT_SIZE : XINT (obj);
590 } 590 }
591 591
592 static int 592 static int
593 hash_table_weakness_validate (Lisp_Object keyword, Lisp_Object value, 593 hash_table_weakness_validate (Lisp_Object keyword, Lisp_Object value,
594 Error_behavior errb) 594 Error_Behavior errb)
595 { 595 {
596 if (EQ (value, Qnil)) return 1; 596 if (EQ (value, Qnil)) return 1;
597 if (EQ (value, Qt)) return 1; 597 if (EQ (value, Qt)) return 1;
598 if (EQ (value, Qkey)) return 1; 598 if (EQ (value, Qkey)) return 1;
599 if (EQ (value, Qkey_and_value)) return 1; 599 if (EQ (value, Qkey_and_value)) return 1;
633 return HASH_TABLE_NON_WEAK; /* not reached */ 633 return HASH_TABLE_NON_WEAK; /* not reached */
634 } 634 }
635 635
636 static int 636 static int
637 hash_table_test_validate (Lisp_Object keyword, Lisp_Object value, 637 hash_table_test_validate (Lisp_Object keyword, Lisp_Object value,
638 Error_behavior errb) 638 Error_Behavior errb)
639 { 639 {
640 if (EQ (value, Qnil)) return 1; 640 if (EQ (value, Qnil)) return 1;
641 if (EQ (value, Qeq)) return 1; 641 if (EQ (value, Qeq)) return 1;
642 if (EQ (value, Qequal)) return 1; 642 if (EQ (value, Qequal)) return 1;
643 if (EQ (value, Qeql)) return 1; 643 if (EQ (value, Qeql)) return 1;
659 return HASH_TABLE_EQ; /* not reached */ 659 return HASH_TABLE_EQ; /* not reached */
660 } 660 }
661 661
662 static int 662 static int
663 hash_table_rehash_size_validate (Lisp_Object keyword, Lisp_Object value, 663 hash_table_rehash_size_validate (Lisp_Object keyword, Lisp_Object value,
664 Error_behavior errb) 664 Error_Behavior errb)
665 { 665 {
666 if (!FLOATP (value)) 666 if (!FLOATP (value))
667 { 667 {
668 maybe_signal_error_1 (Qwrong_type_argument, list2 (Qfloatp, value), 668 maybe_signal_error_1 (Qwrong_type_argument, list2 (Qfloatp, value),
669 Qhash_table, errb); 669 Qhash_table, errb);
690 return NILP (rehash_size) ? -1.0 : XFLOAT_DATA (rehash_size); 690 return NILP (rehash_size) ? -1.0 : XFLOAT_DATA (rehash_size);
691 } 691 }
692 692
693 static int 693 static int
694 hash_table_rehash_threshold_validate (Lisp_Object keyword, Lisp_Object value, 694 hash_table_rehash_threshold_validate (Lisp_Object keyword, Lisp_Object value,
695 Error_behavior errb) 695 Error_Behavior errb)
696 { 696 {
697 if (!FLOATP (value)) 697 if (!FLOATP (value))
698 { 698 {
699 maybe_signal_error_1 (Qwrong_type_argument, list2 (Qfloatp, value), 699 maybe_signal_error_1 (Qwrong_type_argument, list2 (Qfloatp, value),
700 Qhash_table, errb); 700 Qhash_table, errb);
721 return NILP (rehash_threshold) ? -1.0 : XFLOAT_DATA (rehash_threshold); 721 return NILP (rehash_threshold) ? -1.0 : XFLOAT_DATA (rehash_threshold);
722 } 722 }
723 723
724 static int 724 static int
725 hash_table_data_validate (Lisp_Object keyword, Lisp_Object value, 725 hash_table_data_validate (Lisp_Object keyword, Lisp_Object value,
726 Error_behavior errb) 726 Error_Behavior errb)
727 { 727 {
728 int len; 728 int len;
729 729
730 GET_EXTERNAL_LIST_LENGTH (value, len); 730 GET_EXTERNAL_LIST_LENGTH (value, len);
731 731