From 1449bfc5e960a61438c60a67c28da6d7c5bf2c7f Mon Sep 17 00:00:00 2001 From: Berke Kocaoğlu Date: Mon, 11 Oct 2021 06:07:18 +0300 Subject: code-style: fix consistency issues all over the codebase (#94) * remove duplicate comment * remove empty tabs and blank lines * move macros and globals ontop * comment to seprate function implementation * fix alignment * switch to *argv[] similar to other suckless code * kill all empty last lines * append comment to endif * reuse existing ARRLEN macro * comment fall through * use while (true) everywhere Co-authored-by: NRK --- commands.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'commands.c') diff --git a/commands.c b/commands.c index 8ab1247..3981f0f 100644 --- a/commands.c +++ b/commands.c @@ -233,7 +233,7 @@ bool cg_navigate_marked(arg_t n) { int d, i; int new = fileidx; - + if (prefix > 0) n *= prefix; d = n > 0 ? 1 : -1; @@ -337,14 +337,13 @@ bool ci_drag(arg_t mode) if ((int)(img.w * img.zoom) <= win.w && (int)(img.h * img.zoom) <= win.h) return false; - - win_set_cursor(&win, CURSOR_DRAG); + win_set_cursor(&win, CURSOR_DRAG); win_cursor_pos(&win, &x, &y); ox = x; oy = y; - for (;;) { + while (true) { if (mode == DRAG_ABSOLUTE) { px = MIN(MAX(0.0, x - win.w*0.1), win.w*0.8) / (win.w*0.8) * (win.w - img.w * img.zoom); @@ -449,4 +448,3 @@ bool ct_reload_all(arg_t _) const cmd_t cmds[CMD_COUNT] = { #include "commands.lst" }; - -- cgit v1.2.3-54-g00ecf