From: Christian Heller Date: Tue, 30 Jul 2013 01:38:35 +0000 (+0200) Subject: Slightly re-structured and re-styled a for-loop for greater understandability. X-Git-Tag: tce~1113 X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/%7B%7B%20web_path%20%7D%7D/static/do_tasks?a=commitdiff_plain;h=322bd8d0b863f89bc6ce864a853b57b554a1cabf;p=plomrogue Slightly re-structured and re-styled a for-loop for greater understandability. --- diff --git a/src/windows.c b/src/windows.c index 46124c5..362e10a 100644 --- a/src/windows.c +++ b/src/windows.c @@ -438,11 +438,11 @@ extern void shift_active_win(struct WinMeta * wmeta, char dir) /* Suspend all visible windows. */ uint16_t i, i_max; - for (i_max = 1, w_p = wmeta->chain_start; + for (w_p = wmeta->chain_start, i_max = 1; w_p != wmeta->chain_end; - i_max++) + w_p = w_p->next) { - w_p = w_p->next; + i_max++; } struct Win ** wins = malloc(i_max * sizeof(struct Win *)); for (i = 0, w_p = wmeta->chain_start; i < i_max; i++)