Replaced malloc/memset pairs with single calloc() call.
This commit is contained in:
parent
4dbae90e80
commit
1f11d1c462
@ -29,8 +29,7 @@ struct burn_source *burn_source_new(void)
|
||||
{
|
||||
struct burn_source *out;
|
||||
|
||||
out = malloc(sizeof(struct burn_source));
|
||||
memset(out, 0, sizeof(struct burn_source));
|
||||
out = calloc(1, sizeof(struct burn_source));
|
||||
out->refcount = 1;
|
||||
return out;
|
||||
}
|
||||
|
@ -39,8 +39,7 @@ extern struct libdax_msgs *libdax_messenger;
|
||||
struct burn_disc *burn_disc_create(void)
|
||||
{
|
||||
struct burn_disc *d;
|
||||
d = malloc(sizeof(struct burn_disc));
|
||||
memset(d, 0, sizeof(struct burn_disc));
|
||||
d = calloc(1, sizeof(struct burn_disc));
|
||||
d->refcnt = 1;
|
||||
d->sessions = 0;
|
||||
d->session = NULL;
|
||||
@ -64,8 +63,7 @@ void burn_disc_free(struct burn_disc *d)
|
||||
struct burn_session *burn_session_create(void)
|
||||
{
|
||||
struct burn_session *s;
|
||||
s = malloc(sizeof(struct burn_session));
|
||||
memset(s, 0, sizeof(struct burn_session));
|
||||
s = calloc(1, sizeof(struct burn_session));
|
||||
s->refcnt = 1;
|
||||
s->tracks = 0;
|
||||
s->track = NULL;
|
||||
@ -105,8 +103,7 @@ int burn_disc_add_session(struct burn_disc *d, struct burn_session *s,
|
||||
struct burn_track *burn_track_create(void)
|
||||
{
|
||||
struct burn_track *t;
|
||||
t = malloc(sizeof(struct burn_track));
|
||||
memset(t, 0, sizeof(struct burn_track));
|
||||
t = calloc(1, sizeof(struct burn_track));
|
||||
t->refcnt = 1;
|
||||
t->indices = 0;
|
||||
t->offset = 0;
|
||||
|
@ -235,9 +235,8 @@ struct cue_sheet *burn_create_toc_entries(struct burn_write_opts *o,
|
||||
goto failed;
|
||||
}
|
||||
|
||||
d->toc_entry = malloc(d->toc_entries * sizeof(struct burn_toc_entry));
|
||||
d->toc_entry = calloc(d->toc_entries, sizeof(struct burn_toc_entry));
|
||||
e = d->toc_entry;
|
||||
memset((void *)e, 0, d->toc_entries * sizeof(struct burn_toc_entry));
|
||||
e[0].point = 0xA0;
|
||||
if (tar[0]->mode & BURN_AUDIO)
|
||||
e[0].control = TOC_CONTROL_AUDIO;
|
||||
|
Loading…
Reference in New Issue
Block a user