Mercurial > hg > xemacs-beta
diff src/fns.c @ 76:c0c698873ce1 r20-0b33
Import from CVS: tag r20-0b33
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:05:10 +0200 |
parents | 131b0175ea99 |
children | a145efe76779 |
line wrap: on
line diff
--- a/src/fns.c Mon Aug 13 09:04:39 2007 +0200 +++ b/src/fns.c Mon Aug 13 09:05:10 2007 +0200 @@ -3043,42 +3043,43 @@ (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 {