diff --git a/Makefile.in b/Makefile.in index 0d69de7..1b18832 100644 --- a/Makefile.in +++ b/Makefile.in @@ -32,6 +32,7 @@ src/wmfs.c # flags CFLAGS+= -DXDG_CONFIG_DIR=\"${XDG_CONFIG_DIR}\" CFLAGS+= -DWMFS_VERSION=\"${VERSION}\" +CFLAGS+= -W -Wall -Wextra -ansi OBJS= ${SRCS:.c=.o} diff --git a/src/barwin.c b/src/barwin.c index 7cdd641..b2170fe 100644 --- a/src/barwin.c +++ b/src/barwin.c @@ -293,7 +293,7 @@ barwin_refresh_color(BarWindow *bw) if(bw->stipple) { - XSetForeground(dpy, gc_stipple, ((bw->stipple_color != -1) ? bw->stipple_color : getcolor(bw->fg))); + XSetForeground(dpy, gc_stipple, ((bw->stipple_color != (uint)-1) ? (long)bw->stipple_color : getcolor(bw->fg))); XFillRectangle(dpy, bw->dr, gc_stipple, 3, 2, bw->geo.width - 6, bw->geo.height - 4); } diff --git a/src/client.c b/src/client.c index 904b008..23d7fbd 100644 --- a/src/client.c +++ b/src/client.c @@ -181,6 +181,7 @@ void uicb_client_prev(uicb_t cmd) { Client *c; + (void)cmd; if((c = client_get_prev())) { @@ -198,6 +199,7 @@ void uicb_client_next(uicb_t cmd) { Client *c; + (void)cmd; if((c = client_get_next())) { @@ -215,6 +217,7 @@ void uicb_client_swap_next(uicb_t cmd) { Client *c; + (void)cmd; if((c = client_get_next())) { @@ -232,6 +235,7 @@ void uicb_client_swap_prev(uicb_t cmd) { Client *c; + (void)cmd; if((c = client_get_prev())) { @@ -249,6 +253,7 @@ void uicb_client_focus_right(uicb_t cmd) { Client *c; + (void)cmd; if((c = client_get_next_with_direction(Right))) { @@ -267,6 +272,7 @@ void uicb_client_focus_left(uicb_t cmd) { Client *c; + (void)cmd; if((c = client_get_next_with_direction(Left))) { @@ -284,6 +290,7 @@ void uicb_client_focus_top(uicb_t cmd) { Client *c; + (void)cmd; if((c = client_get_next_with_direction(Top))) { @@ -301,6 +308,7 @@ void uicb_client_focus_bottom(uicb_t cmd) { Client *c; + (void)cmd; if((c = client_get_next_with_direction(Bottom))) { @@ -317,7 +325,9 @@ uicb_client_focus_bottom(uicb_t cmd) void client_above(Client *c) { - XRectangle geo = { 0 }; + XRectangle geo; + + memset(&geo, 0, sizeof(geo)); if(c->flags & AboveFlag) return; @@ -373,7 +383,7 @@ client_focus(Client *c) /* Set focusontag option */ for(cc = clients; cc; cc = cc->next) - if(cc->focusontag == c->tag) + if(cc->focusontag == (int)c->tag) cc->focusontag = -1; c->focusontag = seltag[selscreen]; @@ -559,7 +569,7 @@ client_hide(Client *c) Bool ishide(Client *c, int screen) { - if(((c->tag == seltag[screen] || c->tag == MAXTAG + 1) && c->screen == screen) + if(((c->tag == (uint)seltag[screen] || c->tag == MAXTAG + 1) && c->screen == screen) || tags[screen][seltag[screen]].tagad & TagFlag(c->tag)) return False; @@ -614,6 +624,7 @@ client_kill(Client *c) void uicb_client_kill(uicb_t cmd) { + (void)cmd; CHECK(sel); client_kill(sel); @@ -990,13 +1001,15 @@ client_swap(Client *c1, Client *c2) void client_set_rules(Client *c) { - XClassHint xch = { 0 }; + XClassHint xch; int i, j, k, f; Atom rf; ulong n, il; uchar *data = NULL; char wwrole[256] = { 0 }; + memset(&xch, 0, sizeof(xch)); + if(conf.ignore_next_client_rules) { conf.ignore_next_client_rules = False; @@ -1040,7 +1053,7 @@ client_set_rules(Client *c) c->screen = i; c->tag = j; - if(c->tag != seltag[selscreen]) + if(c->tag != (uint)seltag[selscreen]) { tags[c->screen][c->tag].request_update = True; client_focus(NULL); @@ -1074,7 +1087,7 @@ client_set_rules(Client *c) c->flags |= MaxFlag; } - if(c->tag != seltag[selscreen]) + if(c->tag != (uint)seltag[selscreen]) { tags[c->screen][c->tag].request_update = True; client_focus(NULL); @@ -1131,6 +1144,7 @@ client_raise(Client *c) void uicb_client_raise(uicb_t cmd) { + (void)cmd; CHECK(sel); client_raise(sel); @@ -1167,7 +1181,7 @@ client_focus_next(Client *c) && c_next->screen != c->screen; c_next = c_next->next); - if(c_next && c_next->tag == seltag[selscreen] + if(c_next && c_next->tag == (uint)seltag[selscreen] && c_next->screen == selscreen) client_focus(c_next); @@ -1204,7 +1218,7 @@ client_unmanage(Client *c) /* Arrange */ for(i = 0; i < screen_count() && !b; ++i) - if(c->tag == seltag[i] || tags[i][seltag[i]].tagad & TagFlag(c->tag)) + if(c->tag == (uint)seltag[i] || tags[i][seltag[i]].tagad & TagFlag(c->tag)) b = True; if(b) @@ -1299,6 +1313,7 @@ client_set_screen(Client *c, int s) void uicb_client_screen_next(uicb_t cmd) { + (void)cmd; CHECK(sel); client_set_screen(sel, (sel->screen + 1 > screen_count() - 1) ? 0 : sel->screen + 1); @@ -1312,6 +1327,7 @@ uicb_client_screen_next(uicb_t cmd) void uicb_client_screen_prev(uicb_t cmd) { + (void)cmd; CHECK(sel); client_set_screen(sel, (sel->screen - 1 < 0) ? screen_count() - 1 : sel->screen - 1); @@ -1384,6 +1400,7 @@ uicb_client_resize(uicb_t cmd) void uicb_ignore_next_client_rules(uicb_t cmd) { + (void)cmd; conf.ignore_next_client_rules = !conf.ignore_next_client_rules; return; @@ -1465,7 +1482,7 @@ uicb_client_select(uicb_t cmd) if(clist_index[i].client->screen != selscreen) screen_set_sel(clist_index[i].client->screen); - if(clist_index[i].client->tag != seltag[clist_index[i].client->screen]) + if(clist_index[i].client->tag != (uint)seltag[clist_index[i].client->screen]) tag_set(clist_index[i].client->tag); client_focus(clist_index[i].client); @@ -1487,6 +1504,7 @@ uicb_client_select(uicb_t cmd) Bool uicb_checkclist(uicb_t cmd) { + (void)cmd; return True; } @@ -1496,6 +1514,7 @@ uicb_checkclist(uicb_t cmd) void uicb_client_ignore_tag(uicb_t cmd) { + (void)cmd; CHECK(sel); screen_get_sel(); diff --git a/src/config.c b/src/config.c index 0fe43a6..6c1535e 100644 --- a/src/config.c +++ b/src/config.c @@ -725,7 +725,8 @@ conf_launcher_section(void) void conf_keybind_section(void) { - int i, j; + int i; + size_t j; struct conf_sec *sec, **ks; struct opt_type *opt; diff --git a/src/draw.c b/src/draw.c index 9ee9680..d163c0f 100644 --- a/src/draw.c +++ b/src/draw.c @@ -51,6 +51,7 @@ draw_image_ofset_text(Drawable d, int x, int y, char* fg, int pad, char *str, in { XftColor xftcolor; XftDraw *xftd; + (void)pad; if(!str) return; @@ -130,7 +131,7 @@ draw_rectangle(Drawable dr, int x, int y, uint w, uint h, uint color) void draw_graph(Drawable dr, int x, int y, uint w, uint h, uint color, char *data) { - int i; + uint i; XSetForeground(dpy, gc, color); diff --git a/src/event.c b/src/event.c index d7da88e..708b5a1 100644 --- a/src/event.c +++ b/src/event.c @@ -236,7 +236,7 @@ clientmessageevent(XClientMessageEvent *ev) /* Manage _NET_WM_DESKTOP */ if(mess_t == net_wm_desktop) - if((c = client_gb_win(ev->window)) && ev->data.l[0] != 0xFFFFFFFF) + if((c = client_gb_win(ev->window)) && ev->data.l[0] != (long)0xFFFFFFFF) tag_transfert(c, ev->data.l[0]); /* Manage _WMFS_STATUSTEXT_x */ @@ -446,7 +446,7 @@ focusin(XFocusChangeEvent *ev) void grabkeys(void) { - uint i; + int i; KeyCode code; XUngrabKey(dpy, AnyKey, AnyModifier, ROOT); @@ -468,7 +468,7 @@ grabkeys(void) void keypress(XKeyPressedEvent *ev) { - uint i; + int i; KeySym keysym; keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); @@ -607,6 +607,7 @@ propertynotify(XPropertyEvent *ev) void reparentnotify(XReparentEvent *ev) { + (void)ev; return; } diff --git a/src/ewmh.c b/src/ewmh.c index eae2d50..f83fff3 100644 --- a/src/ewmh.c +++ b/src/ewmh.c @@ -357,7 +357,7 @@ void ewmh_manage_net_wm_state(long data_l[], Client *c) { /* Manage _NET_WM_STATE_FULLSCREEN */ - if(data_l[1] == net_atom[net_wm_state_fullscreen]) + if(data_l[1] == (long)net_atom[net_wm_state_fullscreen]) { if(data_l[0] == _NET_WM_STATE_ADD && !(c->flags & FSSFlag)) { @@ -392,14 +392,14 @@ ewmh_manage_net_wm_state(long data_l[], Client *c) } } /* Manage _NET_WM_STATE_STICKY */ - else if(data_l[1] == net_atom[net_wm_state_sticky]) + else if(data_l[1] == (long)net_atom[net_wm_state_sticky]) { /* == client_ignore_tag */ c->tag = MAXTAG + 1; arrange(c->screen, True); } /* Manage _NET_WM_STATE_DEMANDS_ATTENTION */ - else if(data_l[1] == net_atom[net_wm_state_demands_attention]) + else if(data_l[1] == (long)net_atom[net_wm_state_demands_attention]) { if(data_l[0] == _NET_WM_STATE_ADD) client_focus(c); @@ -419,8 +419,8 @@ void ewmh_manage_window_type(Client *c) { Atom *atom, rf; - int i, f; - ulong n, il; + int f; + ulong n, il, i; uchar *data = NULL; long ldata[5] = { 0 }; diff --git a/src/infobar.c b/src/infobar.c index 42678da..e6a255c 100644 --- a/src/infobar.c +++ b/src/infobar.c @@ -95,7 +95,7 @@ infobar_init(void) /* Create layout switch barwindow */ infobar[sc].layout_button = barwin_create(infobar[sc].bar->win, ((conf.layout_placement) ? 0 : (j + PAD / 2)), 0, - ((conf.layout_button_width > 0) ? conf.layout_button_width : (textw(tags[sc][seltag[sc]].layout.symbol) + PAD)), + ((conf.layout_button_width > 0) ? (uint)conf.layout_button_width : (textw(tags[sc][seltag[sc]].layout.symbol) + PAD)), infobar[sc].geo.height, conf.colors.layout_bg, conf.colors.layout_fg, False, False, conf.border.layout); @@ -159,7 +159,7 @@ infobar_draw_layout(int sc) if(!conf.layout_placement) barwin_move(infobar[sc].layout_button, infobar[sc].tags_board->geo.width + PAD / 2, 0); - barwin_resize(infobar[sc].layout_button, ((conf.layout_button_width > 0) ? conf.layout_button_width : (textw(tags[sc][seltag[sc]].layout.symbol) + PAD)), infobar[sc].geo.height); + barwin_resize(infobar[sc].layout_button, ((conf.layout_button_width > 0) ? (uint)conf.layout_button_width : (textw(tags[sc][seltag[sc]].layout.symbol) + PAD)), infobar[sc].geo.height); barwin_refresh_color(infobar[sc].layout_button); if(tags[sc][seltag[sc]].layout.symbol) @@ -193,7 +193,7 @@ infobar_draw_selbar(int sc) str = emalloc(conf.selbar.maxlength + 4, sizeof(char)); strncpy(str, sel->title, conf.selbar.maxlength); - if(strlen(sel->title) > conf.selbar.maxlength) + if(strlen(sel->title) > (size_t)conf.selbar.maxlength) strcat(str, "..."); } @@ -225,7 +225,7 @@ infobar_draw_taglist(int sc) Bool is_occupied[MAXTAG + 1]; if(conf.layout_placement) - barwin_move(infobar[sc].tags_board, ((conf.layout_button_width > 0) ? conf.layout_button_width : (textw(tags[sc][seltag[sc]].layout.symbol) + PAD)) + PAD / 2, 0); + barwin_move(infobar[sc].tags_board, ((conf.layout_button_width > 0) ? (uint)conf.layout_button_width : (textw(tags[sc][seltag[sc]].layout.symbol) + PAD)) + PAD / 2, 0); for(i = 0; i < MAXTAG; i++) is_occupied[i] = False; @@ -393,6 +393,7 @@ infobar_set_position(int pos) void uicb_infobar_togglepos(uicb_t cmd) { + (void)cmd; screen_get_sel(); infobar_set_position((tags[selscreen][seltag[selscreen]].barpos @@ -410,6 +411,7 @@ void uicb_toggle_tagautohide(uicb_t cmd) { int i, x; + (void)cmd; screen_get_sel(); conf.tagautohide = !conf.tagautohide; diff --git a/src/launcher.c b/src/launcher.c index e2191f8..c34df81 100644 --- a/src/launcher.c +++ b/src/launcher.c @@ -108,14 +108,14 @@ launcher_execute(Launcher *launcher) case XK_Up: if(launcher->nhisto) { - if(histpos >= launcher->nhisto) + if(histpos >= (int)launcher->nhisto) histpos = 0; strncpy(buf, launcher->histo[launcher->nhisto - ++histpos], sizeof(buf)); pos = strlen(buf); } break; case XK_Down: - if(launcher->nhisto && histpos > 0 && histpos < launcher->nhisto) + if(launcher->nhisto && histpos > 0 && histpos < (int)launcher->nhisto) { strncpy(buf, launcher->histo[launcher->nhisto - --histpos], sizeof(buf)); pos = strlen(buf); diff --git a/src/layout.c b/src/layout.c index db75a91..cfa5061 100644 --- a/src/layout.c +++ b/src/layout.c @@ -65,6 +65,7 @@ void freelayout(int screen) { Client *c; + (void)screen; for(c = clients; c; c = c->next) if(!ishide(c, selscreen) @@ -92,7 +93,7 @@ layoutswitch(Bool b) screen_get_sel(); if(tags[selscreen][seltag[selscreen]].layout.func == freelayout) - for(c = clients; c && (c->tag != seltag[selscreen] && c->screen != selscreen); c = c->next) + for(c = clients; c && (c->tag != (uint)seltag[selscreen] && c->screen != selscreen); c = c->next) { c->ogeo = c->geo; c->free_geo = c->geo; @@ -124,6 +125,7 @@ layoutswitch(Bool b) void uicb_layout_next(uicb_t cmd) { + (void)cmd; layoutswitch(True); return; @@ -135,6 +137,7 @@ uicb_layout_next(uicb_t cmd) void uicb_layout_prev(uicb_t cmd) { + (void)cmd; layoutswitch(False); return; @@ -321,15 +324,15 @@ multi_tile(int screen, Position type) if(type == Top || type == Bottom) { if(type == Top) - mastergeo.y = (n <= nmaster) ? sg.y : sg.y + (sg.height - mwfact) - BORDH; + mastergeo.y = (n <= nmaster) ? (uint)sg.y : sg.y + (sg.height - mwfact) - BORDH; mastergeo.width = (sg.width / nmaster) - (BORDH * 4); - mastergeo.height = (n <= nmaster) ? sg.height - BORDH : mwfact; + mastergeo.height = (n <= nmaster) ? (uint)(sg.height - BORDH) : mwfact; } else { if(type == Left) - mastergeo.x = (n <= nmaster) ? sg.x : (sg.x + sg.width) - mwfact - (BORDH * 2); - mastergeo.width = (n <= nmaster) ? sg.width - (BORDH * 2) : mwfact; + mastergeo.x = (n <= nmaster) ? (uint)sg.x : (sg.x + sg.width) - mwfact - (BORDH * 2); + mastergeo.width = (n <= nmaster) ? (uint)(sg.width - (BORDH * 2)) : mwfact; mastergeo.height = (sg.height / nmaster) - BORDH; } @@ -434,12 +437,15 @@ mirror(int screen, Bool horizontal) XRectangle sg = sgeo[screen]; XRectangle mastergeo = {sg.x, sg.y, sg.width, sg.height}; XRectangle cgeo = {sg.x, sg.y , sg.width, sg.height}; - XRectangle nextg[2] = { {0} }; + XRectangle nextg[2]; uint i, n, tilesize = 0, mwfact; uint nmaster = tags[screen][seltag[screen]].nmaster; int pa, imp; Bool isp = 0; + memset(&nextg[0], 0, sizeof(nextg[0])); + memset(&nextg[1], 0, sizeof(nextg[2])); + for(n = 0, c = tiled_client(screen, clients); c; c = tiled_client(screen, c->next), ++n); CHECK(n); @@ -687,6 +693,7 @@ grid_vertical(int screen) void uicb_tile_switch(uicb_t cmd) { + (void)cmd; layout_set_client_master (sel); return; } @@ -697,6 +704,8 @@ uicb_tile_switch(uicb_t cmd) void uicb_togglefree(uicb_t cmd) { + (void)cmd; + if(!sel || sel->screen != screen_get_sel() || (sel->flags & FSSFlag)) return; @@ -728,6 +737,8 @@ uicb_togglefree(uicb_t cmd) void uicb_togglemax(uicb_t cmd) { + (void)cmd; + if(!sel || ishide(sel, selscreen) || (sel->flags & HintFlag)|| (sel->flags & FSSFlag)) return; @@ -759,6 +770,7 @@ void uicb_toggle_resizehint(uicb_t cmd) { screen_get_sel(); + (void)cmd; tags[selscreen][seltag[selscreen]].resizehint = !tags[selscreen][seltag[selscreen]].resizehint; @@ -774,6 +786,7 @@ void uicb_toggle_abovefc(uicb_t cmd) { Client *c; + (void)cmd; screen_get_sel(); @@ -782,7 +795,7 @@ uicb_toggle_abovefc(uicb_t cmd) for(c = clients; c; c = c->next) if(c->flags & AboveFlag && c->screen == selscreen - && c->tag == seltag[selscreen]) + && c->tag == (uint)seltag[selscreen]) { c->flags &= ~AboveFlag; break; @@ -802,7 +815,7 @@ uicb_toggle_abovefc(uicb_t cmd) void uicb_set_layout(uicb_t cmd) { - int i, j, n; + size_t i, j, n; screen_get_sel(); @@ -850,6 +863,8 @@ layout_set_client_master(Client *c) Bool uicb_checkmax(uicb_t cmd) { + (void)cmd; + if(!sel) return False; @@ -865,6 +880,8 @@ uicb_checkmax(uicb_t cmd) Bool uicb_checkfree(uicb_t cmd) { + (void)cmd; + if(!sel) return False; diff --git a/src/menu.c b/src/menu.c index ece0138..12c0a13 100644 --- a/src/menu.c +++ b/src/menu.c @@ -354,6 +354,8 @@ menu_clear(Menu *menu) Bool menu_get_checkstring_needed(MenuItem *mi, int nitem) { + (void)mi; + (void)nitem; return True; } diff --git a/src/mouse.c b/src/mouse.c index 6907541..3d75f1f 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -319,7 +319,7 @@ mouse_resize(Client *c) void mouse_grabbuttons(Client *c, Bool focused) { - int i; + size_t i; uint but[] = {Button1, Button2, Button3, Button4, Button5}; XUngrabButton(dpy, AnyButton, AnyModifier, c->win); @@ -348,6 +348,7 @@ mouse_grabbuttons(Client *c, Bool focused) void uicb_mouse_move(uicb_t cmd) { + (void)cmd; CHECK(sel); mouse_move(sel); @@ -361,6 +362,7 @@ uicb_mouse_move(uicb_t cmd) void uicb_mouse_resize(uicb_t cmd) { + (void)cmd; CHECK(sel); mouse_resize(sel); diff --git a/src/screen.c b/src/screen.c index 2798208..bcf46ac 100644 --- a/src/screen.c +++ b/src/screen.c @@ -237,6 +237,7 @@ uicb_screen_select(uicb_t cmd) void uicb_screen_next(uicb_t cmd) { + (void)cmd; screen_get_sel(); selscreen = (selscreen + 1 > screen_count() - 1) ? 0 : selscreen + 1; @@ -252,6 +253,7 @@ uicb_screen_next(uicb_t cmd) void uicb_screen_prev(uicb_t cmd) { + (void)cmd; screen_get_sel(); selscreen = (selscreen - 1 < 0) ? screen_count() - 1 : selscreen - 1; @@ -267,6 +269,7 @@ uicb_screen_prev(uicb_t cmd) void uicb_screen_prev_sel(uicb_t cmd) { + (void)cmd; screen_get_sel(); screen_set_sel(prevselscreen); diff --git a/src/status.c b/src/status.c index 1331654..963a321 100644 --- a/src/status.c +++ b/src/status.c @@ -44,7 +44,7 @@ statustext_rectangle(StatusRec *r, char *str) char as; int n, i, j, k; - for(i = j = n = 0; i < strlen(str); ++i, ++j) + for(i = j = n = 0; i < (int)strlen(str); ++i, ++j) if(sscanf(&str[i], "\\b[%d;%d;%d;%d;#%x]%c", &r[n].x, &r[n].y, &r[n].w, &r[n].h, &r[n].color, &as) == 6 && as == '\\') for(++n, ++i, --j; str[i] != as || str[i - 1] != ']'; ++i); @@ -68,7 +68,7 @@ statustext_graph(StatusGraph *g, char *str) char as, c, *p; int n, i, j, k, m, w; - for(i = j = n = 0; i < strlen(str); ++i, ++j) + for(i = j = n = 0; i < (int)strlen(str); ++i, ++j) if(sscanf(&str[i], "\\g[%d;%d;%d;%d;#%x;%512[^]]]%c", &g[n].x, &g[n].y, &g[n].w, &g[n].h, &g[n].color, g[n].data, &as) == 7 && as == '\\') @@ -84,7 +84,7 @@ statustext_graph(StatusGraph *g, char *str) /* height limits */ if(c < 0) c = 0; - if(c > g[n].h) + if(c > (char)g[n].h) c = g[n].h; g[n].data[m] = c; p = strtok(NULL, ";"); @@ -118,7 +118,7 @@ statustext_text(StatusText *s, char *str) char as; int n, i, j, k; - for(i = j = n = 0; i < strlen(str); ++i, ++j) + for(i = j = n = 0; i < (int)strlen(str); ++i, ++j) if(sscanf(&str[i], "\\s[%d;%d;%7[^;];%512[^]]]%c", &s[n].x, &s[n].y, s[n].color, s[n].text, &as) == 5 && as == '\\') for(++n, ++i, --j; str[i] != as || str[i - 1] != ']'; ++i); @@ -146,7 +146,7 @@ statustext_normal(int sc, char *str) if(sc == conf.systray.screen) sw = systray_get_width(); - for(i = j = n = 0; i < strlen(str); ++i, ++j) + for(i = j = n = 0; i < (int)strlen(str); ++i, ++j) if(str[i] == '\\' && str[i + 1] == '#' && str[i + 8] == '\\') { ++n; @@ -164,7 +164,7 @@ statustext_normal(int sc, char *str) { strcpy(buf, strwc); - for(i = k = 0; i < strlen(str); ++i, ++k) + for(i = k = 0; i < (int)strlen(str); ++i, ++k) if(str[i] == '\\' && str[i + 1] == '#' && str[i + 8] == '\\') { /* Store current color in col[] */ diff --git a/src/tag.c b/src/tag.c index f509368..a731ecd 100644 --- a/src/tag.c +++ b/src/tag.c @@ -114,7 +114,7 @@ tag_set(int tag) /* No focusontag option found on any client, try to find the first of the tag */ if(!c) for(c = clients; c; c = c->next) - if(c->tag == seltag[selscreen] && c->screen == selscreen) + if(c->tag == (uint)seltag[selscreen] && c->screen == selscreen) break; client_focus((c) ? c : NULL); @@ -175,6 +175,7 @@ uicb_tag(uicb_t cmd) void uicb_tag_next(uicb_t cmd) { + (void)cmd; screen_get_sel(); tag_set(seltag[selscreen] + 1); @@ -188,6 +189,7 @@ uicb_tag_next(uicb_t cmd) void uicb_tag_prev(uicb_t cmd) { + (void)cmd; screen_get_sel(); tag_set(seltag[selscreen] - 1); @@ -204,6 +206,7 @@ uicb_tag_next_visible(uicb_t cmd) int i, tag; Client *c; Bool is_occupied[MAXTAG]; + (void)cmd; screen_get_sel(); @@ -247,6 +250,7 @@ uicb_tag_prev_visible(uicb_t cmd) int i, tag; Client *c; Bool is_occupied[MAXTAG]; + (void)cmd; screen_get_sel(); @@ -301,6 +305,7 @@ uicb_tagtransfert(uicb_t cmd) void uicb_tag_prev_sel(uicb_t cmd) { + (void)cmd; screen_get_sel(); tag_set(prevseltag[selscreen]); @@ -316,6 +321,7 @@ uicb_tagtransfert_next(uicb_t cmd) { CHECK(sel); int tag = seltag[selscreen] + 1; + (void)cmd; if(tag > conf.ntag[selscreen]) { @@ -336,6 +342,7 @@ uicb_tagtransfert_prev(uicb_t cmd) { CHECK(sel); int tag = seltag[selscreen] - 1; + (void)cmd; if(tag <= 0) { @@ -357,6 +364,8 @@ uicb_tag_urgent(uicb_t cmd) Client *c; Bool b = False; + (void)cmd; + /* Check if there is a urgent client */ for(c = clients; c; c = c->next) if(c->flags & UrgentFlag) @@ -428,9 +437,9 @@ tag_swap(int s, int t1, int t2) for(c = clients; c; c = c->next) { - if(c->screen == s && c->tag == t1) + if(c->screen == s && c->tag == (uint)t1) c->tag = t2; - else if(c->screen == s && c->tag == t2) + else if(c->screen == s && c->tag == (uint)t2) c->tag = t1; } @@ -459,6 +468,7 @@ uicb_tag_swap(uicb_t cmd) void uicb_tag_swap_next(uicb_t cmd) { + (void)cmd; screen_get_sel(); tag_swap(selscreen, seltag[selscreen], seltag[selscreen] + 1); @@ -472,6 +482,7 @@ uicb_tag_swap_next(uicb_t cmd) void uicb_tag_swap_previous(uicb_t cmd) { + (void)cmd; screen_get_sel(); tag_swap(selscreen, seltag[selscreen], seltag[selscreen] - 1); @@ -546,15 +557,17 @@ uicb_tag_new(uicb_t cmd) void tag_delete(int s, int tag) { - Tag t = { 0 }; + Tag t; Client *c; - int i; + size_t i; + + memset(&t, 0, sizeof(t)); if(tag < 0 || tag > conf.ntag[s] || conf.ntag[s] == 1) return; for(c = clients; c; c = c->next) - if(c->screen == s && c->tag == tag) + if(c->screen == s && c->tag == (uint)tag) { warnx("Client(s) present in this tag, can't delete it"); @@ -566,7 +579,7 @@ tag_delete(int s, int tag) tags[s][tag] = t; infobar[s].tags[tag] = NULL; - for(i = tag; i < conf.ntag[s] + 1; ++i) + for(i = tag; i < (size_t)conf.ntag[s] + 1; ++i) { /* Set clients tag because of shift */ for(c = clients; c; c = c->next) diff --git a/src/util.c b/src/util.c index 31807ca..a68baa6 100644 --- a/src/util.c +++ b/src/util.c @@ -209,7 +209,8 @@ spawn(const char *format, ...) char cmd[512]; va_list ap; pid_t pid, ret; - int p[2], len; + int p[2]; + size_t len; va_start(ap, format); len = vsnprintf(cmd, sizeof(cmd), format, ap); @@ -307,7 +308,7 @@ parse_image_block(ImageAttr *im, char *str) char as; int n, i, j, k; - for(i = j = n = 0; i < strlen(str); ++i, ++j) + for(i = j = n = 0; i < (int)strlen(str); ++i, ++j) if(sscanf(&str[i], "\\i[%d;%d;%d;%d;%512[^]]]%c", &im[n].x, &im[n].y, &im[n].w, &im[n].h, im[n].name, &as) == 6 && as == '\\') for(++n, ++i, --j; str[i] != as || str[i - 1] != ']'; ++i); diff --git a/src/viwmfs.c b/src/viwmfs.c index dd83410..d47b247 100644 --- a/src/viwmfs.c +++ b/src/viwmfs.c @@ -65,7 +65,7 @@ vicmd_to_uicb vicmd[] = void viwmfs_help(void) { - int i; + size_t i; char s[20]; printf("ViWMFS commands list:\n"); @@ -85,7 +85,7 @@ viwmfs_help(void) void viwmfs(int argc, char **argv) { - int i; + size_t i; char *cmd, str[256] = { 0 }; Bool e; @@ -94,7 +94,7 @@ viwmfs(int argc, char **argv) if(argc > 3) { - for(i = 2; i < argc; ++i) + for(i = 2; i < (size_t)argc; ++i) { strcat(str, argv[i]); diff --git a/src/wmfs.c b/src/wmfs.c index 95c809b..42f61e8 100644 --- a/src/wmfs.c +++ b/src/wmfs.c @@ -68,6 +68,8 @@ errorhandler(Display *d, XErrorEvent *event) int errorhandlerdummy(Display *d, XErrorEvent *event) { + (void)d; + (void)event; return 0; } @@ -77,7 +79,7 @@ void quit(void) { Client *c; - int i; + size_t i, len; /* Set the silent error handler */ XSetErrorHandler(errorhandlerdummy); @@ -111,7 +113,8 @@ quit(void) if(conf.menu) { - for(i = 0; i < LEN(conf.menu); ++i) + len = LEN(conf.menu); + for(i = 0; i < len; ++i) IFREE(conf.menu[i].item); IFREE(conf.menu); } @@ -192,6 +195,7 @@ mainloop(void) void uicb_quit(uicb_t cmd) { + (void)cmd; exiting = True; return; @@ -203,11 +207,11 @@ uicb_quit(uicb_t cmd) void scan(void) { - uint i, n; + uint n; XWindowAttributes wa; Window usl, usl2, *w = NULL; Atom rt; - int s, rf, tag = -1, screen = -1, free = -1; + int s, rf, tag = -1, screen = -1, free = -1, i; ulong ir, il; uchar *ret; Client *c; @@ -258,7 +262,7 @@ scan(void) /* Set update layout request */ for(c = clients; c; c = c->next) { - if(c->tag > conf.ntag[c->screen]) + if(c->tag > (uint)conf.ntag[c->screen]) c->tag = conf.ntag[c->screen]; tags[c->screen][c->tag].request_update = True; } @@ -277,6 +281,7 @@ scan(void) void uicb_reload(uicb_t cmd) { + (void)cmd; quit(); for(; argv_global[0] && argv_global[0] == ' '; ++argv_global); @@ -398,6 +403,7 @@ update_status(void) void signal_handle(int sig) { + (void)sig; exiting = True; quit(); exit(EXIT_SUCCESS);