pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.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: builtin_functions.c,v 1.643 2007/11/20 18:06:23 grubba Exp $ + || $Id: builtin_functions.c,v 1.644 2008/01/05 18:00:06 nilsson Exp $   */      #include "global.h"   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"   #include "pike_error.h"
pike.git/src/builtin_functions.c:1203:       pop_n_elems(args);    push_int(t);    break;       case T_MULTISET:    case T_MAPPING:    f_index(2);    f_zero_type(1);    -  if(Pike_sp[-1].type == T_INT) -  Pike_sp[-1].u.integer = !Pike_sp[-1].u.integer; -  else + #ifdef PIKE_DEBUG +  if(Pike_sp[-1].type != T_INT)    PIKE_ERROR("has_index",    "Function `zero_type' gave incorrect result.\n", Pike_sp, args); -  + #endif +  Pike_sp[-1].u.integer = !Pike_sp[-1].u.integer;    break;       case T_OBJECT:    case T_PROGRAM:    /* FIXME: If the object behaves like an array, it will throw an    error for non-valid indices. Therefore it's not a good idea    to use the index operator.       Maybe we should use object->_has_index(index) provided that    the object implements it.       /Noring */ -  +  /* If it is an iterator object we may want to use the iterator +  interface to look for the index. */       stack_swap();    f_indices(1);    stack_swap();    f_search(2);       if(Pike_sp[-1].type == T_INT)    Pike_sp[-1].u.integer = (Pike_sp[-1].u.integer != -1);    else    PIKE_ERROR("has_index",