summaryrefslogtreecommitdiff
path: root/src/core/job.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/job.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/job.c')
-rw-r--r--src/core/job.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/core/job.c b/src/core/job.c
index bf1d956908..e5dcef7cf4 100644
--- a/src/core/job.c
+++ b/src/core/job.c
@@ -99,10 +99,10 @@ void job_free(Job *j) {
assert(!j->object_list);
if (j->in_run_queue)
- LIST_REMOVE(Job, run_queue, j->manager->run_queue, j);
+ LIST_REMOVE(run_queue, j->manager->run_queue, j);
if (j->in_dbus_queue)
- LIST_REMOVE(Job, dbus_queue, j->manager->dbus_job_queue, j);
+ LIST_REMOVE(dbus_queue, j->manager->dbus_job_queue, j);
if (j->timer_watch.type != WATCH_INVALID) {
assert(j->timer_watch.type == WATCH_JOB_TIMER);
@@ -114,7 +114,7 @@ void job_free(Job *j) {
}
while ((cl = j->bus_client_list)) {
- LIST_REMOVE(JobBusClient, client, j->bus_client_list, cl);
+ LIST_REMOVE(client, j->bus_client_list, cl);
free(cl);
}
free(j);
@@ -267,9 +267,9 @@ JobDependency* job_dependency_new(Job *subject, Job *object, bool matters, bool
l->conflicts = conflicts;
if (subject)
- LIST_PREPEND(JobDependency, subject, subject->subject_list, l);
+ LIST_PREPEND(subject, subject->subject_list, l);
- LIST_PREPEND(JobDependency, object, object->object_list, l);
+ LIST_PREPEND(object, object->object_list, l);
return l;
}
@@ -278,9 +278,9 @@ void job_dependency_free(JobDependency *l) {
assert(l);
if (l->subject)
- LIST_REMOVE(JobDependency, subject, l->subject->subject_list, l);
+ LIST_REMOVE(subject, l->subject->subject_list, l);
- LIST_REMOVE(JobDependency, object, l->object->object_list, l);
+ LIST_REMOVE(object, l->object->object_list, l);
free(l);
}
@@ -491,7 +491,7 @@ int job_run_and_invalidate(Job *j) {
assert(j->type < _JOB_TYPE_MAX_IN_TRANSACTION);
assert(j->in_run_queue);
- LIST_REMOVE(Job, run_queue, j->manager->run_queue, j);
+ LIST_REMOVE(run_queue, j->manager->run_queue, j);
j->in_run_queue = false;
if (j->state != JOB_WAITING)
@@ -910,7 +910,7 @@ void job_add_to_run_queue(Job *j) {
if (j->in_run_queue)
return;
- LIST_PREPEND(Job, run_queue, j->manager->run_queue, j);
+ LIST_PREPEND(run_queue, j->manager->run_queue, j);
j->in_run_queue = true;
}
@@ -925,7 +925,7 @@ void job_add_to_dbus_queue(Job *j) {
* job might just have been created and not yet assigned to a
* connection/client. */
- LIST_PREPEND(Job, dbus_queue, j->manager->dbus_job_queue, j);
+ LIST_PREPEND(dbus_queue, j->manager->dbus_job_queue, j);
j->in_dbus_queue = true;
}