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.117 2001/09/11 05:37:26 hubbe Exp $"); + RCSID("$Id: array.c,v 1.118 2001/09/24 14:21:10 grubba 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:346:    ITEM(a)[a->size].type=T_INT;    ITEM(a)[a->size].subtype=NUMBER_NUMBER;    ITEM(a)[a->size].u.integer=0;    }    a->type_field |= BIT_INT;    return a;    }else{    struct array *ret;    ret=low_allocate_array(size, (size>>1) + 4);    MEMCPY(ITEM(ret),ITEM(a),sizeof(struct svalue)*a->size); -  ret->type_field = a->type_field | BIT_INT; +  ret->type_field = DO_NOT_WARN((TYPE_FIELD)(a->type_field | BIT_INT));    a->size=0;    free_array(a);    return ret;    }    }else{    /* We should shrink the array */    free_svalues(ITEM(a)+size, a->size - size, a->type_field);    a->size = size;    return a;    }
pike.git/src/array.c:676:    current_order+v->size-1,    fun,    ITEM(v));       UNSET_ONERROR(tmp);    return current_order;   }      INLINE int set_svalue_cmpfun(const struct svalue *a, const struct svalue *b)   { -  INT32 def,fun; +  INT32 def;    if(a->type == b->type)    {    switch(a->type)    {    case T_FLOAT:    if(a->u.float_number < b->u.float_number) return -1;    if(a->u.float_number > b->u.float_number) return 1;    return 0;       case T_FUNCTION:
pike.git/src/array.c:2072:    debug_gc_check_weak_svalues(ITEM(a), a->size, T_ARRAY, a);    gc_checked_as_weak(a);    }    else    debug_gc_check_svalues(ITEM(a), a->size, T_ARRAY, a);    }   }      void gc_mark_array_as_referenced(struct array *a)   { -  int e; +     if(gc_mark(a)) {   #ifdef PIKE_DEBUG    if (a == &empty_array || a == &weak_empty_array || a == &weak_shrink_empty_array)    fatal("Trying to gc mark some *_empty_array.\n");   #endif       if (a == gc_mark_array_pos)    gc_mark_array_pos = a->next;    if (a == gc_internal_array)    gc_internal_array = a->next;
pike.git/src/array.c:2141:    }    gc_assert_checked_as_nonweak(a);    }    }    }   }      void real_gc_cycle_check_array(struct array *a, int weak)   {    GC_CYCLE_ENTER(a, weak) { -  int e; +    #ifdef PIKE_DEBUG    if (a == &empty_array || a == &weak_empty_array || a == &weak_shrink_empty_array)    fatal("Trying to gc cycle check some *_empty_array.\n");   #endif       if (a->type_field & BIT_COMPLEX)    {    if (a->flags & ARRAY_WEAK_FLAG) {    if (gc_cycle_check_weak_svalues(ITEM(a), a->size)) {   #ifdef PIKE_DEBUG