avoid GCC warnings about breaking strict aliasing rules

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2008-02-02 21:52:26 +00:00
parent 7f85af8223
commit e8769ed11c
4 changed files with 32 additions and 29 deletions

View File

@@ -382,20 +382,20 @@ static bool wxKwinRunning(Display *display, Window rootWnd)
{
wxMAKE_ATOM(KWIN_RUNNING, display);
long *data;
unsigned char* data;
Atom type;
int format;
unsigned long nitems, after;
if (XGetWindowProperty(display, rootWnd,
KWIN_RUNNING, 0, 1, False, KWIN_RUNNING,
&type, &format, &nitems, &after,
(unsigned char**)&data) != Success)
&data) != Success)
{
return false;
}
bool retval = (type == KWIN_RUNNING &&
nitems == 1 && data && data[0] == 1);
nitems == 1 && data && ((long*)data)[0] == 1);
XFree(data);
return retval;
}