pike.git / src / array.c

version» Context lines:

pike.git/src/array.c:224:    v->refs++;    check_destructed(s);    if(v->array_type == T_MIXED)    {    v->type_field |= 1 << s->type;    assign_svalue( ITEM(v) + index, s);    }else if(IS_ZERO(s)){    v->type_field |= BIT_INT;    SHORT_ITEM(v)[index].refs=0;    }else if(v->array_type == s->type){ +  v->type_field |= 1 << s->type;    assign_to_short_svalue( SHORT_ITEM(v)+index, v->array_type, s);    }else{    free_array(v);    error("Wrong type in array assignment (%s != %s)\n",    get_name_of_type(v->array_type),    get_name_of_type(s->type));    }    free_array(v);   }   
pike.git/src/array.c:265:       /* Can we fit it into the existing block? */    if(v->refs<=1 && v->malloced_size > v->size)    {    if(v->array_type == T_MIXED)    {    MEMMOVE((char *)(ITEM(v)+index+1),    (char *)(ITEM(v)+index),    (v->size-index) * sizeof(struct svalue));    ITEM(v)[index].type=T_INT; + #ifdef __CHECKER__ +  ITEM(v)[index].subtype=0; +  ITEM(v)[index].u.refs=0; + #endif    }else{    MEMMOVE((char *)(SHORT_ITEM(v)+index+1),    (char *)(SHORT_ITEM(v)+index),    (v->size-index) * sizeof(union anything));    SHORT_ITEM(v)[index].refs=0;    }    v->size++;    }else{    struct array *ret;       ret=allocate_array_no_init(v->size+1, (v->size >> 3) + 1, v->array_type);    ret->type_field = v->type_field;       if(v->array_type == T_MIXED)    {    MEMCPY(ITEM(ret), ITEM(v), sizeof(struct svalue) * index);    MEMCPY(ITEM(ret)+index+1, ITEM(v)+index, sizeof(struct svalue) * (v->size-index));    ITEM(ret)[index].type=T_INT; -  + #ifdef __CHECKER__ +  ITEM(ret)[index].subtype=0; +  ITEM(ret)[index].u.refs=0; + #endif    }else{    MEMCPY(SHORT_ITEM(ret), SHORT_ITEM(v), sizeof(union anything) * index);       MEMCPY(SHORT_ITEM(ret)+index+1,    SHORT_ITEM(v)+index,    sizeof(union anything) * (v->size-index));    SHORT_ITEM(ret)[index].refs=0;    }    v->size=0;    free_array(v);
pike.git/src/array.c:847:    a=c+1;    else if(q > 0)    b=c;    else    return c;    }    if(a<v->size && fun(ITEM(v)+a,s)<0) a++;    return ~a;       }else if(s->type == v->array_type || -  (s->type==T_INT && v->array_type != T_FLOAT)){ +  (IS_ZERO(s) && v->array_type != T_FLOAT)){    short_cmpfun fun; -  +  if(IS_ZERO(s)) +  MEMSET((char *)&s->u, 0, sizeof(union anything)); +     fun=backfun(v->array_type);       a=0;    b=v->size;    while(b > a)    {    c=(a+b)/2;    q=fun(SHORT_ITEM(v)+c,&s->u);       if(q < 0)
pike.git/src/array.c:1002:    case BIT_ARRAY: type=T_ARRAY; goto do_compact;    case BIT_MAPPING: type=T_MAPPING; goto do_compact;    case BIT_LIST: type=T_LIST; goto do_compact;    case BIT_OBJECT: type=T_OBJECT; goto do_compact;    case BIT_PROGRAM: type=T_PROGRAM; goto do_compact;       do_compact:    ret=allocate_array_no_init(v->size, 0, type);    for(e=0; e<v->size; e++)    assign_to_short_svalue_no_free(SHORT_ITEM(ret)+e, -  ITEM(v)[e].type, +  type,    ITEM(v)+e);    free_array(v);    return ret;       default:    return v;    }   }      /*