Branch: Tag:

2003-11-28

2003-11-28 15:44:27 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Added really_low_reference_inherited_identifier().

Rev: src/program.c:1.541
Rev: src/program.h:1.195

2:   || 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: program.c,v 1.540 2003/11/24 17:28:45 grubba Exp $ + || $Id: program.c,v 1.541 2003/11/28 15:44:26 grubba Exp $   */      #include "global.h" - RCSID("$Id: program.c,v 1.540 2003/11/24 17:28:45 grubba Exp $"); + RCSID("$Id: program.c,v 1.541 2003/11/28 15:44:26 grubba Exp $");   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"
3289:    Pike_compiler->new_program->optimize = opt;   }    + int really_low_reference_inherited_identifier(struct program_state *q, +  int e, +  int i) + { +  struct program *np=(q?q:Pike_compiler)->new_program; +  struct reference funp; +  struct program *p; +  int d; +  +  if(i==-1) return -1; +  +  p = np->inherits[e].prog; +  +  funp = p->identifier_references[i]; +  funp.inherit_offset += e; +  funp.id_flags = (funp.id_flags & ~ID_INHERITED) | ID_INLINE|ID_HIDDEN; +  +  for(d=0;d<(int)np->num_identifier_references;d++) +  { +  struct reference *refp; +  refp=np->identifier_references+d; +  +  if(!MEMCMP((char *)refp,(char *)&funp,sizeof funp)) return d; +  } +  +  if(q) +  low_add_to_identifier_references(q,funp); +  else +  add_to_identifier_references(funp); +  return np->num_identifier_references -1; + } +    int low_reference_inherited_identifier(struct program_state *q,    int e,    struct pike_string *name,
3314:    if(!(flags & SEE_PRIVATE))    return -1;    -  funp=p->identifier_references[i]; -  funp.inherit_offset+=e; -  funp.id_flags = (funp.id_flags & ~ID_INHERITED) | ID_INLINE|ID_HIDDEN; -  -  for(d=0;d<(int)np->num_identifier_references;d++) -  { -  struct reference *refp; -  refp=np->identifier_references+d; -  -  if(!MEMCMP((char *)refp,(char *)&funp,sizeof funp)) return d; +  return really_low_reference_inherited_identifier(q, e, i);   }    -  if(q) -  low_add_to_identifier_references(q,funp); -  else -  add_to_identifier_references(funp); -  return np->num_identifier_references -1; - } -  +    int find_inherit(struct program *p, struct pike_string *name)   {    int e;