diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2012-01-15 12:37:16 +0100 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2012-01-16 13:34:42 +0100 |
commit | 595ed347a87e69893c5e72168fc2e94a7cb09e73 (patch) | |
tree | c0e9270f001c289c429d4f239b41ac60df75d21b /src/swap.c | |
parent | 1124fe6f01b1d59d016c238026f20380f38d98dc (diff) |
unit: use safe downcasts, remove pointless casts
Always use the macros for downcasting.
Remove a few obviously pointless casts.
Diffstat (limited to 'src/swap.c')
-rw-r--r-- | src/swap.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/swap.c b/src/swap.c index ff62b1dc4b..b4a5b3c084 100644 --- a/src/swap.c +++ b/src/swap.c @@ -157,7 +157,7 @@ static int swap_add_mount_links(Swap *s) { assert(s); LIST_FOREACH(units_by_type, other, UNIT(s)->manager->units_by_type[UNIT_MOUNT]) - if ((r = swap_add_one_mount_link(s, (Mount*) other)) < 0) + if ((r = swap_add_one_mount_link(s, MOUNT(other))) < 0) return r; return 0; @@ -1096,7 +1096,7 @@ int swap_dispatch_reload(Manager *m) { } int swap_fd_event(Manager *m, int events) { - Unit *meta; + Unit *u; int r; assert(m); @@ -1106,8 +1106,8 @@ int swap_fd_event(Manager *m, int events) { log_error("Failed to reread /proc/swaps: %s", strerror(-r)); /* Reset flags, just in case, for late calls */ - LIST_FOREACH(units_by_type, meta, m->units_by_type[UNIT_SWAP]) { - Swap *swap = (Swap*) meta; + LIST_FOREACH(units_by_type, u, m->units_by_type[UNIT_SWAP]) { + Swap *swap = SWAP(u); swap->is_active = swap->just_activated = false; } @@ -1117,8 +1117,8 @@ int swap_fd_event(Manager *m, int events) { manager_dispatch_load_queue(m); - LIST_FOREACH(units_by_type, meta, m->units_by_type[UNIT_SWAP]) { - Swap *swap = (Swap*) meta; + LIST_FOREACH(units_by_type, u, m->units_by_type[UNIT_SWAP]) { + Swap *swap = SWAP(u); if (!swap->is_active) { /* This has just been deactivated */ |