From f2f4903de4bd3ce06c03dd66f0c9a7dda97a3550 Mon Sep 17 00:00:00 2001 From: NRK Date: Fri, 10 Feb 2023 11:35:53 +0600 Subject: apply clang-format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit minus the bogus changes Co-authored-by: Berke Kocaoğlu --- window.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'window.c') diff --git a/window.c b/window.c index 765f67d..3857871 100644 --- a/window.c +++ b/window.c @@ -34,7 +34,7 @@ #if HAVE_LIBFONTS #include "utf8.h" -#define UTF8_PADDING 4 /* utf8_decode requires 4 bytes of zero padding */ +#define UTF8_PADDING 4 /* utf8_decode requires 4 bytes of zero padding */ #define TEXTWIDTH(win, text, len) \ win_draw_text(win, NULL, NULL, 0, 0, text, len, 0) #endif @@ -56,8 +56,12 @@ static struct { int name; Cursor icon; } cursors[CURSOR_COUNT] = { - { XC_left_ptr }, { XC_dotbox }, { XC_fleur }, { XC_watch }, - { XC_sb_left_arrow }, { XC_sb_right_arrow } + { XC_left_ptr }, + { XC_dotbox }, + { XC_fleur }, + { XC_watch }, + { XC_sb_left_arrow }, + { XC_sb_right_arrow } }; #if HAVE_LIBFONTS @@ -90,7 +94,7 @@ static void win_alloc_color(const win_env_t *e, const char *name, XColor *col) error(EXIT_FAILURE, 0, "Error allocating color '%s'", name); } -static const char* win_res(XrmDatabase db, const char *name, const char *def) +static const char *win_res(XrmDatabase db, const char *name, const char *def) { char *type; XrmValue ret; @@ -246,7 +250,7 @@ void win_open(win_t *win) /* set the _NET_WM_PID */ pid = getpid(); XChangeProperty(e->dpy, win->xwin, atoms[ATOM__NET_WM_PID], XA_CARDINAL, - 32, PropModeReplace, (unsigned char *) &pid, 1); + 32, PropModeReplace, (unsigned char *)&pid, 1); if (gethostname(hostname, ARRLEN(hostname)) == 0) { XTextProperty tp; tp.value = (unsigned char *)hostname; @@ -272,7 +276,7 @@ void win_open(win_t *win) gc = XCreateGC(e->dpy, win->xwin, 0, None); - n = icons[ARRLEN(icons)-1].size; + n = icons[ARRLEN(icons) - 1].size; icon_data = emalloc((n * n + 2) * sizeof(*icon_data)); for (i = 0; i < (int)ARRLEN(icons); i++) { @@ -286,7 +290,7 @@ void win_open(win_t *win) } XChangeProperty(e->dpy, win->xwin, atoms[ATOM__NET_WM_ICON], XA_CARDINAL, 32, i == 0 ? PropModeReplace : PropModeAppend, - (unsigned char *) icon_data, n); + (unsigned char *)icon_data, n); } free(icon_data); @@ -311,7 +315,7 @@ void win_open(win_t *win) if (options->fullscreen) { XChangeProperty(e->dpy, win->xwin, atoms[ATOM__NET_WM_STATE], XA_ATOM, 32, PropModeReplace, - (unsigned char *) &atoms[ATOM__NET_WM_STATE_FULLSCREEN], 1); + (unsigned char *)&atoms[ATOM__NET_WM_STATE_FULLSCREEN], 1); } win->h -= win->bar.h; @@ -432,10 +436,10 @@ static int win_draw_text(win_t *win, XftDraw *d, const XftColor *color, FC_SIZE, FcTypeDouble, fontsize, NULL); FcCharSetDestroy(fccharset); } - XftTextExtentsUtf8(win->env.dpy, f, (XftChar8*)t, next - t, &ext); + XftTextExtentsUtf8(win->env.dpy, f, (XftChar8 *)t, next - t, &ext); tw += ext.xOff; if (tw <= w) { - XftDrawStringUtf8(d, color, f, x, y, (XftChar8*)t, next - t); + XftDrawStringUtf8(d, color, f, x, y, (XftChar8 *)t, next - t); x += ext.xOff; } if (f != font) @@ -456,7 +460,7 @@ static void win_draw_bar(win_t *win) r = &win->bar.r; assert(l->buf != NULL && r->buf != NULL); y = (win->bar.top ? 0 : win->h) + font->ascent + V_TEXT_PAD; - w = win->w - 2*H_TEXT_PAD; + w = win->w - 2 * H_TEXT_PAD; d = XftDrawCreate(e->dpy, win->buf.pm, e->vis, e->cmap); XSetForeground(e->dpy, gc, win->bar_bg.pixel); @@ -482,7 +486,7 @@ static void win_draw_bar(win_t *win) #else static void win_draw_bar(win_t *win) { - (void) win; + (void)win; } #endif /* HAVE_LIBFONTS */ -- cgit v1.2.3-54-g00ecf