Commit 1934393c authored by Pekka Pessi's avatar Pekka Pessi
Browse files

su_alloc.c: fixed klocworks issues

darcs-hash:20080520172844-65a35-2b6337a472ecc058ef3723a330fe42c1a4c45efa.gz
parent 41ba4d29
......@@ -1087,7 +1087,7 @@ int su_home_move(su_home_t *dst, su_home_t *src)
else
used = s->sub_used;
if ((used && d == NULL) || 3 * used > 2 * d->sub_n) {
if (used && (d == NULL || 3 * used > 2 * d->sub_n)) {
if (d)
for (n = n2 = d->sub_n; 3 * used > 2 * n2; n2 = 4 * n2 + 3)
;
......@@ -1121,7 +1121,9 @@ int su_home_move(su_home_t *dst, su_home_t *src)
d = d2;
}
if ((n = s->sub_n)) {
if (s->sub_used) {
n = s->sub_n;
for (i = 0; i < n; i++)
if (s->sub_nodes[i].sua_data) {
su_block_add(d, s->sub_nodes[i].sua_data)[0] = s->sub_nodes[i];
......@@ -1133,6 +1135,7 @@ int su_home_move(su_home_t *dst, su_home_t *src)
}
if (s->sub_stats) {
/* XXX */
}
}
......@@ -1648,7 +1651,7 @@ void su_home_init_stats(su_home_t *home)
/** Retrieve statistics from memory home.
*/
void su_home_get_stats(su_home_t *home, int include_clones,
su_home_stat_t hs[1],
su_home_stat_t *hs,
isize_t size)
{
su_block_t *sub;
......@@ -1656,7 +1659,7 @@ void su_home_get_stats(su_home_t *home, int include_clones,
if (hs == NULL || size < (sizeof hs->hs_size))
return;
memset(hs, 0, size);
memset((void *)hs, 0, size);
sub = MEMLOCK(home);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment