pike.git / src / operators.c

version» Context lines:

pike.git/src/operators.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: operators.c,v 1.221 2007/05/03 09:04:10 grubba Exp $ + || $Id: operators.c,v 1.222 2007/09/24 19:18:24 grubba Exp $   */      #include "global.h"   #include <math.h>   #include "interpret.h"   #include "svalue.h"   #include "multiset.h"   #include "mapping.h"   #include "array.h"   #include "stralloc.h"
pike.git/src/operators.c:90:    break;    }else{    if (ind->type == T_STRING)    Pike_error ("Expected integer as string index, got \"%S\".\n",    ind->u.string);    else    Pike_error ("Expected integer as string index, got %s.\n",    get_name_of_type (ind->type));    }    +  case T_FUNCTION:    case T_PROGRAM: -  program_index_no_free(to, what->u.program, ind); -  break; +  if (program_index_no_free(to, what, ind)) break; +  goto index_error;    -  case T_FUNCTION: -  { -  struct program *p = program_from_svalue(what); -  if (p) { -  program_index_no_free(to, p, ind); -  break; -  } -  } -  /* FALL THROUGH */ -  +    #ifdef AUTO_BIGNUM    case T_INT:    if (ind->type == T_STRING) {    INT_TYPE val = what->u.integer;       convert_svalue_to_bignum(what);    index_no_free(to, what, ind);    if(IS_UNDEFINED(to)) {    if (val) {    Pike_error("Indexing the integer %"PRINTPIKEINT"d "
pike.git/src/operators.c:128: Inside #if defined(AUTO_BIGNUM)
   ind->u.string);    }    }    break;    }       /* FALL_THROUGH */   #endif /* AUTO_BIGNUM */       default: +  index_error:    if (ind->type == T_INT)    Pike_error ("Cannot index %s with %"PRINTPIKEINT"d.\n",    (what->type == T_INT && !what->u.integer)?    "the NULL value":get_name_of_type(what->type),    ind->u.integer);    else if (ind->type == T_FLOAT)    Pike_error ("Cannot index %s with %"PRINTPIKEFLOAT"g.\n",    (what->type == T_INT && !what->u.integer)?    "the NULL value":get_name_of_type(what->type),    ind->u.float_number);