calendarspec: rework destructor to return its own type

Let's make it more alike most of our other destructors.
This commit is contained in:
Lennart Poettering 2017-11-17 10:32:48 +01:00
parent 86ea8d70fc
commit 7c123d49fc
2 changed files with 4 additions and 4 deletions

View file

@ -51,10 +51,10 @@ static void free_chain(CalendarComponent *c) {
}
}
void calendar_spec_free(CalendarSpec *c) {
CalendarSpec* calendar_spec_free(CalendarSpec *c) {
if (!c)
return;
return NULL;
free_chain(c->year);
free_chain(c->month);
@ -64,7 +64,7 @@ void calendar_spec_free(CalendarSpec *c) {
free_chain(c->microsecond);
free(c->timezone);
free(c);
return mfree(c);
}
static int component_compare(const void *_a, const void *_b) {

View file

@ -52,7 +52,7 @@ typedef struct CalendarSpec {
CalendarComponent *microsecond;
} CalendarSpec;
void calendar_spec_free(CalendarSpec *c);
CalendarSpec* calendar_spec_free(CalendarSpec *c);
int calendar_spec_normalize(CalendarSpec *spec);
bool calendar_spec_valid(CalendarSpec *spec);