comparison src/fns.c @ 5309:c290121b0c3f

#'fill; move all declarations before statements, for the Visual Studio build 2010-11-30 Aidan Kehoe <kehoea@parhasard.net> * fns.c (Ffill): Move all declarations before statements, for the sake of the Visual Studio build. Thank you Vin!
author Aidan Kehoe <kehoea@parhasard.net>
date Tue, 30 Nov 2010 13:08:44 +0000
parents c096d8051f89
children d1b17a33450b 771bf922ab2b
comparison
equal deleted inserted replaced
5308:17c381a2f377 5309:c290121b0c3f
4171 */ 4171 */
4172 (int nargs, Lisp_Object *args)) 4172 (int nargs, Lisp_Object *args))
4173 { 4173 {
4174 Lisp_Object sequence = args[0]; 4174 Lisp_Object sequence = args[0];
4175 Lisp_Object item = args[1]; 4175 Lisp_Object item = args[1];
4176 Elemcount starting = 0, ending = EMACS_INT_MAX + 1, ii, len; 4176 Elemcount starting, ending = EMACS_INT_MAX + 1, ii, len;
4177 4177
4178 PARSE_KEYWORDS (Ffill, nargs, args, 2, (start, end), (start = Qzero)); 4178 PARSE_KEYWORDS (Ffill, nargs, args, 2, (start, end), (start = Qzero));
4179 4179
4180 CHECK_NATNUM (start); 4180 CHECK_NATNUM (start);
4181 starting = BIGNUMP (start) ? EMACS_INT_MAX + 1 : XINT (start);
4182
4181 if (!NILP (end)) 4183 if (!NILP (end))
4182 { 4184 {
4183 CHECK_NATNUM (end); 4185 CHECK_NATNUM (end);
4184 ending = BIGNUMP (end) ? EMACS_INT_MAX + 1 : XINT (end); 4186 ending = BIGNUMP (end) ? EMACS_INT_MAX + 1 : XINT (end);
4185 } 4187 }
4199 CHECK_LISP_WRITEABLE (sequence); 4201 CHECK_LISP_WRITEABLE (sequence);
4200 len = XVECTOR_LENGTH (sequence); 4202 len = XVECTOR_LENGTH (sequence);
4201 4203
4202 check_sequence_range (sequence, start, end, make_int (len)); 4204 check_sequence_range (sequence, start, end, make_int (len));
4203 ending = min (ending, len); 4205 ending = min (ending, len);
4204 starting = XINT (start);
4205 4206
4206 for (ii = starting; ii < ending; ++ii) 4207 for (ii = starting; ii < ending; ++ii)
4207 { 4208 {
4208 p[ii] = item; 4209 p[ii] = item;
4209 } 4210 }
4218 CHECK_LISP_WRITEABLE (sequence); 4219 CHECK_LISP_WRITEABLE (sequence);
4219 len = bit_vector_length (v); 4220 len = bit_vector_length (v);
4220 4221
4221 check_sequence_range (sequence, start, end, make_int (len)); 4222 check_sequence_range (sequence, start, end, make_int (len));
4222 ending = min (ending, len); 4223 ending = min (ending, len);
4223 starting = XINT (start);
4224 4224
4225 for (ii = starting; ii < ending; ++ii) 4225 for (ii = starting; ii < ending; ++ii)
4226 { 4226 {
4227 set_bit_vector_bit (v, ii, bit); 4227 set_bit_vector_bit (v, ii, bit);
4228 } 4228 }
4229 } 4229 }
4230 else if (LISTP (sequence)) 4230 else if (LISTP (sequence))
4231 { 4231 {
4232 Elemcount counting = 0; 4232 Elemcount counting = 0;
4233 starting = BIGNUMP (start) ? EMACS_INT_MAX + 1 : XINT (start);
4234 4233
4235 EXTERNAL_LIST_LOOP_3 (elt, sequence, tail) 4234 EXTERNAL_LIST_LOOP_3 (elt, sequence, tail)
4236 { 4235 {
4237 if (counting >= starting) 4236 if (counting >= starting)
4238 { 4237 {