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.114 2000/12/08 15:47:55 grubba Exp $"); + RCSID("$Id: operators.c,v 1.115 2000/12/15 21:37:44 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:2718:      #define CMP_TYPE "!function(!(object|mixed)...:mixed)&function(mixed...:int(0..1))|function(int|float...:int(0..1))|function(string...:int(0..1))|function(type|program,type|program,type|program...:int(0..1))"    add_efun2("`<", f_lt,CMP_TYPE,OPT_TRY_OPTIMIZE,0,generate_comparison);    add_efun2("`<=",f_le,CMP_TYPE,OPT_TRY_OPTIMIZE,0,generate_comparison);    add_efun2("`>", f_gt,CMP_TYPE,OPT_TRY_OPTIMIZE,0,generate_comparison);    add_efun2("`>=",f_ge,CMP_TYPE,OPT_TRY_OPTIMIZE,0,generate_comparison);       ADD_EFUN2("`+",f_add,    tOr7(tIfnot(tFuncV(tNone,tNot(tOr(tObj,tMix)),tMix),tFunction),    tFuncV(tInt,tInt,tInt), -  tIfnot(tFuncV(tNone,tNot(tFlt),tMix), +  tIfnot(tFuncV(tNone, tNot(tFlt), tMix),    tFuncV(tOr(tInt,tFlt),tOr(tInt,tFlt),tFlt)), -  tIfnot(tFuncV(tOr(tInt,tFlt),tOr(tInt,tFlt),tMix), +  tIfnot(tFuncV(tNone, tNot(tStr), tMix),    tFuncV(tOr3(tStr,tInt,tFlt),    tOr3(tStr,tInt,tFlt),tStr)),    tFuncV(tSetvar(0,tArray),tSetvar(1,tArray),    tOr(tVar(0),tVar(1))),    tFuncV(tSetvar(0,tMapping),tSetvar(1,tMapping),    tOr(tVar(0),tVar(1))),    tFuncV(tSetvar(0,tMultiset),tSetvar(1,tMultiset),    tOr(tVar(0),tVar(1)))),    OPT_TRY_OPTIMIZE,optimize_binary,generate_sum);   
pike.git/src/operators.c:2785:    tOr(tFuncV(tMix tObj,tMix,tMix),    tFuncV(tObj tMix,tMix,tMix)),       tOr6( F_AND_TYPE(tInt),    F_AND_TYPE(tArray),    F_AND_TYPE(tMapping),    F_AND_TYPE(tMultiset),    F_AND_TYPE(tString),    F_AND_TYPE(tOr(tType,tPrg)) ),    -  tIfnot(tFuncV(tNone,tOr(tArray,tMultiset),tMix), +  tIfnot(tFuncV(tNone, tNot(tMapping), tMix),    tFuncV(tNone,    tOr3(tArray,tMultiset,tSetvar(4,tMapping)),    tVar(4)) )    ),       OPT_TRY_OPTIMIZE,optimize_binary,generate_and);      #define LOG_TYPE \    tOr7(tOr(tFuncV(tMix tObj,tMix,tMix), \    tFuncV(tObj,tMix,tMix)), \
pike.git/src/operators.c:2861:    tArr(tArr(tVar(0)))),    tFuncV(tStr,tOr3(tStr,tInt,tFlt),tArr(tStr))),    OPT_TRY_OPTIMIZE,0,generate_divide);       /* function(mixed,object:mixed)|"    "function(object,mixed:mixed)|"    "function(int,int:int)|"    "function(string,int:string)|"    "function(array(0=mixed),int:array(0))|"    "!function(int,int:mixed)&function(int|float,int|float:float) */ -  ADD_EFUN2("`%",f_mod,tOr6(tFunc(tMix tObj,tMix),tFunc(tObj tMix,tMix),tFunc(tInt tInt,tInt),tFunc(tStr tInt,tStr),tFunc(tArr(tSetvar(0,tMix)) tInt,tArr(tVar(0))),tIfnot(tFunc(tInt tInt,tMix),tFunc(tOr(tInt,tFlt) tOr(tInt,tFlt),tFlt))), +  ADD_EFUN2("`%", f_mod, +  tOr6(tFunc(tMix tObj,tMix), +  tFunc(tObj tMix,tMix), +  tFunc(tInt tInt,tInt), +  tFunc(tStr tInt,tStr), +  tFunc(tArr(tSetvar(0,tMix)) tInt,tArr(tVar(0))), +  tIfnot(tFuncV(tNone, tNot(tFlt), tMix), +  tFunc(tOr(tInt,tFlt) tOr(tInt,tFlt),tFlt))),    OPT_TRY_OPTIMIZE,0,generate_mod);       /* function(object:mixed)|function(int:int)|function(float:float)|function(string:string) */    ADD_EFUN2("`~",f_compl,    tOr5(tFunc(tObj,tMix),    tFunc(tInt,tInt),    tFunc(tFlt,tFlt),    tFunc(tStr,tStr),    tFunc(tOr(tType,tProgram),tType)),    OPT_TRY_OPTIMIZE,0,generate_compl);