Fix SAlloc warnings

This commit is contained in:
Nils O. Selåsdal
2025-07-05 20:03:00 +02:00
parent fb8979d695
commit 7373a93f9b
+5 -10
View File
@@ -36,18 +36,13 @@ alloc_chunk(size_t sz)
static Chunk *
add_chunk(SAlloc *p, Chunk *c)
{
Chunk *newchunk;
if (c == NULL)
return NULL;
return c;
if (p->current != NULL)
p->current->next = newchunk;
c->next = NULL;
c->firstfree = 0;
newchunk->next = NULL;
newchunk->firstfree = 0;
return newchunk;
return c;
}
static Chunk *
@@ -78,7 +73,7 @@ uc_new_salloc(size_t chunksz)
if (first == NULL) {
return NULL;
}
p = &first->data.data[0];
p = (SAlloc *)&first->data.data[0];
first->firstfree = sizeof *p;
p->chunksz = chunksz;
p->current = NULL;