Fix SAlloc warnings
This commit is contained in:
+5
-10
@@ -36,18 +36,13 @@ alloc_chunk(size_t sz)
|
|||||||
static Chunk *
|
static Chunk *
|
||||||
add_chunk(SAlloc *p, Chunk *c)
|
add_chunk(SAlloc *p, Chunk *c)
|
||||||
{
|
{
|
||||||
Chunk *newchunk;
|
|
||||||
|
|
||||||
if (c == NULL)
|
if (c == NULL)
|
||||||
return NULL;
|
return c;
|
||||||
|
|
||||||
if (p->current != NULL)
|
c->next = NULL;
|
||||||
p->current->next = newchunk;
|
c->firstfree = 0;
|
||||||
|
|
||||||
newchunk->next = NULL;
|
return c;
|
||||||
newchunk->firstfree = 0;
|
|
||||||
|
|
||||||
return newchunk;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Chunk *
|
static Chunk *
|
||||||
@@ -78,7 +73,7 @@ uc_new_salloc(size_t chunksz)
|
|||||||
if (first == NULL) {
|
if (first == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
p = &first->data.data[0];
|
p = (SAlloc *)&first->data.data[0];
|
||||||
first->firstfree = sizeof *p;
|
first->firstfree = sizeof *p;
|
||||||
p->chunksz = chunksz;
|
p->chunksz = chunksz;
|
||||||
p->current = NULL;
|
p->current = NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user