comparison src/elhash.c @ 4585:871eb054b34a

Document non-obvious usages.
author Stephen J. Turnbull <stephen@xemacs.org>
date Tue, 25 Nov 2008 10:44:16 +0900
parents aae1994dfeec
children 80cd90837ac5
comparison
equal deleted inserted replaced
4584:56e67d42eb04 4585:871eb054b34a
753 } 753 }
754 754
755 static double 755 static double
756 decode_hash_table_rehash_size (Lisp_Object rehash_size) 756 decode_hash_table_rehash_size (Lisp_Object rehash_size)
757 { 757 {
758 /* -1.0 signals make_general_lisp_hash_table to use the default. */
758 return NILP (rehash_size) ? -1.0 : XFLOAT_DATA (rehash_size); 759 return NILP (rehash_size) ? -1.0 : XFLOAT_DATA (rehash_size);
759 } 760 }
760 761
761 static int 762 static int
762 hash_table_rehash_threshold_validate (Lisp_Object UNUSED (keyword), 763 hash_table_rehash_threshold_validate (Lisp_Object UNUSED (keyword),
784 } 785 }
785 786
786 static double 787 static double
787 decode_hash_table_rehash_threshold (Lisp_Object rehash_threshold) 788 decode_hash_table_rehash_threshold (Lisp_Object rehash_threshold)
788 { 789 {
790 /* -1.0 signals make_general_lisp_hash_table to use the default. */
789 return NILP (rehash_threshold) ? -1.0 : XFLOAT_DATA (rehash_threshold); 791 return NILP (rehash_threshold) ? -1.0 : XFLOAT_DATA (rehash_threshold);
790 } 792 }
791 793
792 static int 794 static int
793 hash_table_data_validate (Lisp_Object UNUSED (keyword), Lisp_Object value, 795 hash_table_data_validate (Lisp_Object UNUSED (keyword), Lisp_Object value,
794 Error_Behavior errb) 796 Error_Behavior errb)
795 { 797 {
796 int len; 798 int len;
797 799
800 /* Check for improper lists while getting length. */
798 GET_EXTERNAL_LIST_LENGTH (value, len); 801 GET_EXTERNAL_LIST_LENGTH (value, len);
799 802
800 if (len & 1) 803 if (len & 1)
801 { 804 {
802 maybe_sferror 805 maybe_sferror
803 ("Hash table data must have alternating key/value pairs", 806 ("Hash table data must have alternating key/value pairs",
804 value, Qhash_table, errb); 807 value, Qhash_table, errb);
805 return 0; 808 return 0;
806 } 809 }
810
807 return 1; 811 return 1;
808 } 812 }
809 813
810 /* The actual instantiation of a hash table. This does practically no 814 /* The actual instantiation of a hash table. This does practically no
811 error checking, because it relies on the fact that the paranoid 815 error checking, because it relies on the fact that the paranoid