From: Christian Heller Date: Wed, 12 Jun 2013 22:50:15 +0000 (+0200) Subject: Slightly shortened window shifting code. X-Git-Tag: tce~1233 X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/%7B%7Bprefix%7D%7D/static/edit?a=commitdiff_plain;h=74c8b64f280289572e4246f47c4d0a0e10fd1a45;p=plomrogue Slightly shortened window shifting code. --- diff --git a/windows.c b/windows.c index 5ab8371..62faa48 100644 --- a/windows.c +++ b/windows.c @@ -261,13 +261,12 @@ extern void cycle_active_window (struct WinMeta * win_meta, char dir) { extern void shift_active_window (struct WinMeta * win_meta, char dir) { // Move active window forward/backward in window chain. If jumping beyond start/end, move to other chain end. if (0 != win_meta->active && win_meta->chain_start != win_meta->chain_end && (dir == 'f' || dir == 'b')) { - struct Win * win_shift = win_meta->active; + struct Win * win_shift = win_meta->active, * win_p, * win_p_next; char wrap = 0; if ((dir == 'f' && win_shift == win_meta->chain_end) || (dir == 'b' && win_shift == win_meta->chain_start)) wrap = 1; uint16_t i, i_max; - struct Win * win_p, * win_p_next; for (i_max = 1, win_p = win_meta->chain_start; win_p != win_meta->chain_end; i_max++) win_p = win_p->next; struct Win ** wins = malloc(i_max * sizeof(struct Win *));