Squash strict aliasing warnings.

Tue Nov 16 19:26:30 2004  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/gdkdnd-x11.c (_gdk_drag_get_protocol_for_display):
        Squash strict aliasing warnings.
This commit is contained in:
Owen Taylor 2004-11-17 00:55:10 +00:00 committed by Owen Taylor
parent c2669dd5bb
commit f266788e19
8 changed files with 80 additions and 22 deletions

View File

@ -1,3 +1,8 @@
Tue Nov 16 19:44:26 2004 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c gdk/x11/gdkim-x11.c gdk/x11/gdkwindow-x11.c:
More strict aliasing warning suppressage.
Tue Nov 16 19:26:30 2004 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkdnd-x11.c (_gdk_drag_get_protocol_for_display):

View File

@ -1,3 +1,8 @@
Tue Nov 16 19:44:26 2004 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c gdk/x11/gdkim-x11.c gdk/x11/gdkwindow-x11.c:
More strict aliasing warning suppressage.
Tue Nov 16 19:26:30 2004 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkdnd-x11.c (_gdk_drag_get_protocol_for_display):

View File

@ -1,3 +1,8 @@
Tue Nov 16 19:44:26 2004 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c gdk/x11/gdkim-x11.c gdk/x11/gdkwindow-x11.c:
More strict aliasing warning suppressage.
Tue Nov 16 19:26:30 2004 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkdnd-x11.c (_gdk_drag_get_protocol_for_display):

View File

@ -1,3 +1,8 @@
Tue Nov 16 19:44:26 2004 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c gdk/x11/gdkim-x11.c gdk/x11/gdkwindow-x11.c:
More strict aliasing warning suppressage.
Tue Nov 16 19:26:30 2004 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkdnd-x11.c (_gdk_drag_get_protocol_for_display):

View File

