fix warning
This commit is contained in:
parent
5f92667773
commit
38c3547dfb
|
@ -34,6 +34,7 @@ netwmicon_draw(Widget *widget, DrawCtx *ctx, int offset,
|
||||||
int used __attribute__ ((unused)))
|
int used __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
unsigned long *data, pixel;
|
unsigned long *data, pixel;
|
||||||
|
unsigned char *wdata;
|
||||||
Atom type;
|
Atom type;
|
||||||
int format, width, height, size, i;
|
int format, width, height, size, i;
|
||||||
unsigned long items, rest;
|
unsigned long items, rest;
|
||||||
|
@ -46,23 +47,25 @@ netwmicon_draw(Widget *widget, DrawCtx *ctx, int offset,
|
||||||
if(XGetWindowProperty(ctx->display, sel->win,
|
if(XGetWindowProperty(ctx->display, sel->win,
|
||||||
XInternAtom(ctx->display, "_NET_WM_ICON", False),
|
XInternAtom(ctx->display, "_NET_WM_ICON", False),
|
||||||
0L, LONG_MAX, False, XA_CARDINAL, &type, &format,
|
0L, LONG_MAX, False, XA_CARDINAL, &type, &format,
|
||||||
&items, &rest, (unsigned char**) &data) != Success
|
&items, &rest, &wdata) != Success
|
||||||
|| !data)
|
|| !wdata)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if(type != XA_CARDINAL || format != 32 || items < 2)
|
if(type != XA_CARDINAL || format != 32 || items < 2)
|
||||||
{
|
{
|
||||||
XFree(data);
|
XFree(wdata);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data = (unsigned long *) wdata;
|
||||||
|
|
||||||
width = data[0];
|
width = data[0];
|
||||||
height = data[1];
|
height = data[1];
|
||||||
size = width * height;
|
size = width * height;
|
||||||
|
|
||||||
if(!size)
|
if(!size)
|
||||||
{
|
{
|
||||||
XFree(data);
|
XFree(wdata);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,7 +88,7 @@ netwmicon_draw(Widget *widget, DrawCtx *ctx, int offset,
|
||||||
|
|
||||||
p_delete(&image);
|
p_delete(&image);
|
||||||
|
|
||||||
XFree(data);
|
XFree(wdata);
|
||||||
|
|
||||||
widget->width = widget->statusbar->height;
|
widget->width = widget->statusbar->height;
|
||||||
return widget->width;
|
return widget->width;
|
||||||
|
|
Loading…
Reference in New Issue