pike.git / src / array.c

version» Context lines:

pike.git/src/array.c:16:   #include "pike_types.h"   #include "fsort.h"   #include "builtin_functions.h"   #include "pike_memory.h"   #include "gc.h"   #include "main.h"   #include "security.h"   #include "stuff.h"   #include "bignum.h"    - RCSID("$Id: array.c,v 1.69 2000/04/27 02:13:28 hubbe Exp $"); + RCSID("$Id: array.c,v 1.70 2000/05/03 09:00:44 hubbe Exp $");      struct array empty_array=   {    1, /* Never free */   #ifdef PIKE_SECURITY    0,   #endif    &empty_array, /* Next */    &empty_array, /* previous (circular) */    0, /* Size = 0 */
pike.git/src/array.c:235:    assign_svalue( ITEM(v) + index, s);    free_array(v);   }         void simple_set_index(struct array *a,struct svalue *ind,struct svalue *s)   {    INT32 i;    switch (ind->type) {    case T_INT: -  if(ind->type != T_INT) -  error("Index is not an integer.\n"); +     i=ind->u.integer;    if(i<0) i+=a->size;    if(i<0 || i>=a->size) {    if (a->size) {    error("Index %d is out of array range 0 - %d.\n", i, a->size-1);    } else {    error("Attempt to index the empty array with %d.\n", i);    }    }    array_set_index(a,i,s);