pike.git / src / encode.c

version» Context lines:

pike.git/src/encode.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: encode.c,v 1.291 2009/08/18 13:57:16 grubba Exp $ + || $Id: encode.c,v 1.292 2009/08/19 18:31:34 grubba Exp $   */      #include "global.h"   #include "stralloc.h"   #include "pike_macros.h"   #include "object.h"   #include "constants.h"   #include "interpret.h"   #include "svalue.h"   #include "mapping.h"
pike.git/src/encode.c:1325: Inside #if defined(PIKE_PORTABLE_BYTECODE)
   }   #endif /* 0 */    }    }   #endif /* PIKE_PORTABLE_BYTECODE */    /* Dump the identifiers in a portable manner... */    {    int inherit_num = 1;    struct svalue str_sval;    char *id_dumped = (char *) alloca(p->num_identifiers); +  int d_min = 0;    MEMSET(id_dumped,0,p->num_identifiers);    str_sval.type = T_STRING;    str_sval.subtype = 0;       EDB(2,    fprintf(stderr, "%*sencode: encoding references\n",    data->depth, ""));      #ifdef ENCODE_DEBUG    data->depth += 2;
pike.git/src/encode.c:1608:   #endif /* PIKE_PORTABLE_BYTECODE */       /* opt_flags */    code_number(id->opt_flags, data);    break;       case IDENTIFIER_C_FUNCTION:    /* Not supported. */    Pike_error("Cannot encode functions implemented in C "    "(identifier=\"%S\").\n", -  p->identifiers[d].name); +  id->name);    break;       case IDENTIFIER_VARIABLE: -  +  if (d < d_min) {    EDB(3, -  +  fprintf(stderr, "%*sencode: Skipping overloaded variable \"%s\"\n", +  data->depth, "", +  id->name->str)); +  /* We still want to dump it later... */ +  id_dumped[ref->identifier_offset] = 0; +  goto next_identifier_ref; +  } +  EDB(3,    fprintf(stderr, "%*sencode: encoding variable\n",    data->depth, ""));    encode_entry_variable:    code_number(ID_ENTRY_VARIABLE, data);    if (gs_flags >= 0) {    code_number(gs_flags, data);    } else {    code_number(ref->id_flags, data);    }   
pike.git/src/encode.c:1672:       /* Flags that have been set by/after the inherit. */    INT16 inherit_flags_set = 0;    /* Mask of flags that may have been affected by    * the inherit. */    INT16 inherit_flags_mask = ~(ID_HIDDEN|ID_INHERITED);    struct inherit *inh = p->inherits + inherit_num;    struct reference *ref = p->identifier_references + d;    int i;    +  /* The references from this inherit stop at this point. */ +  d_min = inh->identifier_level + +  inh->prog->num_identifier_references; +     EDB(3,    fprintf(stderr, "%*sencode: encoding inherit\n",    data->depth, ""));      #ifdef ENCODE_DEBUG    data->depth += 2;   #endif       code_number(ID_ENTRY_INHERIT, data);