Mercurial > emacs
comparison src/alloc.c @ 17021:35f01092d865
(Fmake_char_table): Typo in doc-string fixed. Handle
the case that PURPOSE is nil (in a deeper char-table).
(Fmake_bool_vector): Make correct size of Lisp_Object for
bool-vector.
| author | Karl Heuer <kwzh@gnu.org> |
|---|---|
| date | Thu, 20 Feb 1997 06:43:51 +0000 |
| parents | 1e1026e6cd9d |
| children | 571d0c136e48 |
comparison
equal
deleted
inserted
replaced
| 17020:5cf5e7c9fe55 | 17021:35f01092d865 |
|---|---|
| 776 register Lisp_Object purpose, init; | 776 register Lisp_Object purpose, init; |
| 777 { | 777 { |
| 778 Lisp_Object vector; | 778 Lisp_Object vector; |
| 779 Lisp_Object n; | 779 Lisp_Object n; |
| 780 CHECK_SYMBOL (purpose, 1); | 780 CHECK_SYMBOL (purpose, 1); |
| 781 n = Fget (purpose, Qchar_table_extra_slots); | 781 /* For a deeper char-table, PURPOSE can be nil. */ |
| 782 n = NILP (purpose) ? 0 : Fget (purpose, Qchar_table_extra_slots); | |
| 782 CHECK_NUMBER (n, 0); | 783 CHECK_NUMBER (n, 0); |
| 783 if (XINT (n) < 0 || XINT (n) > 10) | 784 if (XINT (n) < 0 || XINT (n) > 10) |
| 784 args_out_of_range (n, Qnil); | 785 args_out_of_range (n, Qnil); |
| 785 /* Add 2 to the size for the defalt and parent slots. */ | 786 /* Add 2 to the size for the defalt and parent slots. */ |
| 786 vector = Fmake_vector (make_number (CHAR_TABLE_STANDARD_SLOTS + XINT (n)), | 787 vector = Fmake_vector (make_number (CHAR_TABLE_STANDARD_SLOTS + XINT (n)), |
| 1105 bits_per_value = sizeof (EMACS_INT) * BITS_PER_CHAR; | 1106 bits_per_value = sizeof (EMACS_INT) * BITS_PER_CHAR; |
| 1106 | 1107 |
| 1107 length_in_elts = (XFASTINT (length) + bits_per_value - 1) / bits_per_value; | 1108 length_in_elts = (XFASTINT (length) + bits_per_value - 1) / bits_per_value; |
| 1108 length_in_chars = length_in_elts * sizeof (EMACS_INT); | 1109 length_in_chars = length_in_elts * sizeof (EMACS_INT); |
| 1109 | 1110 |
| 1110 val = Fmake_vector (make_number (length_in_elts), Qnil); | 1111 /* We must allocate one more elements than LENGTH_IN_ELTS for the |
| 1112 slot `size' of the struct Lisp_Bool_Vector. */ | |
| 1113 val = Fmake_vector (make_number (length_in_elts + 1), Qnil); | |
| 1111 p = XBOOL_VECTOR (val); | 1114 p = XBOOL_VECTOR (val); |
| 1112 /* Get rid of any bits that would cause confusion. */ | 1115 /* Get rid of any bits that would cause confusion. */ |
| 1113 p->vector_size = 0; | 1116 p->vector_size = 0; |
| 1114 XSETBOOL_VECTOR (val, p); | 1117 XSETBOOL_VECTOR (val, p); |
| 1115 p->size = XFASTINT (length); | 1118 p->size = XFASTINT (length); |
