diff options
author | 2015-04-24 23:17:11 +0000 | |
---|---|---|
committer | 2015-04-24 23:17:11 +0000 | |
commit | 82873134f2d306f798ef1248fddc2aa3717c7b74 (patch) | |
tree | 8f4b3079882ecc246acc53cbcb6a898c4b63ecca /usr.bin/tmux/control-notify.c | |
parent | Set working directory for run-shell and if-shell. (diff) | |
download | wireguard-openbsd-82873134f2d306f798ef1248fddc2aa3717c7b74.tar.xz wireguard-openbsd-82873134f2d306f798ef1248fddc2aa3717c7b74.zip |
Convert clients list into a TAILQ.
Diffstat (limited to 'usr.bin/tmux/control-notify.c')
-rw-r--r-- | usr.bin/tmux/control-notify.c | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/usr.bin/tmux/control-notify.c b/usr.bin/tmux/control-notify.c index f5050733c3e..5898e2b4623 100644 --- a/usr.bin/tmux/control-notify.c +++ b/usr.bin/tmux/control-notify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control-notify.c,v 1.10 2015/02/05 10:29:43 nicm Exp $ */ +/* $OpenBSD: control-notify.c,v 1.11 2015/04/24 23:17:11 nicm Exp $ */ /* * Copyright (c) 2012 Nicholas Marriott <nicm@users.sourceforge.net> @@ -64,11 +64,9 @@ control_notify_window_layout_changed(struct window *w) struct session *s; struct format_tree *ft; struct winlink *wl; - u_int i; const char *template; - for (i = 0; i < ARRAY_LENGTH(&clients); i++) { - c = ARRAY_ITEM(&clients, i); + TAILQ_FOREACH(c, &clients, entry) { if (!CONTROL_SHOULD_NOTIFY_CLIENT(c) || c->session == NULL) continue; s = c->session; @@ -100,10 +98,8 @@ control_notify_window_unlinked(unused struct session *s, struct window *w) { struct client *c; struct session *cs; - u_int i; - for (i = 0; i < ARRAY_LENGTH(&clients); i++) { - c = ARRAY_ITEM(&clients, i); + TAILQ_FOREACH(c, &clients, entry) { if (!CONTROL_SHOULD_NOTIFY_CLIENT(c) || c->session == NULL) continue; cs = c->session; @@ -120,10 +116,8 @@ control_notify_window_linked(unused struct session *s, struct window *w) { struct client *c; struct session *cs; - u_int i; - for (i = 0; i < ARRAY_LENGTH(&clients); i++) { - c = ARRAY_ITEM(&clients, i); + TAILQ_FOREACH(c, &clients, entry) { if (!CONTROL_SHOULD_NOTIFY_CLIENT(c) || c->session == NULL) continue; cs = c->session; @@ -140,10 +134,8 @@ control_notify_window_renamed(struct window *w) { struct client *c; struct session *cs; - u_int i; - for (i = 0; i < ARRAY_LENGTH(&clients); i++) { - c = ARRAY_ITEM(&clients, i); + TAILQ_FOREACH(c, &clients, entry) { if (!CONTROL_SHOULD_NOTIFY_CLIENT(c) || c->session == NULL) continue; cs = c->session; @@ -174,10 +166,8 @@ void control_notify_session_renamed(struct session *s) { struct client *c; - u_int i; - for (i = 0; i < ARRAY_LENGTH(&clients); i++) { - c = ARRAY_ITEM(&clients, i); + TAILQ_FOREACH(c, &clients, entry) { if (!CONTROL_SHOULD_NOTIFY_CLIENT(c)) continue; @@ -189,10 +179,8 @@ void control_notify_session_created(unused struct session *s) { struct client *c; - u_int i; - for (i = 0; i < ARRAY_LENGTH(&clients); i++) { - c = ARRAY_ITEM(&clients, i); + TAILQ_FOREACH(c, &clients, entry) { if (!CONTROL_SHOULD_NOTIFY_CLIENT(c)) continue; @@ -204,10 +192,8 @@ void control_notify_session_close(unused struct session *s) { struct client *c; - u_int i; - for (i = 0; i < ARRAY_LENGTH(&clients); i++) { - c = ARRAY_ITEM(&clients, i); + TAILQ_FOREACH(c, &clients, entry) { if (!CONTROL_SHOULD_NOTIFY_CLIENT(c)) continue; |