bucket->h.weight = size * item_weight;
bucket->item_weight = item_weight;
- bucket->h.items = malloc(sizeof(__u32)*size);
+ bucket->h.items = malloc(sizeof(__s32)*size);
if (!bucket->h.items)
goto err;
bucket->h.type = type;
bucket->h.size = size;
- bucket->h.items = malloc(sizeof(__u32)*size);
+ bucket->h.items = malloc(sizeof(__s32)*size);
if (!bucket->h.items)
goto err;
bucket->h.perm = malloc(sizeof(__u32)*size);
bucket->h.type = type;
bucket->h.size = size;
- bucket->h.items = malloc(sizeof(__u32)*size);
+ bucket->h.items = malloc(sizeof(__s32)*size);
if (!bucket->h.items)
goto err;
bucket->h.perm = malloc(sizeof(__u32)*size);
if (!bucket->node_weights)
goto err;
- memset(bucket->h.items, 0, sizeof(__u32)*bucket->h.size);
+ memset(bucket->h.items, 0, sizeof(__s32)*bucket->h.size);
memset(bucket->node_weights, 0, sizeof(__u32)*bucket->num_nodes);
for (i=0; i<size; i++) {
bucket->h.type = type;
bucket->h.size = size;
- bucket->h.items = malloc(sizeof(__u32)*size);
+ bucket->h.items = malloc(sizeof(__s32)*size);
if (!bucket->h.items)
goto err;
bucket->h.perm = malloc(sizeof(__u32)*size);
{
int newsize = bucket->h.size + 1;
- bucket->h.items = realloc(bucket->h.items, sizeof(__u32)*newsize);
+ bucket->h.items = realloc(bucket->h.items, sizeof(__s32)*newsize);
bucket->h.perm = realloc(bucket->h.perm, sizeof(__u32)*newsize);
bucket->h.items[newsize-1] = item;
{
int newsize = bucket->h.size + 1;
- bucket->h.items = realloc(bucket->h.items, sizeof(__u32)*newsize);
+ bucket->h.items = realloc(bucket->h.items, sizeof(__s32)*newsize);
bucket->h.perm = realloc(bucket->h.perm, sizeof(__u32)*newsize);
bucket->item_weights = realloc(bucket->item_weights, sizeof(__u32)*newsize);
bucket->sum_weights = realloc(bucket->sum_weights, sizeof(__u32)*newsize);
int j;
bucket->num_nodes = 1 << depth;
- bucket->h.items = realloc(bucket->h.items, sizeof(__u32)*newsize);
+ bucket->h.items = realloc(bucket->h.items, sizeof(__s32)*newsize);
bucket->h.perm = realloc(bucket->h.perm, sizeof(__u32)*newsize);
bucket->node_weights = realloc(bucket->node_weights, sizeof(__u32)*bucket->num_nodes);
{
int newsize = bucket->h.size + 1;
- bucket->h.items = realloc(bucket->h.items, sizeof(__u32)*newsize);
+ bucket->h.items = realloc(bucket->h.items, sizeof(__s32)*newsize);
bucket->h.perm = realloc(bucket->h.perm, sizeof(__u32)*newsize);
bucket->item_weights = realloc(bucket->item_weights, sizeof(__u32)*newsize);
bucket->straws = realloc(bucket->straws, sizeof(__u32)*newsize);
newsize = --bucket->h.size;
bucket->h.weight -= bucket->item_weight;
- bucket->h.items = realloc(bucket->h.items, sizeof(__u32)*newsize);
+ bucket->h.items = realloc(bucket->h.items, sizeof(__s32)*newsize);
bucket->h.perm = realloc(bucket->h.perm, sizeof(__u32)*newsize);
return 0;
}
bucket->h.weight -= weight;
newsize = --bucket->h.size;
- bucket->h.items = realloc(bucket->h.items, sizeof(__u32)*newsize);
+ bucket->h.items = realloc(bucket->h.items, sizeof(__s32)*newsize);
bucket->h.perm = realloc(bucket->h.perm, sizeof(__u32)*newsize);
bucket->item_weights = realloc(bucket->item_weights, sizeof(__u32)*newsize);
bucket->sum_weights = realloc(bucket->sum_weights, sizeof(__u32)*newsize);
if (newsize != bucket->h.size) {
int olddepth, newdepth;
- bucket->h.items = realloc(bucket->h.items, sizeof(__u32)*newsize);
+ bucket->h.items = realloc(bucket->h.items, sizeof(__s32)*newsize);
bucket->h.perm = realloc(bucket->h.perm, sizeof(__u32)*newsize);
olddepth = calc_depth(bucket->h.size);
if (i == bucket->h.size)
return -ENOENT;
- bucket->h.items = realloc(bucket->h.items, sizeof(__u32)*newsize);
+ bucket->h.items = realloc(bucket->h.items, sizeof(__s32)*newsize);
bucket->h.perm = realloc(bucket->h.perm, sizeof(__u32)*newsize);
bucket->item_weights = realloc(bucket->item_weights, sizeof(__u32)*newsize);
bucket->straws = realloc(bucket->straws, sizeof(__u32)*newsize);