pike.git / src / mapping.c

version» Context lines:

pike.git/src/mapping.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: mapping.c,v 1.122 2001/09/28 23:18:53 hubbe Exp $"); + RCSID("$Id: mapping.c,v 1.123 2001/10/03 22:22:20 hubbe Exp $");   #include "main.h"   #include "object.h"   #include "mapping.h"   #include "svalue.h"   #include "array.h"   #include "pike_macros.h"   #include "pike_error.h"   #include "pike_memory.h"   #include "dynamic_buffer.h"   #include "interpret.h"
pike.git/src/mapping.c:2329:    next=m->next;       /* free_mapping(m); */    }   }         int mapping_is_constant(struct mapping *m,    struct processing *p)   { +  int ret=1;    INT32 e;    struct keypair *k;    struct mapping_data *md=m->data;       if( (md->ind_types | md->val_types) & ~(BIT_INT|BIT_FLOAT|BIT_STRING))    {    md->valrefs++;    add_ref(md);    NEW_MAPPING_LOOP(md)    { -  if(!svalues_are_constant(&k->ind, 1, md->ind_types, p)) return 0; -  if(!svalues_are_constant(&k->val, 1, md->val_types, p)) return 0; +  if(!svalues_are_constant(&k->ind, 1, md->ind_types, p) || +  !svalues_are_constant(&k->val, 1, md->val_types, p)) +  { +  ret=0; +  e=md->hashsize; +  break;    } -  +  }    md->valrefs--;    free_mapping_data(md);    } -  return 1; +  return ret;   }