pike.git / src / array.c

version» Context lines:

pike.git/src/array.c:16:   #include "pike_types.h"   #include "fsort.h"   #include "builtin_functions.h"   #include "pike_memory.h"   #include "gc.h"   #include "main.h"   #include "security.h"   #include "stuff.h"   #include "bignum.h"    - RCSID("$Id: array.c,v 1.118 2001/09/24 14:21:10 grubba Exp $"); + RCSID("$Id: array.c,v 1.119 2001/09/25 05:55:09 hubbe Exp $");      PMOD_EXPORT struct array empty_array=   {    PIKE_CONSTANT_MEMOBJ_INIT(1), /* Never free */    &weak_empty_array, /* Next */    &weak_shrink_empty_array, /* previous (circular) */    0, /* Size = 0 */    0, /* malloced Size = 0 */    0, /* no types */    0, /* no flags */
pike.git/src/array.c:1575:    check_array_for_destruct(a);       if(a->type_field & b->type_field)    {    return merge_array_with_order(a, b, PIKE_ARRAY_OP_AND_LEFT);    }else{    return allocate_array_no_init(0,0);    }   }    - int check_that_array_is_constant(struct array *a) + int array_is_constant(struct array *a, +  struct processing *p)   {    array_fix_type_field(a); -  if(a->type_field & (BIT_FUNCTION | BIT_OBJECT)) -  { -  int e; -  for(e=0;e<a->size;e++) -  { -  switch(ITEM(a)[e].type) -  { -  case T_FUNCTION: -  if(ITEM(a)[e].subtype == FUNCTION_BUILTIN) continue; -  /* Fall through */ -  case T_OBJECT: -  if(ITEM(a)[e].u.object -> next == ITEM(a)[e].u.object) -  { -  /* This is a fake object used during the -  * compilation! -  */ -  return 0; +  return svalues_are_constant(ITEM(a), +  a->size, +  a->type_field, +  p);   } -  } -  } -  } -  return 1; - } +       node *make_node_from_array(struct array *a)   {    struct svalue s;    INT32 e;       array_fix_type_field(a);    if(!a->size)    return mkefuncallnode("aggregate",0);   
pike.git/src/array.c:1659:    break;    break;    }    debug_malloc_touch(a);    if(e == a->size)    return mkefuncallnode("allocate",mknode(F_ARG_LIST,    mkintnode(a->size),    mksvaluenode(ITEM(a))));    }    -  if(check_that_array_is_constant(a)) +  if(array_is_constant(a,0))    {    debug_malloc_touch(a);    s.type=T_ARRAY;    s.subtype=0;    s.u.array=a;    return mkconstantsvaluenode(&s);    }else{    node *ret=0;    debug_malloc_touch(a);    for(e=0; e<a->size; e++)