Fixes all non-Wconversion warnings
This commit is contained in:
parent
bb5bc23256
commit
0aa0bbf6ff
24
bar.c
24
bar.c
|
@ -159,7 +159,7 @@ int xft_char_width (wchar_t ch, font_t *cur_font)
|
||||||
int slot = xft_char_width_slot(ch);
|
int slot = xft_char_width_slot(ch);
|
||||||
if (!xft_char[slot]) {
|
if (!xft_char[slot]) {
|
||||||
XGlyphInfo gi;
|
XGlyphInfo gi;
|
||||||
FT_UInt glyph = XftCharIndex (dpy, cur_font->xft_ft, ch);
|
FT_UInt glyph = XftCharIndex (dpy, cur_font->xft_ft, (FcChar32) ch);
|
||||||
XftFontLoadGlyphs (dpy, cur_font->xft_ft, FcFalse, &glyph, 1);
|
XftFontLoadGlyphs (dpy, cur_font->xft_ft, FcFalse, &glyph, 1);
|
||||||
XftGlyphExtents (dpy, cur_font->xft_ft, &glyph, 1, &gi);
|
XftGlyphExtents (dpy, cur_font->xft_ft, &glyph, 1, &gi);
|
||||||
XftFontUnloadGlyphs (dpy, cur_font->xft_ft, &glyph, 1);
|
XftFontUnloadGlyphs (dpy, cur_font->xft_ft, &glyph, 1);
|
||||||
|
@ -200,7 +200,7 @@ draw_char (monitor_t *mon, font_t *cur_font, int x, int align, wchar_t ch)
|
||||||
|
|
||||||
int y = bh / 2 + cur_font->height / 2- cur_font->descent;
|
int y = bh / 2 + cur_font->height / 2- cur_font->descent;
|
||||||
if (cur_font->xft_ft) {
|
if (cur_font->xft_ft) {
|
||||||
XftDrawString32 (xft_draw, &sel_fg, cur_font->xft_ft, x,y, &ch, 1);
|
XftDrawString32 (xft_draw, &sel_fg, cur_font->xft_ft, x,y,(const FcChar32*) &ch, 1);
|
||||||
} else {
|
} else {
|
||||||
char c_ = ch > 127 ? ' ' : ch;
|
char c_ = ch > 127 ? ' ' : ch;
|
||||||
/* xcb accepts string in UCS-2 BE, so swap */
|
/* xcb accepts string in UCS-2 BE, so swap */
|
||||||
|
@ -220,7 +220,7 @@ draw_char (monitor_t *mon, font_t *cur_font, int x, int align, wchar_t ch)
|
||||||
|
|
||||||
int
|
int
|
||||||
utf8decode(char *s, wchar_t *u) {
|
utf8decode(char *s, wchar_t *u) {
|
||||||
unsigned char c;
|
char c;
|
||||||
int i, n, rtn;
|
int i, n, rtn;
|
||||||
rtn = 1;
|
rtn = 1;
|
||||||
c = *s;
|
c = *s;
|
||||||
|
@ -341,13 +341,13 @@ set_attribute (const char modifier, const char attribute)
|
||||||
|
|
||||||
switch (modifier) {
|
switch (modifier) {
|
||||||
case '+':
|
case '+':
|
||||||
attrs |= (1<<pos);
|
attrs |= (1u<<pos);
|
||||||
break;
|
break;
|
||||||
case '-':
|
case '-':
|
||||||
attrs &=~(1<<pos);
|
attrs &=~(1u<<pos);
|
||||||
break;
|
break;
|
||||||
case '!':
|
case '!':
|
||||||
attrs ^= (1<<pos);
|
attrs ^= (1u<<pos);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -452,7 +452,7 @@ select_drawable_font (const wchar_t c)
|
||||||
font_t *font = font_list[i];
|
font_t *font = font_list[i];
|
||||||
if ((c > font->char_min && c < font->char_max &&
|
if ((c > font->char_min && c < font->char_max &&
|
||||||
font->width_lut[c - font->char_min].character_width != 0)||
|
font->width_lut[c - font->char_min].character_width != 0)||
|
||||||
(font->xft_ft && XftCharExists(dpy, font->xft_ft, c)))
|
(font->xft_ft && XftCharExists(dpy, font->xft_ft, (FcChar32) c)))
|
||||||
return font;
|
return font;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -716,7 +716,7 @@ set_ewmh_atoms (void)
|
||||||
xcb_change_property(c, XCB_PROP_MODE_REPLACE, mon->window, atom_list[NET_WM_WINDOW_TYPE], XCB_ATOM_ATOM, 32, 1, &atom_list[NET_WM_WINDOW_TYPE_DOCK]);
|
xcb_change_property(c, XCB_PROP_MODE_REPLACE, mon->window, atom_list[NET_WM_WINDOW_TYPE], XCB_ATOM_ATOM, 32, 1, &atom_list[NET_WM_WINDOW_TYPE_DOCK]);
|
||||||
xcb_change_property(c, XCB_PROP_MODE_APPEND, mon->window, atom_list[NET_WM_STATE], XCB_ATOM_ATOM, 32, 2, &atom_list[NET_WM_STATE_STICKY]);
|
xcb_change_property(c, XCB_PROP_MODE_APPEND, mon->window, atom_list[NET_WM_STATE], XCB_ATOM_ATOM, 32, 2, &atom_list[NET_WM_STATE_STICKY]);
|
||||||
xcb_change_property(c, XCB_PROP_MODE_REPLACE, mon->window, atom_list[NET_WM_DESKTOP], XCB_ATOM_CARDINAL, 32, 1, (const uint32_t []) {
|
xcb_change_property(c, XCB_PROP_MODE_REPLACE, mon->window, atom_list[NET_WM_DESKTOP], XCB_ATOM_CARDINAL, 32, 1, (const uint32_t []) {
|
||||||
-1
|
0u - 1u
|
||||||
} );
|
} );
|
||||||
xcb_change_property(c, XCB_PROP_MODE_REPLACE, mon->window, atom_list[NET_WM_STRUT_PARTIAL], XCB_ATOM_CARDINAL, 32, 12, strut);
|
xcb_change_property(c, XCB_PROP_MODE_REPLACE, mon->window, atom_list[NET_WM_STRUT_PARTIAL], XCB_ATOM_CARDINAL, 32, 12, strut);
|
||||||
xcb_change_property(c, XCB_PROP_MODE_REPLACE, mon->window, atom_list[NET_WM_STRUT], XCB_ATOM_CARDINAL, 32, 4, strut);
|
xcb_change_property(c, XCB_PROP_MODE_REPLACE, mon->window, atom_list[NET_WM_STRUT], XCB_ATOM_CARDINAL, 32, 4, strut);
|
||||||
|
@ -793,7 +793,7 @@ monitor_create_chain (xcb_rectangle_t *rects, const int num)
|
||||||
int left = bx;
|
int left = bx;
|
||||||
|
|
||||||
/* Sort before use */
|
/* Sort before use */
|
||||||
qsort(rects, num, sizeof(xcb_rectangle_t), rect_sort_cb);
|
qsort(rects, (size_t) num, sizeof(xcb_rectangle_t), rect_sort_cb);
|
||||||
|
|
||||||
for (i = 0; i < num; i++) {
|
for (i = 0; i < num; i++) {
|
||||||
int h = rects[i].y + rects[i].height;
|
int h = rects[i].y + rects[i].height;
|
||||||
|
@ -930,6 +930,7 @@ get_randr_monitors (void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
xcb_rectangle_t r[valid];
|
xcb_rectangle_t r[valid];
|
||||||
|
|
||||||
for (i = j = 0; i < num && j < valid; i++)
|
for (i = j = 0; i < num && j < valid; i++)
|
||||||
|
@ -1334,9 +1335,8 @@ main (int argc, char **argv)
|
||||||
area_t *area = area_get(press_ev->event, press_ev->event_x);
|
area_t *area = area_get(press_ev->event, press_ev->event_x);
|
||||||
/* Respond to the click */
|
/* Respond to the click */
|
||||||
if (area && area->button == press_ev->detail) {
|
if (area && area->button == press_ev->detail) {
|
||||||
ssize_t n;
|
write(STDOUT_FILENO, area->cmd, strlen(area->cmd));
|
||||||
n = write(STDOUT_FILENO, area->cmd, strlen(area->cmd));
|
write(STDOUT_FILENO, "\n", 1);
|
||||||
n = write(STDOUT_FILENO, "\n", 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user