diff options
| author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2012-06-30 19:40:09 +0300 |
|---|---|---|
| committer | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2012-07-20 18:52:16 +0300 |
| commit | 6c253efbb3c94baa403fe3637d70f229a4b8f253 (patch) | |
| tree | 0b8043c07db2092591a4c442fe1a11c6c3b7ee08 | |
| parent | 0f8481343f6bdb2f3b13f258d951ec154f8ac79f (diff) | |
rework move_down move_up functions - initialization
| -rw-r--r-- | monsterwm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/monsterwm.c b/monsterwm.c index 9a284bc..aa03fe5 100644 --- a/monsterwm.c +++ b/monsterwm.c @@ -576,8 +576,8 @@ void monocle(int hh, int cy) { * and current->next to current client's position */ void move_down(void) { /* p is previous, c is current, n is next, if current is head n is last */ - Client *p = NULL, *n = (curr->next) ? curr->next:head; - if (!(p = prevclient(curr))) return; + Client *p = prevclient(curr), *n = (curr->next) ? curr->next:head; + if (!p) return; /* * if c is head, swapping with n should update head to n * [c]->[n]->.. ==> [n]->[c]->.. @@ -612,9 +612,9 @@ void move_down(void) { /* move the current client, to the previous from current and * the previous from current to current client's position */ void move_up(void) { - Client *pp = NULL, *p; /* p is previous from current or last if current is head */ - if (!(p = prevclient(curr))) return; + Client *pp = NULL, *p = prevclient(curr); + if (!p) return; /* pp is previous from p, or null if current is head and thus p is last */ if (p->next) for (pp = head; pp && pp->next != p; pp = pp->next); /* |
