X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=spectrwm.c;h=98fe656d9f57320f460fbacc6dd1a9a462f467d2;hb=4a3fd19a46e387532267117f385d1f4ad5a3583e;hp=296d5e09eba3e279ad40a27220b64876c2c482cb;hpb=4289bcfe519b4b81b321c90dce75d443df3ecff6;p=spectrwm.git diff --git a/spectrwm.c b/spectrwm.c index 296d5e0..98fe656 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -1272,12 +1272,12 @@ plain_stacker(struct workspace *ws) void custom_region(char *val) { - unsigned int sidx, x, y, w, h; - int num_screens; + unsigned int x, y, w, h; + int sidx, num_screens; xcb_screen_t *screen; num_screens = xcb_setup_roots_length(xcb_get_setup(conn)); - if (sscanf(val, "screen[%u]:%ux%u+%u+%u", &sidx, &w, &h, &x, &y) != 5) + if (sscanf(val, "screen[%d]:%ux%u+%u+%u", &sidx, &w, &h, &x, &y) != 5) errx(1, "invalid custom region, " "should be 'screen[]:x++"); if (sidx < 1 || sidx > num_screens) @@ -3978,7 +3978,7 @@ search_resp_search_workspace(char *resp, unsigned long len) p = strchr(q, ':'); if (p != NULL) *p = '\0'; - ws_idx = strtonum(q, 1, workspace_limit, &errstr); + ws_idx = (int)strtonum(q, 1, workspace_limit, &errstr); if (errstr) { DNPRINTF(SWM_D_MISC, "workspace idx is %s: %s", errstr, q); @@ -4007,7 +4007,7 @@ search_resp_search_window(char *resp, unsigned long len) return; } - idx = strtonum(s, 1, INT_MAX, &errstr); + idx = (int)strtonum(s, 1, INT_MAX, &errstr); if (errstr) { DNPRINTF(SWM_D_MISC, "window idx is %s: %s", errstr, s); @@ -5475,8 +5475,8 @@ updatenumlockmask(void) void grabkeys(void) { - int num_screens; - unsigned int j, k; + int num_screens, k; + unsigned int j; xcb_keycode_t *code; unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask | LockMask }; @@ -6320,7 +6320,7 @@ tryharder: return (0); } - ret = strtonum(xcb_get_property_value(pr), 0, INT_MAX, &errstr); + ret = (pid_t)strtonum(xcb_get_property_value(pr), 0, INT_MAX, &errstr); free(pr); return (ret); @@ -6332,7 +6332,7 @@ manage_window(xcb_window_t id) xcb_window_t trans = XCB_WINDOW_NONE; struct workspace *ws; struct ws_win *win, *ww; - int i, ws_idx, border_me = 0; + int ws_idx, border_me = 0; xcb_atom_t ws_idx_atom = XCB_ATOM_NONE; char ws_idx_str[SWM_PROPLEN], *prop = NULL; size_t proplen; @@ -6340,7 +6340,7 @@ manage_window(xcb_window_t id) const char *errstr; struct pid_e *p; struct quirk *qp; - uint32_t event_mask; + uint32_t event_mask, i; xcb_atom_t prot; xcb_get_property_reply_t *gpr; xcb_icccm_get_wm_protocols_reply_t wpr; @@ -6459,7 +6459,7 @@ manage_window(xcb_window_t id) p = NULL; } else if (prop && win->transient == 0) { DNPRINTF(SWM_D_PROP, "manage_window: get _SWM_WS: %s\n", prop); - ws_idx = strtonum(prop, 0, workspace_limit - 1, + ws_idx = (int)strtonum(prop, 0, workspace_limit - 1, &errstr); if (errstr) { DNPRINTF(SWM_D_EVENT, "manage_window: window: #%s: %s", @@ -6737,7 +6737,8 @@ void buttonpress(xcb_button_press_event_t *e) { struct ws_win *win; - int i, action; + int i; + unsigned int action; DNPRINTF(SWM_D_EVENT, "buttonpress: window 0x%x, detail: %u\n", e->event, e->detail);