pike.git / src / operators.c

version» Context lines:

pike.git/src/operators.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"   #include <math.h> - RCSID("$Id: operators.c,v 1.139 2001/07/27 20:40:15 nilsson Exp $"); + RCSID("$Id: operators.c,v 1.140 2001/09/24 15:02:13 grubba Exp $");   #include "interpret.h"   #include "svalue.h"   #include "multiset.h"   #include "mapping.h"   #include "array.h"   #include "stralloc.h"   #include "opcodes.h"   #include "operators.h"   #include "language.h"   #include "pike_memory.h"
pike.git/src/operators.c:706:    return ret;    }    }    }    return 0;   }      static node *optimize_not(node *n)   {    node **first_arg, **more_args; -  int e; +        if(count_args(CDR(n))==1)    {    first_arg=my_get_arg(&_CDR(n), 0);   #ifdef PIKE_DEBUG    if(!first_arg)    fatal("Couldn't find argument!\n");   #endif    if(node_is_true(*first_arg)) return mkintnode(0);    if(node_is_false(*first_arg)) return mkintnode(1);
pike.git/src/operators.c:1320:   }      /* This function is used to speed up or/xor/and on    * arrays multisets and mappings. This is done by    * calling the operator for each pair of arguments    * first, then recursively doing the same on the    * results until only one value remains.    */   static void r_speedup(INT32 args, void (*func)(void))   { -  int num; +     struct svalue tmp;    ONERROR err;       switch(args)    {    case 3: func();    case 2: func();    case 1: return;       default:
pike.git/src/operators.c:2727:    case T_OBJECT:    CALL_OPERATOR(LFUN_MOD,2);    break;       case T_FLOAT:    {    FLOAT_TYPE foo;    if(sp[-1].u.float_number == 0.0)    OP_MODULO_BY_ZERO_ERROR("`%");    sp--; -  foo=sp[-1].u.float_number / sp[0].u.float_number; -  foo=sp[-1].u.float_number - sp[0].u.float_number * floor(foo); +  foo = DO_NOT_WARN((FLOAT_TYPE)(sp[-1].u.float_number / +  sp[0].u.float_number)); +  foo = DO_NOT_WARN((FLOAT_TYPE)(sp[-1].u.float_number - +  sp[0].u.float_number * floor(foo)));    sp[-1].u.float_number=foo;    return;    }    case T_INT:    if (sp[-1].u.integer == 0)    OP_MODULO_BY_ZERO_ERROR("`%");    sp--;    if(sp[-1].u.integer>=0)    {    if(sp[0].u.integer>=0)
pike.git/src/operators.c:3443:    mkintnode(1)))));    );    }    }    }    return NULL;   }      static int generate_sizeof(node *n)   { -  node **arg; +     if(count_args(CDR(n)) != 1) return 0;    if(do_docode(CDR(n),DO_NOT_COPY) != 1)    fatal("Count args was wrong in sizeof().\n");    emit0(F_SIZEOF);    return 1;   }      extern int generate_call_function(node *n);      /*! @class string_assignment