@ -909,6 +909,7 @@ motif_read_target_table (GdkDisplay *display)
if (motif_find_drag_window (display, FALSE))
{
guchar *data;
MotifTargetTableHeader *header = NULL;
guchar *target_bytes = NULL;
guchar *p;
@ -921,11 +922,13 @@ motif_read_target_table (GdkDisplay *display)
0, (sizeof(MotifTargetTableHeader)+3)/4, FALSE,
motif_drag_targets_atom,
&type, &format, &nitems, &bytes_after,
(guchar **)&header);
&data);
if (gdk_error_trap_pop () || (format != 8) || (nitems < sizeof (MotifTargetTableHeader)))
goto error;
header = (MotifTargetTableHeader *)data;
header->n_lists = card16_to_host (header->n_lists, header->byte_order);
header->total_size = card32_to_host (header->total_size, header->byte_order);
@ -1260,6 +1263,7 @@ motif_check_dest (GdkDisplay *display,
Window win)
{
gboolean retval = FALSE;
guchar *data;
MotifDragReceiverInfo *info;
Atom type = None;
int format;
@ -1271,12 +1275,14 @@ motif_check_dest (GdkDisplay *display,
motif_drag_receiver_info_atom,
0, (sizeof(*info)+3)/4, False, AnyPropertyType,
&type, &format, &nitems, &after,
(guchar **)&info);
&data);
if (gdk_error_trap_pop() == 0)
{
if (type != None)
{
info = (MotifDragReceiverInfo *)data;
if ((format == 8) && (nitems == sizeof(*info)))
{
if ((info->protocol_version == 0) &&
@ -1456,6 +1462,7 @@ motif_read_initiator_info (GdkDisplay *display,
gint format;
gulong nitems;
gulong bytes_after;
guchar *data;
MotifDragInitiatorInfo *initiator_info;
GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display);
@ -1465,7 +1472,7 @@ motif_read_initiator_info (GdkDisplay *display,
0, sizeof(*initiator_info), FALSE,
gdk_x11_get_xatom_by_name_for_display (display, "_MOTIF_DRAG_INITIATOR_INFO"),
&type, &format, &nitems, &bytes_after,
(guchar **)&initiator_info);
&data);
if (gdk_error_trap_pop () || (format != 8) || (nitems != sizeof (MotifDragInitiatorInfo)) || (bytes_after != 0))
{
@ -1473,6 +1480,8 @@ motif_read_initiator_info (GdkDisplay *display,
return FALSE;
}
initiator_info = (MotifDragInitiatorInfo *)data;
motif_read_target_table (display);
initiator_info->targets_index =
@ -2383,6 +2392,7 @@ xdnd_check_dest (GdkDisplay *display,
Atom type = None;
int format;
unsigned long nitems, after;
guchar *data;
Atom *version;
Window *proxy_data;
Window proxy;
@ -2397,10 +2407,12 @@ xdnd_check_dest (GdkDisplay *display,
xdnd_proxy_atom, 0,
1, False, AnyPropertyType,
&type, &format, &nitems, &after,
(guchar **)&proxy_data) == Success)
&data) == Success)
{
if (type != None)
{
proxy_data = (Window *)data;
if ((format == 32) && (nitems == 1))
{
proxy = *proxy_data;
@ -2417,9 +2429,11 @@ xdnd_check_dest (GdkDisplay *display,
xdnd_aware_atom, 0,
1, False, AnyPropertyType,
&type, &format, &nitems, &after,
(guchar **)&version) == Success) &&
&data) == Success) &&
type != None)
{
version = (Atom *)data;
if ((format == 32) && (nitems == 1))
{
if (*version >= 3)
@ -2450,7 +2464,8 @@ xdnd_read_actions (GdkDragContext *context)
Atom type;
int format;
gulong nitems, after;
Atom *data;
guchar *data;
Atom *atoms;
gint i;
@ -2467,13 +2482,15 @@ xdnd_read_actions (GdkDragContext *context)
gdk_x11_get_xatom_by_name_for_display (display, "XdndActionList"),
0, 65536,
False, XA_ATOM, &type, &format, &nitems,
&after, (guchar **)&data) == Success &&
&after, &data) == Success &&
type == XA_ATOM)
{
atoms = (Atom *)data;
context->actions = 0;
for (i=0; i<nitems; i++)
context->actions |= xdnd_action_from_atom (display, data[i]);
context->actions |= xdnd_action_from_atom (display, atoms[i]);
PRIVATE_DATA (context)->xdnd_have_actions = TRUE;
@ -2495,7 +2512,7 @@ xdnd_read_actions (GdkDragContext *context)
}
#endif /* G_ENABLE_DEBUG */
XFree(data);
XFree(atoms);
}
gdk_error_trap_pop ();
@ -2644,7 +2661,8 @@ xdnd_enter_filter (GdkXEvent *xev,
Atom type;
int format;
gulong nitems, after;
Atom *data;
guchar *data;
Atom *atoms;
guint32 source_window;
gboolean get_types;
@ -2708,7 +2726,7 @@ xdnd_enter_filter (GdkXEvent *xev,
gdk_x11_get_xatom_by_name_for_display (display, "XdndTypeList"),
0, 65536,
False, XA_ATOM, &type, &format, &nitems,
&after, (guchar **)&data);
&after, &data);
if (gdk_error_trap_pop () || (format != 32) || (type != XA_ATOM))
{
@ -2716,13 +2734,15 @@ xdnd_enter_filter (GdkXEvent *xev,
return GDK_FILTER_REMOVE;
}
atoms = (Atom *)data;
for (i=0; i<nitems; i++)
new_context->targets =
g_list_append (new_context->targets,
GDK_ATOM_TO_POINTER (gdk_x11_xatom_to_atom_for_display (display,
data[i])));
atoms[i])));
XFree(data);
XFree(atoms);
}
else
{

View File

@ -461,6 +461,7 @@ gdk_check_wm_desktop_changed (GdkWindow *window)
if (toplevel->have_sticky)
{
guchar *data;
gulong *desktop;
type = None;
@ -470,11 +471,12 @@ gdk_check_wm_desktop_changed (GdkWindow *window)
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP"),
0, G_MAXLONG, False, XA_CARDINAL, &type,
&format, &nitems,
&bytes_after, (guchar **)&desktop);
&bytes_after, &data);
gdk_error_trap_pop ();
if (type != None)
{
desktop = (gulong *)data;
toplevel->on_all_desktops = (*desktop == 0xFFFFFFFF);
XFree (desktop);
}
@ -495,6 +497,7 @@ gdk_check_wm_state_changed (GdkWindow *window)
gint format;
gulong nitems;
gulong bytes_after;
guchar *data;
Atom *atoms = NULL;
gulong i;
@ -510,7 +513,7 @@ gdk_check_wm_state_changed (GdkWindow *window)
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"),
0, G_MAXLONG, False, XA_ATOM, &type, &format, &nitems,
&bytes_after, (guchar **)&atoms);
&bytes_after, &data);
gdk_error_trap_pop ();
if (type != None)
@ -520,6 +523,8 @@ gdk_check_wm_state_changed (GdkWindow *window)
Atom maxhorz_atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_MAXIMIZED_HORZ");
Atom fullscreen_atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_FULLSCREEN");
atoms = (Atom *)data;
i = 0;
while (i < nitems)
{
@ -2460,6 +2465,7 @@ fetch_net_wm_check_window (GdkScreen *screen)
gint format;
gulong n_items;
gulong bytes_after;
guchar *data;
Window *xwindow;
/* This function is very slow on every call if you are not running a
@ -2479,11 +2485,13 @@ fetch_net_wm_check_window (GdkScreen *screen)
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), screen_x11->xroot_window,
gdk_x11_get_xatom_by_name_for_display (display, "_NET_SUPPORTING_WM_CHECK"),
0, G_MAXLONG, False, XA_WINDOW, &type, &format,
&n_items, &bytes_after, (guchar **) & xwindow);
&n_items, &bytes_after, &data);
if (type != XA_WINDOW)
return;
xwindow = (Window *)data;
gdk_error_trap_push ();
/* Find out if this WM goes away, so we can reset everything. */

View File

@ -160,11 +160,15 @@ gdk_wcstombs (const GdkWChar *src)
}
else
{
if (XwcTextListToTextProperty (xdisplay, (wchar_t**)&src, 1,
wchar_t *tmp;
if (XwcTextListToTextProperty (xdisplay, &tmp, 1,
XTextStyle, &tpr) != Success)
{
return NULL;
}
src = (GdkWChar *)tmp;
}
/*
* We must copy the string into an area allocated by glib, because

View File

@ -4126,6 +4126,7 @@ gdk_window_unstick (GdkWindow *window)
gint format;
gulong nitems;
gulong bytes_after;
guchar *data;
gulong *current_desktop;
GdkDisplay *display = gdk_drawable_get_display (window);
@ -4141,10 +4142,12 @@ gdk_window_unstick (GdkWindow *window)
gdk_x11_get_xatom_by_name_for_display (display, "_NET_CURRENT_DESKTOP"),
0, G_MAXLONG,
False, XA_CARDINAL, &type, &format, &nitems,
&bytes_after, (guchar **)&current_desktop);
&bytes_after, &data);
if (type == XA_CARDINAL)
{
current_desktop = (gulong *)data;
xev.xclient.type = ClientMessage;
xev.xclient.serial = 0;
xev.xclient.send_event = True;
@ -4480,7 +4483,7 @@ gdk_window_get_mwm_hints (GdkWindow *window)
{
GdkDisplay *display;
Atom hints_atom = None;
MotifWmHints *hints;
guchar *data;
Atom type;
gint format;
gulong nitems;
@ -4496,12 +4499,12 @@ gdk_window_get_mwm_hints (GdkWindow *window)
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window),
hints_atom, 0, sizeof (MotifWmHints)/sizeof (long),
False, AnyPropertyType, &type, &format, &nitems,
&bytes_after, (guchar **)&hints);
&bytes_after, &data);
if (type == None)
return NULL;
return hints;
return (MotifWmHints *)data;
}
static void
@ -4510,6 +4513,7 @@ gdk_window_set_mwm_hints (GdkWindow *window,
{
GdkDisplay *display;
Atom hints_atom = None;
guchar *data;
MotifWmHints *hints;
Atom type;
gint format;
@ -4526,12 +4530,14 @@ gdk_window_set_mwm_hints (GdkWindow *window,
XGetWindowProperty (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window),
hints_atom, 0, sizeof (MotifWmHints)/sizeof (long),
False, AnyPropertyType, &type, &format, &nitems,
&bytes_after, (guchar **)&hints);
&bytes_after, &data);
if (type == None)
hints = new_hints;
else
{
hints = (MotifWmHints *)data;
if (new_hints->flags & MWM_HINTS_FUNCTIONS)
{
hints->flags |= MWM_HINTS_FUNCTIONS;