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.224 2008/01/09 13:42:49 grubba Exp $ + || $Id: operators.c,v 1.225 2008/01/24 17:48:18 mast 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:273: Inside #if defined(AUTO_BIGNUM)
   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   #endif /* AUTO_BIGNUM */    {    sp[-1].type=T_INT; +  sp[-1].subtype = NUMBER_NUMBER;    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 )    {    int i=atoi(sp[-1].u.string->str);    free_string(sp[-1].u.string);    sp[-1].type=T_INT; -  +  sp[-1].subtype = NUMBER_NUMBER;    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    {    int i=STRTOL(sp[-1].u.string->str,0,10);    free_string(sp[-1].u.string);    sp[-1].type=T_INT; -  +  sp[-1].subtype = NUMBER_NUMBER;    sp[-1].u.integer=i;    }   #endif /* AUTO_BIGNUM */    break;       case PIKE_T_INT:    break;       default:    Pike_error("Cannot cast %s to int.\n", get_name_of_type(sp[-1].type));
pike.git/src/operators.c:4182:    push_int(1);    }else{    pop_stack();    push_int(0);    }    break;       default:    free_svalue(sp-1);    sp[-1].type=T_INT; +  sp[-1].subtype = NUMBER_NUMBER;    sp[-1].u.integer=0;    }   }      /*! @decl int(0..1) `!(object|function arg)    *! @decl int(1..1) `!(int(0..0) arg)    *! @decl int(0..0) `!(mixed arg)    *!    *! Logical not.    *!