pike.git / src / mapping.c

version» Context lines:

pike.git/src/mapping.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: mapping.c,v 1.217 2010/07/11 12:39:11 jonasw Exp $ + || $Id: mapping.c,v 1.218 2010/07/11 19:12:01 mast Exp $   */      #include "global.h"   #include "main.h"   #include "object.h"   #include "mapping.h"   #include "svalue.h"   #include "array.h"   #include "pike_macros.h"   #include "pike_error.h"
pike.git/src/mapping.c:2126: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG    if(d_flag)    check_mapping(m);   #endif    push_mapping(m);   }      PMOD_EXPORT struct mapping *copy_mapping_recursively(struct mapping *m,    struct mapping *p)   { +  int not_complex;    struct mapping *ret;    INT32 e;    struct keypair *k;    struct mapping_data *md; -  struct svalue aa, bb; +       #ifdef PIKE_DEBUG    if(m->data->refs <=0)    Pike_fatal("Zero refs in mapping->data\n");   #endif      #ifdef PIKE_DEBUG    if(d_flag > 1) check_mapping_type_fields(m);   #endif    -  if(!((m->data->val_types | m->data->ind_types) & BIT_COMPLEX)) -  return copy_mapping(m); -  +  if((m->data->val_types | m->data->ind_types) & BIT_COMPLEX) { +  not_complex = 0;    ret=allocate_mapping(MAP_SLOTS(m->data->size)); -  +  } +  else { +  not_complex = 1; +  ret = copy_mapping(m); +  }       if (p) { -  +  struct svalue aa, bb;    aa.type = T_MAPPING; -  aa.subtype = 0; +     aa.u.mapping = m;    bb.type = T_MAPPING; -  bb.subtype = 0; +     bb.u.mapping = ret;    mapping_insert(p, &aa, &bb);    }    -  +  if (not_complex) +  return ret; +     ret->data->flags = m->data->flags;       check_stack(2);       md=m->data;    md->valrefs++;    add_ref(md);    NEW_MAPPING_LOOP(md)    {    /* Place holders.