make some changes prepping for clang-format

Co-authored-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
pull/323/head
NRK 2 years ago
parent 8c876199b1
commit 2434e83807

@ -326,10 +326,10 @@ bool ci_drag(arg_t drag_mode)
while (true) {
if (drag_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);
py = MIN(MAX(0.0, y - win.h*0.1), win.h*0.8) / (win.h*0.8)
* (win.h - img.h * img.zoom);
px = MIN(MAX(0.0, x - win.w*0.1), win.w*0.8) /
(win.w*0.8) * (win.w - img.w * img.zoom);
py = MIN(MAX(0.0, y - win.h*0.1), win.h*0.8) /
(win.h*0.8) * (win.h - img.h * img.zoom);
} else {
px = img.x + x - ox;
py = img.y + y - oy;

@ -282,8 +282,9 @@ static bool img_load_gif(img_t *img, const fileinfo_t *file)
if (i < y || i >= y + h || j < x || j >= x + w ||
rows[i-y][j-x] == transp)
{
if (prev_frame != NULL && (prev_disposal != 2 ||
i < py || i >= py + ph || j < px || j >= px + pw))
if (prev_frame != NULL &&
(prev_disposal != 2 || i < py || i >= py + ph ||
j < px || j >= px + pw))
{
*ptr = prev_frame[i * sw + j];
} else {
@ -412,8 +413,8 @@ static bool img_load_webp(img_t *img, const fileinfo_t *file)
/* Load and decode frames (also works on images with only 1 frame) */
m->length = m->cnt = m->sel = 0;
while (WebPAnimDecoderGetNext(dec, &buf, &ts)) {
im = imlib_create_image_using_copied_data(
info.canvas_width, info.canvas_height, (uint32_t *)buf);
im = imlib_create_image_using_copied_data(info.canvas_width, info.canvas_height,
(uint32_t *)buf);
imlib_context_set_image(im);
imlib_image_set_format("webp");
/* Get an iterator of this frame - used for frame info (duration, etc.) */

@ -40,15 +40,15 @@
#include <X11/XF86keysym.h>
#include <X11/keysym.h>
#define MODMASK(mask) ((mask) & USED_MODMASK)
#define MODMASK(mask) (USED_MODMASK & (mask))
#define BAR_SEP " "
#define TV_DIFF(t1,t2) (((t1)->tv_sec - (t2)->tv_sec ) * 1000 + \
((t1)->tv_usec - (t2)->tv_usec) / 1000)
#define TV_ADD_MSEC(tv,t) { \
#define TV_ADD_MSEC(tv,t) do { \
(tv)->tv_sec += (t) / 1000; \
(tv)->tv_usec += (t) % 1000 * 1000; \
}
} while (0)
typedef struct {
int err;
@ -200,8 +200,8 @@ void remove_file(int n, bool manual)
if (n + 1 < filecnt) {
if (tns.thumbs != NULL) {
memmove(tns.thumbs + n, tns.thumbs + n + 1, (filecnt - n - 1) *
sizeof(*tns.thumbs));
memmove(tns.thumbs + n, tns.thumbs + n + 1,
(filecnt - n - 1) * sizeof(*tns.thumbs));
memset(tns.thumbs + filecnt - 1, 0, sizeof(*tns.thumbs));
}
memmove(files + n, files + n + 1, (filecnt - n - 1) * sizeof(*files));
@ -377,7 +377,7 @@ void load_image(int new)
if (new >= filecnt)
new = filecnt - 1;
else if (new > 0 && prev)
new--;
new -= 1;
}
files[new].flags &= ~FF_WARN;
fileidx = current = new;
@ -562,8 +562,9 @@ void handle_key_handler(bool init)
return;
if (init) {
close_info();
snprintf(win.bar.l.buf, win.bar.l.size, "Getting key handler input "
"(%s to abort)...", XKeysymToString(KEYHANDLER_ABORT));
snprintf(win.bar.l.buf, win.bar.l.size,
"Getting key handler input (%s to abort)...",
XKeysymToString(KEYHANDLER_ABORT));
} else { /* abort */
open_info();
update_info();
@ -739,8 +740,8 @@ static void run(void)
init_thumb = mode == MODE_THUMB && tns.initnext < filecnt;
load_thumb = mode == MODE_THUMB && tns.loadnext < tns.end;
if ((init_thumb || load_thumb || to_set || info.fd != -1 ||
arl.fd != -1) && XPending(win.env.dpy) == 0)
if ((init_thumb || load_thumb || to_set || info.fd != -1 || arl.fd != -1) &&
XPending(win.env.dpy) == 0)
{
if (load_thumb) {
set_timeout(redraw, TO_REDRAW_THUMBS, false);
@ -793,8 +794,8 @@ static void run(void)
discard = ev.type == nextev.type;
break;
case KeyPress:
discard = (nextev.type == KeyPress || nextev.type == KeyRelease)
&& ev.xkey.keycode == nextev.xkey.keycode;
discard = (nextev.type == KeyPress || nextev.type == KeyRelease) &&
ev.xkey.keycode == nextev.xkey.keycode;
break;
}
}

@ -226,8 +226,8 @@ void win_open(win_t *win)
if (gmask & YValue) {
if (gmask & YNegative) {
win->y += e->scrh - win->h;
sizehints.win_gravity = sizehints.win_gravity == NorthEastGravity
? SouthEastGravity : SouthWestGravity;
sizehints.win_gravity = sizehints.win_gravity == NorthEastGravity ?
SouthEastGravity : SouthWestGravity;
}
sizehints.flags |= USPosition;
} else {

Loading…
Cancel
Save