mirror of
https://github.com/systemd/systemd.git
synced 2025-01-25 10:04:04 +03:00
calendarspec: rework destructor to return its own type
Let's make it more alike most of our other destructors.
This commit is contained in:
parent
86ea8d70fc
commit
7c123d49fc
@ -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) {
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user