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.202 2008/06/24 18:45:56 grubba Exp $ + || $Id: mapping.c,v 1.203 2008/06/24 19:35:51 grubba 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:1503:    if ((k2->hval == k->hval) && is_eq(&k2->ind, &k->ind)) {    break;    }    }    if (!k2) {    map_delete(res, &k->ind);    }    }    UNSET_ONERROR(err);    if (a_md->generation_cnt > b_md->generation_cnt) -  res->generation_cnt = a_md->generation_cnt; +  res->data->generation_cnt = a_md->generation_cnt;    else -  res->generation_cnt = b_md->generation_cnt; +  res->data->generation_cnt = b_md->generation_cnt;    return res;   }      static struct mapping *or_mappings(struct mapping *a, struct mapping *b)   {    struct mapping *res;    struct keypair *k;    struct mapping_data *a_md = a->data;    struct mapping_data *b_md = b->data;    INT32 e;
pike.git/src/mapping.c:1542:    if ((k2->hval == k->hval) && is_eq(&k2->ind, &k->ind)) {    break;    }    }    if (!k2) {    mapping_insert(res, &k->ind, &k->val);    }    }    UNSET_ONERROR(err);    if (a_md->generation_cnt > b_md->generation_cnt) -  res->generation_cnt = a_md->generation_cnt; +  res->data->generation_cnt = a_md->generation_cnt;    else -  res->generation_cnt = b_md->generation_cnt; +  res->data->generation_cnt = b_md->generation_cnt;    return res;   }      static struct mapping *xor_mappings(struct mapping *a, struct mapping *b)   {    struct mapping *res;    struct keypair *k;    struct mapping_data *a_md = a->data;    struct mapping_data *b_md = b->data;    INT32 e;
pike.git/src/mapping.c:1590:    }    }    if (!k2) {    mapping_insert(res, &k->ind, &k->val);    } else {    map_delete(res, &k2->ind);    }    }    UNSET_ONERROR(err);    if (a_md->generation_cnt > b_md->generation_cnt) -  res->generation_cnt = a_md->generation_cnt; +  res->data->generation_cnt = a_md->generation_cnt;    else -  res->generation_cnt = b_md->generation_cnt; +  res->data->generation_cnt = b_md->generation_cnt;    return res;   }      PMOD_EXPORT struct mapping *merge_mappings(struct mapping *a, struct mapping *b, INT32 op)   {    ONERROR r1,r2,r3,r4;    struct array *ai, *av;    struct array *bi, *bv;    struct array *ci, *cv;    INT32 *zipper;
pike.git/src/mapping.c:1670:    UNSET_ONERROR(r2); free_array(bv);    UNSET_ONERROR(r1); free_array(av);       free((char *)zipper);       m=mkmapping(ci, cv);    free_array(ci);    free_array(cv);       if (a->data->generation_cnt > b->data->generation_cnt) -  m->generation_cnt = a->data->generation_cnt; +  m->data->generation_cnt = a->data->generation_cnt;    else -  m->generation_cnt = b->data->generation_cnt; +  m->data->generation_cnt = b->data->generation_cnt;    return m;   }      /* FIXME: What are the semantics for this function?    * FIXME: It ought to be optimized just like the unordered variant.    * /grubba 2003-11-12    */   PMOD_EXPORT struct mapping *merge_mapping_array_ordered(struct mapping *a,    struct array *b, INT32 op)   {
pike.git/src/mapping.c:1726:       UNSET_ONERROR(r2); free_array(av);    UNSET_ONERROR(r1); free_array(ai);       free((char *)zipper);       m=mkmapping(ci, cv);    free_array(ci);    free_array(cv);    -  if (a->data->generation_cnt > b->data->generation_cnt) -  m->generation_cnt = a->data->generation_cnt; -  else -  m->generation_cnt = b->data->generation_cnt; +  m->data->generation_cnt = a->data->generation_cnt;    return m;   }      PMOD_EXPORT struct mapping *merge_mapping_array_unordered(struct mapping *a,    struct array *b, INT32 op)   {    ONERROR r1;    struct array *b_temp;    INT32 *zipper;    struct mapping *m;
pike.git/src/mapping.c:1819:       add_ref(md);    NEW_MAPPING_LOOP(md)    low_mapping_insert(ret, &k->ind, &k->val, 2);    free_mapping_data(md);    }   #ifdef PIKE_DEBUG    if(!ret)    Pike_fatal("add_mappings is confused!\n");   #endif -  ret->md->generation_cnt = generation; +  ret->data->generation_cnt = generation;    return ret;   }      PMOD_EXPORT int mapping_equal_p(struct mapping *a, struct mapping *b, struct processing *p)   {    struct processing curr;    struct keypair *k;    struct mapping_data *md;    INT32 e,eq=1;