pike.git / src / array.c

version» Context lines:

pike.git/src/array.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: array.c,v 1.162 2004/09/22 18:00:48 nilsson Exp $ + || $Id: array.c,v 1.163 2005/02/14 15:54:59 mast Exp $   */      #include "global.h"   #include "svalue.h"   #include "array.h"   #include "object.h"   #include "las.h"   #include "stralloc.h"   #include "interpret.h"   #include "opcodes.h"
pike.git/src/array.c:20:   #include "pike_memory.h"   #include "gc.h"   #include "main.h"   #include "pike_security.h"   #include "stuff.h"   #include "bignum.h"   #include "cyclic.h"   #include "multiset.h"   #include "mapping.h"    - RCSID("$Id: array.c,v 1.162 2004/09/22 18:00:48 nilsson Exp $"); + RCSID("$Id: array.c,v 1.163 2005/02/14 15:54:59 mast Exp $");      PMOD_EXPORT struct array empty_array=   {    PIKE_CONSTANT_MEMOBJ_INIT(1), /* Never free */    &weak_empty_array, /* Next */    0, /* previous */    0, /* Size = 0 */    0, /* malloced Size = 0 */    0, /* no types */    0, /* no flags */
pike.git/src/array.c:169:    if (a)    free_array(a);   }      PMOD_EXPORT struct array *array_set_flags(struct array *a, int flags)   {    if (a->size)    a->flags = flags;    else {    free_array(a); -  switch (flags) { +  switch (flags & (ARRAY_WEAK_FLAG|ARRAY_WEAK_SHRINK)) {    case 0:    add_ref(a = &empty_array); break;    case ARRAY_WEAK_FLAG:    add_ref(a = &weak_empty_array); break;    case ARRAY_WEAK_FLAG|ARRAY_WEAK_SHRINK:    add_ref(a = &weak_shrink_empty_array); break;    default:    Pike_fatal("Invalid flags %x\n", flags);    }    }
pike.git/src/array.c:2110:   {    struct processing doing;    struct array *ret;      #ifdef PIKE_DEBUG    if(d_flag > 1) array_check_type_field(a);   #endif       if (!a->size) {    add_ref(&empty_array); -  return array_set_flags(&empty_array, a->flags & ~ARRAY_LVALUE); +  return array_set_flags(&empty_array, a->flags);    }       doing.next=p;    doing.pointer_a=(void *)a;    for(;p;p=p->next)    {    if(p->pointer_a == (void *)a)    {    ret=(struct array *)p->pointer_b;    add_ref(ret);