Mercurial > hg > xemacs-beta
diff src/fns.c @ 10:49a24b4fd526 r19-15b6
Import from CVS: tag r19-15b6
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:47:52 +0200 |
parents | ac2d302a0011 |
children | 9ee227acff29 |
line wrap: on
line diff
--- a/src/fns.c Mon Aug 13 08:47:36 2007 +0200 +++ b/src/fns.c Mon Aug 13 08:47:52 2007 +0200 @@ -2839,42 +2839,43 @@ Lisp_Object array, item; { retry: - if (VECTORP (array)) + if (STRINGP (array)) + { + Charcount size; + Charcount i; + Emchar charval; + struct Lisp_String *s; + CHECK_CHAR_COERCE_INT (item); + CHECK_IMPURE (array); + charval = XCHAR (item); + s = XSTRING (array); + size = string_char_length (s); + for (i = 0; i < size; i++) + set_string_char (s, i, charval); + bump_string_modiff (array); + } + else if (VECTORP (array)) { Lisp_Object *p; int size; - int indecks; + int i; CHECK_IMPURE (array); size = vector_length (XVECTOR (array)); p = vector_data (XVECTOR (array)); - for (indecks = 0; indecks < size; indecks++) - p[indecks] = item; + for (i = 0; i < size; i++) + p[i] = item; } - else if (VECTORP (array)) + else if (BIT_VECTORP (array)) { struct Lisp_Bit_Vector *v; int size; - int indecks; - + int i; CHECK_BIT (item); CHECK_IMPURE (array); v = XBIT_VECTOR (array); size = bit_vector_length (v); - for (indecks = 0; indecks < size; indecks++) - set_bit_vector_bit (v, indecks, XINT (item)); - } - else if (STRINGP (array)) - { - Charcount size; - Charcount indecks; - Emchar charval; - CHECK_CHAR_COERCE_INT (item); - CHECK_IMPURE (array); - charval = XCHAR (item); - size = string_char_length (XSTRING (array)); - for (indecks = 0; indecks < size; indecks++) - set_string_char (XSTRING (array), indecks, charval); - bump_string_modiff (array); + for (i = 0; i < size; i++) + set_bit_vector_bit (v, i, XINT (item)); } else {