summaryrefslogtreecommitdiff
path: root/app/cwm
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2017-12-13 15:10:18 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2017-12-13 15:10:18 +0000
commite6a381b5b5487e80990ebccd7bd7954d2ae41f2b (patch)
tree76678787a98e7ef442e62dbcdd30e3e056e7b4d9 /app/cwm
parent4c6dfef7b73d1680e925e0d5429b19f4cd0d1b62 (diff)
move variable declarations up, to match everything else
Diffstat (limited to 'app/cwm')
-rw-r--r--app/cwm/search.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/app/cwm/search.c b/app/cwm/search.c
index b870c582b..06d952be2 100644
--- a/app/cwm/search.c
+++ b/app/cwm/search.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: search.c,v 1.65 2017/12/07 16:03:10 okan Exp $
+ * $OpenBSD: search.c,v 1.66 2017/12/13 15:10:17 okan Exp $
*/
#include <sys/types.h>
@@ -69,15 +69,16 @@ match_substr(char *sub, char *str, int zeroidx)
void
search_match_client(struct menu_q *menuq, struct menu_q *resultq, char *search)
{
- struct winname *wn;
- struct menu *mi, *tierp[4], *before = NULL;
+ struct menu *mi, *tierp[4], *before = NULL;
+ struct client_ctx *cc;
+ struct winname *wn;
(void)memset(tierp, 0, sizeof(tierp));
TAILQ_INIT(resultq);
TAILQ_FOREACH(mi, menuq, entry) {
int tier = -1, t;
- struct client_ctx *cc = (struct client_ctx *)mi->ctx;
+ cc = (struct client_ctx *)mi->ctx;
/* Match on label. */
if (match_substr(search, cc->label, 0))
@@ -132,11 +133,12 @@ search_match_client(struct menu_q *menuq, struct menu_q *resultq, char *search)
void
search_match_cmd(struct menu_q *menuq, struct menu_q *resultq, char *search)
{
- struct menu *mi;
+ struct menu *mi;
+ struct cmd_ctx *cmd;
TAILQ_INIT(resultq);
TAILQ_FOREACH(mi, menuq, entry) {
- struct cmd_ctx *cmd = (struct cmd_ctx *)mi->ctx;
+ cmd = (struct cmd_ctx *)mi->ctx;
if (match_substr(search, cmd->name, 0))
TAILQ_INSERT_TAIL(resultq, mi, resultentry);
}
@@ -145,12 +147,13 @@ search_match_cmd(struct menu_q *menuq, struct menu_q *resultq, char *search)
void
search_match_group(struct menu_q *menuq, struct menu_q *resultq, char *search)
{
- struct menu *mi;
- char *s;
+ struct menu *mi;
+ struct group_ctx *gc;
+ char *s;
TAILQ_INIT(resultq);
TAILQ_FOREACH(mi, menuq, entry) {
- struct group_ctx *gc = (struct group_ctx *)mi->ctx;
+ gc = (struct group_ctx *)mi->ctx;
xasprintf(&s, "%d %s", gc->num, gc->name);
if (match_substr(search, s, 0))
TAILQ_INSERT_TAIL(resultq, mi, resultentry);
@@ -243,7 +246,7 @@ search_print_client(struct menu *mi, int listing)
void
search_print_cmd(struct menu *mi, int listing)
{
- struct cmd_ctx *cmd = (struct cmd_ctx *)mi->ctx;
+ struct cmd_ctx *cmd = (struct cmd_ctx *)mi->ctx;
(void)snprintf(mi->print, sizeof(mi->print), "%s", cmd->name);
}