summaryrefslogtreecommitdiff
path: root/src/core/unit.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-10-14 06:10:14 +0200
committerLennart Poettering <lennart@poettering.net>2013-10-14 06:11:19 +0200
commit71fda00f320379f5cbee8e118848de98caaa229d (patch)
tree00a913086d70abadb1185e1343d97df860b0d612 /src/core/unit.c
parent14bf2c9d375db6a4670bc0ef0e521e35a939a498 (diff)
list: make our list macros a bit easier to use by not requring type spec on each invocation
We can determine the list entry type via the typeof() gcc construct, and so we should to make the macros much shorter to use.
Diffstat (limited to 'src/core/unit.c')
-rw-r--r--src/core/unit.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index 1db7d061c4..e19d281aa7 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -171,7 +171,7 @@ int unit_add_name(Unit *u, const char *text) {
u->id = s;
u->instance = i;
- LIST_PREPEND(Unit, units_by_type, u->manager->units_by_type[t], u);
+ LIST_PREPEND(units_by_type, u->manager->units_by_type[t], u);
if (UNIT_VTABLE(u)->init)
UNIT_VTABLE(u)->init(u);
@@ -284,7 +284,7 @@ void unit_add_to_load_queue(Unit *u) {
if (u->load_state != UNIT_STUB || u->in_load_queue)
return;
- LIST_PREPEND(Unit, load_queue, u->manager->load_queue, u);
+ LIST_PREPEND(load_queue, u->manager->load_queue, u);
u->in_load_queue = true;
}
@@ -294,7 +294,7 @@ void unit_add_to_cleanup_queue(Unit *u) {
if (u->in_cleanup_queue)
return;
- LIST_PREPEND(Unit, cleanup_queue, u->manager->cleanup_queue, u);
+ LIST_PREPEND(cleanup_queue, u->manager->cleanup_queue, u);
u->in_cleanup_queue = true;
}
@@ -307,7 +307,7 @@ void unit_add_to_gc_queue(Unit *u) {
if (unit_check_gc(u))
return;
- LIST_PREPEND(Unit, gc_queue, u->manager->gc_queue, u);
+ LIST_PREPEND(gc_queue, u->manager->gc_queue, u);
u->in_gc_queue = true;
u->manager->n_in_gc_queue ++;
@@ -326,7 +326,7 @@ void unit_add_to_dbus_queue(Unit *u) {
return;
}
- LIST_PREPEND(Unit, dbus_queue, u->manager->dbus_unit_queue, u);
+ LIST_PREPEND(dbus_queue, u->manager->dbus_unit_queue, u);
u->in_dbus_queue = true;
}
@@ -439,24 +439,24 @@ void unit_free(Unit *u) {
bidi_set_free(u, u->dependencies[d]);
if (u->type != _UNIT_TYPE_INVALID)
- LIST_REMOVE(Unit, units_by_type, u->manager->units_by_type[u->type], u);
+ LIST_REMOVE(units_by_type, u->manager->units_by_type[u->type], u);
if (u->in_load_queue)
- LIST_REMOVE(Unit, load_queue, u->manager->load_queue, u);
+ LIST_REMOVE(load_queue, u->manager->load_queue, u);
if (u->in_dbus_queue)
- LIST_REMOVE(Unit, dbus_queue, u->manager->dbus_unit_queue, u);
+ LIST_REMOVE(dbus_queue, u->manager->dbus_unit_queue, u);
if (u->in_cleanup_queue)
- LIST_REMOVE(Unit, cleanup_queue, u->manager->cleanup_queue, u);
+ LIST_REMOVE(cleanup_queue, u->manager->cleanup_queue, u);
if (u->in_gc_queue) {
- LIST_REMOVE(Unit, gc_queue, u->manager->gc_queue, u);
+ LIST_REMOVE(gc_queue, u->manager->gc_queue, u);
u->manager->n_in_gc_queue--;
}
if (u->in_cgroup_queue)
- LIST_REMOVE(Unit, cgroup_queue, u->manager->cgroup_queue, u);
+ LIST_REMOVE(cgroup_queue, u->manager->cgroup_queue, u);
if (u->cgroup_path) {
hashmap_remove(u->manager->cgroup_unit, u->cgroup_path);
@@ -952,7 +952,7 @@ int unit_load(Unit *u) {
assert(u);
if (u->in_load_queue) {
- LIST_REMOVE(Unit, load_queue, u->manager->load_queue, u);
+ LIST_REMOVE(load_queue, u->manager->load_queue, u);
u->in_load_queue = false;
}
@@ -2670,7 +2670,7 @@ Unit* unit_ref_set(UnitRef *ref, Unit *u) {
unit_ref_unset(ref);
ref->unit = u;
- LIST_PREPEND(UnitRef, refs, u->refs, ref);
+ LIST_PREPEND(refs, u->refs, ref);
return u;
}
@@ -2680,7 +2680,7 @@ void unit_ref_unset(UnitRef *ref) {
if (!ref->unit)
return;
- LIST_REMOVE(UnitRef, refs, ref->unit->refs, ref);
+ LIST_REMOVE(refs, ref->unit->refs, ref);
ref->unit = NULL;
}