pike.git / src / opcodes.c

version» Context lines:

pike.git/src/opcodes.c:20:   #include "pike_types.h"   #include "pike_memory.h"   #include "fd_control.h"   #include "cyclic.h"   #include "builtin_functions.h"   #include "module_support.h"   #include "security.h"   #include "bignum.h"   #include "operators.h"    - RCSID("$Id: opcodes.c,v 1.109 2001/06/05 10:12:55 hubbe Exp $"); + RCSID("$Id: opcodes.c,v 1.110 2001/06/16 13:49:40 per Exp $");      void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind)   {    INT32 i;      #ifdef PIKE_SECURITY    if(what->type <= MAX_COMPLEX)    if(!CHECK_DATA_SECURITY(what->u.array, SECURITY_BIT_INDEX))    Pike_error("Index permission denied.\n");   #endif
pike.git/src/opcodes.c:262:    sp[-1].type=T_INT;    sp[-1].u.integer=i;    }    break;       case T_STRING:    /* This can be here independently of AUTO_BIGNUM. Besides,    we really want to reduce the number of number parsers    around here. :) /Noring */   #ifdef AUTO_BIGNUM +  +  +  /* The generic function is rather slow, so I added this +  * code for benchmark purposes. :-) /per +  */ +  if( sp[-1].u.string->len < 10 && +  !sp[-1].u.string->size_shift ) +  { +  i=atoi(sp[-1].u.string->str); +  free_string(sp[-1].u.string); +  sp[-1].type=T_INT; +  sp[-1].u.integer=i; +  } +  else    convert_stack_top_string_to_inumber(10);    return; /* FIXME: OK to return? Cast tests below indicates    we have to do this, at least for now... /Noring */    /* Yes, it is ok to return, it is actually an optimization :)    * /Hubbe    */   #else    i=STRTOL(sp[-1].u.string->str,0,10);    free_string(sp[-1].u.string);    sp[-1].type=T_INT;