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.   \*/   /**/   #include "global.h" - RCSID("$Id: builtin_functions.c,v 1.432 2002/06/13 21:54:32 mast Exp $"); + RCSID("$Id: builtin_functions.c,v 1.433 2002/06/25 14:26:40 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:2286:    */   static node *fix_overloaded_type(node *n, int lfun, const char *deftype, int deftypelen)   {    node **first_arg;    struct pike_type *t, *t2;    first_arg=my_get_arg(&_CDR(n), 0);    if(!first_arg) return 0;    t=first_arg[0]->type;    if(!t || match_types(t, object_type_string))    { - #ifdef USE_PIKE_TYPE +     /* Skip any name-nodes. */    while(t && t->type == PIKE_T_NAME) {    t = t->cdr;    } - #endif /* USE_PIKE_TYPE */ +     /* FIXME: Ought to handle or-nodes here. */ -  if(t && ( - #ifdef USE_PIKE_TYPE -  t->type - #else /* !USE_PIKE_TYPE */ -  t->str[0] - #endif /* USE_PIKE_TYPE */ -  == T_OBJECT)) +  if(t && (t->type == T_OBJECT))    { -  struct program *p = id_to_program( - #ifdef USE_PIKE_TYPE -  (ptrdiff_t)t->cdr - #else /* !USE_PIKE_TYPE */ -  extract_type_int(t->str+2) - #endif /* USE_PIKE_TYPE */ -  ); +  struct program *p = id_to_program((ptrdiff_t)t->cdr);    if(p)    {    int fun=FIND_LFUN(p, lfun);       /* FIXME: function type string should really be compiled from    * the arguments so that or:ed types are handled correctly    */    if(fun!=-1 &&    (t2 = check_call(function_type_string, ID_FROM_INT(p, fun)->type,    0)))
pike.git/src/builtin_functions.c:2332:    }    }    }       /* If it is an object, it *may* be overloaded, we or with    * the deftype....    */   #if 1    if(deftype)    { - #ifdef USE_PIKE_TYPE +     t2 = make_pike_type(deftype); - #else /* !USE_PIKE_TYPE */ -  t2 = make_shared_binary_string(deftype, deftypelen); - #endif /* USE_PIKE_TYPE */ +     t = n->type;    n->type = or_pike_types(t,t2,0);    free_type(t);    free_type(t2);    }   #endif    }       return 0; /* continue optimization */   }
pike.git/src/builtin_functions.c:7535: Inside #if 0
   tOr(tFunc(tStr,tStr), tFunc(tNone, tMap(tStr, tStr))),    ID_OPTIONAL);    ADD_PROTOTYPE("putenv", tFunc(tStr tStr, tVoid), ID_OPTIONAL);      #endif          pike___master_program = end_program();    add_program_constant("__master", pike___master_program, 0);    - #if USE_PIKE_TYPE +     /* FIXME: */    ADD_EFUN("replace_master", f_replace_master,    tFunc(tObj, tVoid), OPT_SIDE_EFFECT);    ADD_EFUN("master", f_master,    tFunc(tNone, tObj), OPT_EXTERNAL_DEPEND); - #else /* !USE_PIKE_TYPE */ + #if 0 /* FIXME: dtFunc isn't USE_PIKE_TYPE compatible */    ADD_EFUN_DTYPE("replace_master", f_replace_master,    dtFunc(dtObjImpl(pike___master_program), dtVoid),    OPT_SIDE_EFFECT);       /* function(:object) */    /* FIXME: */    ADD_EFUN_DTYPE("master", f_master,    dtFunc(dtNone, dtObjImpl(pike___master_program)),    OPT_EXTERNAL_DEPEND); - #endif /* USE_PIKE_TYPE */ + #endif /* 0 */       /* __master still contains a reference */    free_program(pike___master_program);      /* function(string,void|mixed:void) */    ADD_EFUN("add_constant", f_add_constant,    tFunc(tStr tOr(tVoid,tMix),tVoid),OPT_SIDE_EFFECT);      /* function(0=mixed ...:array(0)) */    ADD_EFUN("aggregate",debug_f_aggregate,