pike.git / src / array.c

version» Context lines:

pike.git/src/array.c:17:   #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.103 2001/06/26 12:42:02 grubba Exp $"); + RCSID("$Id: array.c,v 1.104 2001/09/28 23:18:51 hubbe Exp $");      PMOD_EXPORT struct array empty_array=   {    1, /* Never free */   #ifdef PIKE_SECURITY    0,   #endif    &weak_empty_array, /* Next */    &weak_shrink_empty_array, /* previous (circular) */    0, /* Size = 0 */
pike.git/src/array.c:1543:    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);       if(a->type_field == BIT_INT)
pike.git/src/array.c:1623:    ITEM(a)[e].subtype != ITEM(a)[0].subtype)    break;    break;    }    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))    {    s.type=T_ARRAY;    s.subtype=0;    s.u.array=a;    return mkconstantsvaluenode(&s);    }else{    node *ret=0;    for(e=0; e<a->size; e++)    ret=mknode(F_ARG_LIST,ret,mksvaluenode(ITEM(a)+e));    return mkefuncallnode("aggregate",ret);