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.190 2007/03/09 12:01:57 mast Exp $ + || $Id: mapping.c,v 1.191 2007/10/03 16:18: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:86:    md->free_list--; \    if (k != md->free_list) { \    struct keypair **prev_; \    unsigned INT32 h_; \    /* Move the last keypair to the new hole. */ \    *k = *(md->free_list); \    h_ = k->hval % md->hashsize; \    prev_ = md->hash + h_; \    DO_IF_DEBUG( \    if (!*prev_) { \ -  Pike_fatal("Node to move not found!\n"); \ +  Pike_fatal("Node to move not found!\n"); \    } \    ); \    while (*prev_ != md->free_list) { \    prev_ = &((*prev_)->next); \    DO_IF_DEBUG( \    if (!*prev_) { \ -  Pike_fatal("Node to move not found!\n"); \ +  Pike_fatal("Node to move not found!\n"); \    } \    ); \    } \    *prev_ = k; \    } \    } while(0)   #endif /* !PIKE_MAPPING_KEYPAIR_LOOP */      #ifdef PIKE_DEBUG   
pike.git/src/mapping.c:132: Inside #if defined(PIKE_DEBUG)
      if(val_types & ~(m->data->val_types))    Pike_fatal("Mapping value types out of order!\n");       if(ind_types & ~(m->data->ind_types))    Pike_fatal("Mapping indices types out of order!\n");   }   #endif      static struct mapping_data empty_data = -  { PIKE_CONSTANT_MEMOBJ_INIT(1), 1, 0,0,0,0,0,0, 0, 0,{0}}; +  { PIKE_CONSTANT_MEMOBJ_INIT(1), 1, 0,0,0,0,0,0, 0, +  (struct keypair *)&empty_data.hash, {0}};   static struct mapping_data weak_ind_empty_data = -  { PIKE_CONSTANT_MEMOBJ_INIT(1), 1, 0,0,0,0,0,0, MAPPING_WEAK_INDICES, 0,{0}}; +  { PIKE_CONSTANT_MEMOBJ_INIT(1), 1, 0,0,0,0,0,0, MAPPING_WEAK_INDICES, +  (struct keypair *)&weak_ind_empty_data.hash, {0}};   static struct mapping_data weak_val_empty_data = -  { PIKE_CONSTANT_MEMOBJ_INIT(1), 1, 0,0,0,0,0,0, MAPPING_WEAK_VALUES, 0,{0}}; +  { PIKE_CONSTANT_MEMOBJ_INIT(1), 1, 0,0,0,0,0,0, MAPPING_WEAK_VALUES, +  (struct keypair *)&weak_val_empty_data.hash, {0}};   static struct mapping_data weak_both_empty_data = -  { PIKE_CONSTANT_MEMOBJ_INIT(1), 1, 0,0,0,0,0,0, MAPPING_WEAK, 0,{0}}; +  { PIKE_CONSTANT_MEMOBJ_INIT(1), 1, 0,0,0,0,0,0, MAPPING_WEAK, +  (struct keypair *)&weak_both_empty_data.hash, {0}};      /** This function allocates the hash table and svalue space for a mapping    * struct. The size is the max number of indices that can fit in the    * allocated space.    */   static void init_mapping(struct mapping *m,    INT32 size,    INT16 flags)   {    struct mapping_data *md;
pike.git/src/mapping.c:1132:      PMOD_EXPORT struct svalue *simple_mapping_string_lookup(struct mapping *m,    const char *p)   {    struct pike_string *tmp;    if((tmp=findstring(p)))    return low_mapping_string_lookup(m,tmp);    return 0;   }    + /* Lookup in a mapping of mappings */   PMOD_EXPORT struct svalue *mapping_mapping_lookup(struct mapping *m,    struct svalue *key1,    struct svalue *key2,    int create)   {    struct svalue tmp;    struct mapping *m2;    struct svalue *s=low_mapping_lookup(m, key1);    debug_malloc_touch(m);