Fix SAlloc warnings
This commit is contained in:
+5
-10
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user