comparison src/fns.c @ 5439:771bf922ab2b

Merged with trunk.
author Mats Lidell <matsl@xemacs.org>
date Mon, 06 Dec 2010 22:59:26 +0100
parents 8d29f1c4bb98 c290121b0c3f
children 89331fa1c819
comparison
equal deleted inserted replaced
5438:8d29f1c4bb98 5439:771bf922ab2b
4169 */ 4169 */
4170 (int nargs, Lisp_Object *args)) 4170 (int nargs, Lisp_Object *args))
4171 { 4171 {
4172 Lisp_Object sequence = args[0]; 4172 Lisp_Object sequence = args[0];
4173 Lisp_Object item = args[1]; 4173 Lisp_Object item = args[1];
4174 Elemcount starting = 0, ending = EMACS_INT_MAX + 1, ii, len; 4174 Elemcount starting, ending = EMACS_INT_MAX + 1, ii, len;
4175 4175
4176 PARSE_KEYWORDS (Ffill, nargs, args, 2, (start, end), (start = Qzero)); 4176 PARSE_KEYWORDS (Ffill, nargs, args, 2, (start, end), (start = Qzero));
4177 4177
4178 CHECK_NATNUM (start); 4178 CHECK_NATNUM (start);
4179 starting = BIGNUMP (start) ? EMACS_INT_MAX + 1 : XINT (start);
4180
4179 if (!NILP (end)) 4181 if (!NILP (end))
4180 { 4182 {
4181 CHECK_NATNUM (end); 4183 CHECK_NATNUM (end);
4182 ending = BIGNUMP (end) ? EMACS_INT_MAX + 1 : XINT (end); 4184 ending = BIGNUMP (end) ? EMACS_INT_MAX + 1 : XINT (end);
4183 } 4185 }
4197 CHECK_LISP_WRITEABLE (sequence); 4199 CHECK_LISP_WRITEABLE (sequence);
4198 len = XVECTOR_LENGTH (sequence); 4200 len = XVECTOR_LENGTH (sequence);
4199 4201
4200 check_sequence_range (sequence, start, end, make_int (len)); 4202 check_sequence_range (sequence, start, end, make_int (len));
4201 ending = min (ending, len); 4203 ending = min (ending, len);
4202 starting = XINT (start);
4203 4204
4204 for (ii = starting; ii < ending; ++ii) 4205 for (ii = starting; ii < ending; ++ii)
4205 { 4206 {
4206 p[ii] = item; 4207 p[ii] = item;
4207 } 4208 }
4216 CHECK_LISP_WRITEABLE (sequence); 4217 CHECK_LISP_WRITEABLE (sequence);
4217 len = bit_vector_length (v); 4218 len = bit_vector_length (v);
4218 4219
4219 check_sequence_range (sequence, start, end, make_int (len)); 4220 check_sequence_range (sequence, start, end, make_int (len));
4220 ending = min (ending, len); 4221 ending = min (ending, len);
4221 starting = XINT (start);
4222 4222
4223 for (ii = starting; ii < ending; ++ii) 4223 for (ii = starting; ii < ending; ++ii)
4224 { 4224 {
4225 set_bit_vector_bit (v, ii, bit); 4225 set_bit_vector_bit (v, ii, bit);
4226 } 4226 }
4227 } 4227 }
4228 else if (LISTP (sequence)) 4228 else if (LISTP (sequence))
4229 { 4229 {
4230 Elemcount counting = 0; 4230 Elemcount counting = 0;
4231 starting = BIGNUMP (start) ? EMACS_INT_MAX + 1 : XINT (start);
4232 4231
4233 EXTERNAL_LIST_LOOP_3 (elt, sequence, tail) 4232 EXTERNAL_LIST_LOOP_3 (elt, sequence, tail)
4234 { 4233 {
4235 if (counting >= starting) 4234 if (counting >= starting)
4236 { 4235 {