pike.git / src / operators.c

version» Context lines:

pike.git/src/operators.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h"   #include <math.h> - RCSID("$Id: operators.c,v 1.112 2000/11/12 04:02:43 hubbe Exp $"); + RCSID("$Id: operators.c,v 1.113 2000/12/01 08:09:51 hubbe Exp $");   #include "interpret.h"   #include "svalue.h"   #include "multiset.h"   #include "mapping.h"   #include "array.h"   #include "stralloc.h"   #include "opcodes.h"   #include "operators.h"   #include "language.h"   #include "pike_memory.h" - #include "error.h" + #include "pike_error.h"   #include "docode.h"   #include "constants.h"   #include "peep.h"   #include "lex.h"   #include "program.h"   #include "object.h"   #include "pike_types.h"   #include "module_support.h"   #include "pike_macros.h"   #include "bignum.h"
pike.git/src/operators.c:2613:   #undef THIS   #define THIS ((struct string_assignment_storage *)(CURRENT_STORAGE))   static void f_string_assignment_index(INT32 args)   {    INT_TYPE i;    get_all_args("string[]",args,"%i",&i);    if(i<0) i+=THIS->s->len;    if(i<0)    i+=THIS->s->len;    if(i<0 || i>=THIS->s->len) -  error("Index %d is out of range 0 - %ld.\n", +  Pike_error("Index %d is out of range 0 - %ld.\n",    i, PTRDIFF_T_TO_LONG(THIS->s->len - 1));    else    i=index_shared_string(THIS->s,i);    pop_n_elems(args);    push_int(i);   }      static void f_string_assignment_assign_index(INT32 args)   {    INT_TYPE i,j;    union anything *u;    get_all_args("string[]=",args,"%i%i",&i,&j);    if((u=get_pointer_if_this_type(THIS->lval, T_STRING)))    {    free_string(THIS->s);    if(i<0) i+=u->string->len;    if(i<0 || i>=u->string->len) -  error("String index out of range %ld\n",(long)i); +  Pike_error("String index out of range %ld\n",(long)i);    u->string=modify_shared_string(u->string,i,j);    copy_shared_string(THIS->s, u->string);    }else{    lvalue_to_svalue_no_free(sp,THIS->lval);    sp++; -  if(sp[-1].type != T_STRING) error("string[]= failed.\n"); +  if(sp[-1].type != T_STRING) Pike_error("string[]= failed.\n");    if(i<0) i+=sp[-1].u.string->len;    if(i<0 || i>=sp[-1].u.string->len) -  error("String index out of range %ld\n",(long)i); +  Pike_error("String index out of range %ld\n",(long)i);    sp[-1].u.string=modify_shared_string(sp[-1].u.string,i,j);    assign_lvalue(THIS->lval, sp-1);    pop_stack();    }    pop_n_elems(args);    push_int(j);   }         static void init_string_assignment_storage(struct object *o)