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.198 2004/10/30 11:38:27 mast Exp $
+ || $Id: operators.c,v 1.199 2004/11/12 13:20:15 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:82:
Pike_error("Index %"PRINTPIKEINT"d is out of string range "
"%"PRINTPTRDIFFT"d..%"PRINTPTRDIFFT"d.\n",
i, -len, len - 1);
} else
i=index_shared_string(what->u.string,i);
to->type=T_INT;
to->subtype=NUMBER_NUMBER;
to->u.integer=i;
break;
}else{
- if (ind->type == T_STRING && !ind->u.string->size_shift)
- Pike_error ("Expected integer as string index, got \"%s\".\n",
- ind->u.string->str);
+ 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_PROGRAM:
program_index_no_free(to, what->u.program, ind);
break;
case T_FUNCTION:
pike.git/src/operators.c:113: Inside #if defined(AUTO_BIGNUM)
#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) {
- if (!ind->u.string->size_shift)
+
Pike_error("Indexing the integer %"PRINTPIKEINT"d "
- "with unknown method \"%s\".\n",
- val, ind->u.string->str);
- else
- Pike_error("Indexing the integer %"PRINTPIKEINT"d "
- "with a wide string.\n",
- val);
+ "with unknown method \"%S\".\n",
+ val, ind->u.string);
} else {
- if(!ind->u.string->size_shift)
- Pike_error("Indexing the NULL value with \"%s\".\n",
- ind->u.string->str);
- else
- Pike_error("Indexing the NULL value with a wide string.\n");
+ Pike_error("Indexing the NULL value with \"%S\".\n",
+ ind->u.string);
}
}
break;
}
/* FALL_THROUGH */
#endif /* AUTO_BIGNUM */
default:
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);
- else if (ind->type == T_STRING && !ind->u.string->size_shift)
- Pike_error ("Cannot index %s with \"%s\".\n",
+ else if (ind->type == T_STRING)
+ Pike_error ("Cannot index %s with \"%S\".\n",
(what->type == T_INT && !what->u.integer)?
"the NULL value":get_name_of_type(what->type),
- ind->u.string->str);
+ ind->u.string);
else
Pike_error ("Cannot index %s with %s.\n",
(what->type == T_INT && !what->u.integer)?
"the NULL value":get_name_of_type(what->type),
get_name_of_type (ind->type));
}
}
void o_index(void)
{