pike.git / src / mapping.c

version» Context lines:

pike.git/src/mapping.c:110:    *prev_ = k; \    } \    } while(0)   #endif /* !PIKE_MAPPING_KEYPAIR_LOOP */      void mapping_free_keypair(struct mapping_data *md, struct keypair *k)   {    FREE_KEYPAIR(md, k);   }    + static INLINE int check_type_contains(TYPE_FIELD types, const struct svalue * s) { +  return (TYPEOF(*s) == PIKE_T_OBJECT || types & (BIT_OBJECT|(1 << TYPEOF(*s)))); + } +    #ifdef PIKE_DEBUG      /** This function checks that the type field isn't lacking any bits.    * It is used for debugging purposes only.    */   static void check_mapping_type_fields(const struct mapping *m)   {    INT32 e;    const struct keypair *k=0;    const struct mapping_data *md;
pike.git/src/mapping.c:542:      #define MAPPING_DATA_IN_USE(MD) ((MD)->refs != (MD)->hardlinks + 1)      #define LOW_FIND(FUN, KEY, FOUND, NOT_FOUND) do { \    md=m->data; \    add_ref(md); \    if(md->hashsize) \    { \    h=h2 & (md->hashsize - 1); \    DO_IF_DEBUG( if(d_flag > 1) check_mapping_type_fields(m); ) \ -  if(md->ind_types & ((1 << TYPEOF(*key)) | BIT_OBJECT)) \ +  if(check_type_contains(md->ind_types, key)) \    { \    for(prev= md->hash + h;(k=*prev);prev=&k->next) \    { \    if(h2 == k->hval && FUN(& k->ind, KEY)) \    { \    FOUND; \    } \    } \    } \    } \
pike.git/src/mapping.c:565:         #define LOW_FIND2(FUN, KEY, FOUND, NOT_FOUND) do { \    struct keypair *k2; \    md=m->data; \    add_ref(md); \    if(md->hashsize) \    { \    h=h2 & (md->hashsize-1); \    DO_IF_DEBUG( if(d_flag > 1) check_mapping_type_fields(m); ) \ -  if(md->ind_types & ((1 << TYPEOF(*key)) | BIT_OBJECT)) \ +  if(check_type_contains(md->ind_types, key)) \    { \    k2=omd->hash[h2 & (omd->hashsize - 1)]; \    prev= md->hash + h; \    for(;(k=*prev) && k2;(prev=&k->next),(k2=k2->next)) \    if(!(h2 == k->hval && is_identical(&k2->ind, &k->ind))) \    break; \    for(;(k=*prev);prev=&k->next) \    { \    if(FUN(& k->ind, KEY)) \    { \