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. - || $Id: builtin_functions.c,v 1.665 2008/05/19 11:31:00 grubba Exp $ + || $Id: builtin_functions.c,v 1.666 2008/05/28 18:55:50 grubba Exp $   */      #include "global.h"   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"   #include "pike_error.h"
pike.git/src/builtin_functions.c:3324: Inside #if 0
   add_ref (o = t->frame->current_object);    pop_n_elems (args);    push_function (o, t->func);    return;    }    }   #endif       if(p)    { -  p = p->inherits[Pike_sp[-args].subtype].prog; -  /* FIXME: Does the following actually work for -  * the object subtype case? +  if (Pike_sp[-args].subtype) { +  /* FIXME: This probably works for the subtype-less case as well.    */ -  if((p->flags & PROGRAM_USES_PARENT) && +  struct external_variable_context loc; +  loc.o = o; +  p = (loc.inherit = p->inherits + Pike_sp[-args].subtype)->prog; +  if (p->flags & PROGRAM_USES_PARENT) { +  loc.parent_identifier = loc.inherit->parent_identifier; +  find_external_context(&loc, 1); +  add_ref(loc.o); +  pop_n_elems(args); +  push_function(loc.o, loc.parent_identifier); +  return; +  } +  } else if((p->flags & PROGRAM_USES_PARENT) &&    PARENT_INFO(o)->parent &&    PARENT_INFO(o)->parent->prog)    {    INT32 id=PARENT_INFO(o)->parent_identifier;    o=PARENT_INFO(o)->parent;    add_ref(o);    pop_n_elems(args);    push_function(o, id);    return; -  }else{ +  }    add_ref(p);    pop_n_elems(args);    push_program(p);    return;    }    } -  } +        pop_n_elems(args);    push_int(0);   }      node *fix_object_program_type(node *n)   {    /* Fix the type for a common case:    *    * object_program(object(is|implements foo))