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.105 2001/10/15 09:34:59 mast Exp $"); + RCSID("$Id: array.c,v 1.106 2002/03/06 11:01:58 grubba 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:2316:    }    tmp=aggregate_array(q);    if(tmp->size) tmp->type_field=BIT_ARRAY;    return tmp;   }      PMOD_EXPORT struct array *implode_array(struct array *a, struct array *b)   {    INT32 e,size;    struct array *ret; +  +  if (!a->size) { +  add_ref(a); +  return a; +  } +     size=0;    for(e=0;e<a->size;e++)    {    if(ITEM(a)[e].type!=T_ARRAY)    Pike_error("Implode array contains non-arrays.\n");    size+=ITEM(a)[e].u.array->size;    }       ret=allocate_array((a->size -1) * b->size + size);    size=0;