pike.git / src / array.c

version» Context lines:

pike.git/src/array.c:289:   {    switch(TYPEOF(*ind))    {    case T_INT: {    INT_TYPE p = ind->u.integer;    INT_TYPE i = p < 0 ? p + a->size : p;    if(i<0 || i>=a->size) {    struct svalue tmp;    SET_SVAL(tmp, T_ARRAY, 0, array, a);    if (a->size) { -  index_error(0,0,&tmp,ind, +  index_error(0,&tmp,ind,    "Index %"PRINTPIKEINT"d is out of array range "    "%d..%d.\n", p, -a->size, a->size-1);    } else { -  index_error(0,0,&tmp,ind, +  index_error(0,&tmp,ind,    "Attempt to index the empty array with %"PRINTPIKEINT"d.\n", p);    }    }    array_index_no_free(s,a,i);    break;    }       case T_STRING:    {    SET_SVAL(*s, T_ARRAY, 0, array, array_column(a, ind, 0));    break;    }       default:    {    struct svalue tmp;    SET_SVAL(tmp, T_ARRAY, 0, array, a); -  index_error(0,0,&tmp,ind,"Array index is neither int nor string.\n"); +  index_error(0,&tmp,ind,"Array index is neither int nor string.\n");    }    }   }      /**    * Extract an svalue from an array.    */   PMOD_EXPORT void array_free_index(struct array *v,INT32 index)   {   #ifdef PIKE_DEBUG
pike.git/src/array.c:371:    assign_lvalue(Pike_sp-2, s);    }    pop_n_elems(2);    break;    }       default:    {    struct svalue tmp;    SET_SVAL(tmp, T_ARRAY, 0, array, a); -  index_error(0,0,&tmp,ind,"Array index is neither int nor string.\n"); +  index_error(0,&tmp,ind,"Array index is neither int nor string.\n");    }    }   }      /**    * Insert an svalue into an array and grow the array if necessary.    */   PMOD_EXPORT struct array *array_insert(struct array *v,struct svalue *s,INT32 index)   {   #ifdef PIKE_DEBUG