pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.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" - RCSID("$Id: builtin_functions.c,v 1.360 2002/05/02 14:48:00 mast Exp $"); + RCSID("$Id: builtin_functions.c,v 1.361 2002/07/22 17:56:03 grubba Exp $");   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"   #include "pike_error.h"   #include "constants.h"   #include "mapping.h"   #include "stralloc.h"
pike.git/src/builtin_functions.c:1400:    *! In all other cases @[zero_type()] will return @tt{0@} (zero).    *!    *! @seealso    *! @[fund_call_out()]    */   PMOD_EXPORT void f_zero_type(INT32 args)   {    if(args < 1)    SIMPLE_TOO_FEW_ARGS_ERROR("zero_type",1);    -  if(Pike_sp[-args].type != T_INT) +  if((Pike_sp[-args].type==T_OBJECT || Pike_sp[-args].type==T_FUNCTION) +  && !Pike_sp[-args].u.object->prog)    {    pop_n_elems(args); -  push_int(0); +  push_int(NUMBER_DESTRUCTED);    } -  else if((Pike_sp[-args].type==T_OBJECT || Pike_sp[-args].type==T_FUNCTION) -  && !Pike_sp[-args].u.object->prog) +  else if(Pike_sp[-args].type != T_INT)    {    pop_n_elems(args); -  push_int(NUMBER_DESTRUCTED); +  push_int(0);    } -  +  else    {    pop_n_elems(args-1);    Pike_sp[-1].u.integer=Pike_sp[-1].subtype;    Pike_sp[-1].subtype=NUMBER_NUMBER;    }   }      /*    * Some wide-strings related functions    */