gtk2/gtk+-strict-aliasing.patch

217 lines
7.3 KiB
Diff

From 9e474aed8bedead6b2a962a9ee3c6559fd412676 Mon Sep 17 00:00:00 2001
From: Michael Wolf <maw@novell.com>
Date: Tue, 22 Jul 2008 16:35:51 -0500
Subject: [PATCH] gtk+-strict-aliasing.patch
---
demos/gtk-demo/changedisplay.c | 2 +-
demos/gtk-demo/textview.c | 5 +++++
gdk/x11/gdkdnd-x11.c | 5 +++++
gdk/x11/gdkevents-x11.c | 2 ++
gdk/x11/gdkim-x11.c | 1 +
gdk/x11/gdkwindow-x11.c | 1 +
gtk/gtkmodules.c | 4 ++--
gtk/gtktipsquery.c | 4 ++--
gtk/queryimmodules.c | 11 +++++------
tests/testgtk.c | 6 +++---
10 files changed, 27 insertions(+), 14 deletions(-)
Index: gtk+-2.13.6/demos/gtk-demo/changedisplay.c
===================================================================
--- gtk+-2.13.6.orig/demos/gtk-demo/changedisplay.c
+++ gtk+-2.13.6/demos/gtk-demo/changedisplay.c
@@ -73,7 +73,7 @@ static GtkWidget *
find_toplevel_at_pointer (GdkDisplay *display)
{
GdkWindow *pointer_window;
- GtkWidget *widget = NULL;
+ gpointer widget = NULL;
pointer_window = gdk_display_get_window_at_pointer (display, NULL, NULL);
Index: gtk+-2.13.6/gdk/x11/gdkdnd-x11.c
===================================================================
--- gtk+-2.13.6.orig/gdk/x11/gdkdnd-x11.c
+++ gtk+-2.13.6/gdk/x11/gdkdnd-x11.c
@@ -905,6 +905,7 @@ motif_read_target_table (GdkDisplay *dis
{
guchar *data;
MotifTargetTableHeader *header = NULL;
+ gpointer vp_header = &header;
guchar *target_bytes = NULL;
guchar *p;
gboolean success = FALSE;
@@ -1259,6 +1260,7 @@ motif_check_dest (GdkDisplay *display,
gboolean retval = FALSE;
guchar *data;
MotifDragReceiverInfo *info;
+ gpointer vp_info = &info;
Atom type = None;
int format;
unsigned long nitems, after;
@@ -1461,6 +1463,7 @@ motif_read_initiator_info (GdkDisplay *d
gulong bytes_after;
guchar *data;
MotifDragInitiatorInfo *initiator_info;
+ gpointer vp_initiator_info = &initiator_info;
GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display);
@@ -2395,7 +2398,9 @@ xdnd_check_dest (GdkDisplay *display,
unsigned long nitems, after;
guchar *data;
Atom *version;
+ gpointer vp_version = &version;
Window *proxy_data;
+ gpointer vp_proxy_data = &proxy_data;
Window proxy;
Atom xdnd_proxy_atom = gdk_x11_get_xatom_by_name_for_display (display, "XdndProxy");
Atom xdnd_aware_atom = gdk_x11_get_xatom_by_name_for_display (display, "XdndAware");
Index: gtk+-2.13.6/gdk/x11/gdkevents-x11.c
===================================================================
--- gtk+-2.13.6.orig/gdk/x11/gdkevents-x11.c
+++ gtk+-2.13.6/gdk/x11/gdkevents-x11.c
@@ -519,6 +519,7 @@ gdk_check_wm_state_changed (GdkWindow *w
gulong bytes_after;
guchar *data;
Atom *atoms = NULL;
+ gpointer vp_atoms = &atoms;
gulong i;
gboolean had_sticky = toplevel->have_sticky;
@@ -2614,6 +2615,7 @@ fetch_net_wm_check_window (GdkScreen *sc
gulong bytes_after;
guchar *data;
Window *xwindow;
+ gpointer vp_xwindow = &xwindow;
/* This function is very slow on every call if you are not running a
* spec-supporting WM. For now not optimized, because it isn't in
Index: gtk+-2.13.6/gdk/x11/gdkim-x11.c
===================================================================
--- gtk+-2.13.6.orig/gdk/x11/gdkim-x11.c
+++ gtk+-2.13.6/gdk/x11/gdkim-x11.c
@@ -130,6 +130,7 @@ find_a_display (void)
gchar *
gdk_wcstombs (const GdkWChar *src)
{
+ gpointer vp_src = &src;
gchar *mbstr;
if (gdk_use_mb)
Index: gtk+-2.13.6/gdk/x11/gdkwindow-x11.c
===================================================================
--- gtk+-2.13.6.orig/gdk/x11/gdkwindow-x11.c
+++ gtk+-2.13.6/gdk/x11/gdkwindow-x11.c
@@ -4732,6 +4732,7 @@ gdk_window_set_mwm_hints (GdkWindow *win
Atom hints_atom = None;
guchar *data;
MotifWmHints *hints;
+ gpointer vp_hints = &hints;
Atom type;
gint format;
gulong nitems;
Index: gtk+-2.13.6/gtk/gtkmodules.c
===================================================================
--- gtk+-2.13.6.orig/gtk/gtkmodules.c
+++ gtk+-2.13.6/gtk/gtkmodules.c
@@ -281,9 +281,9 @@ load_module (GSList *module_list,
if (module)
{
if (g_module_symbol (module, "gtk_module_init", &modinit_func_ptr))
- modinit_func = modinit_func_ptr;
+ modinit_func = modinit_func_ptr;
else
- modinit_func = NULL;
+ modinit_func = NULL;
if (!modinit_func)
g_module_close (module);
Index: gtk+-2.13.6/gtk/gtktipsquery.c
===================================================================
--- gtk+-2.13.6.orig/gtk/gtktipsquery.c
+++ gtk+-2.13.6/gtk/gtktipsquery.c
@@ -442,7 +442,7 @@ gtk_tips_query_event (GtkWidget *
GdkEvent *event)
{
GtkTipsQuery *tips_query;
- GtkWidget *event_widget;
+ gpointer event_widget;
gboolean event_handled;
g_return_val_if_fail (GTK_IS_TIPS_QUERY (widget), FALSE);
@@ -465,7 +465,7 @@ gtk_tips_query_event (GtkWidget *
case GDK_LEAVE_NOTIFY:
if (event_widget)
- pointer_window = gdk_window_get_pointer (event_widget->window, NULL, NULL, NULL);
+ pointer_window = gdk_window_get_pointer (((GtkWidget*)event_widget)->window, NULL, NULL, NULL);
else
pointer_window = NULL;
event_widget = NULL;
Index: gtk+-2.13.6/gtk/queryimmodules.c
===================================================================
--- gtk+-2.13.6.orig/gtk/queryimmodules.c
+++ gtk+-2.13.6/gtk/queryimmodules.c
@@ -88,11 +88,10 @@ print_escaped (const char *str)
static gboolean
query_module (const char *dir, const char *name)
{
- void (*list) (const GtkIMContextInfo ***contexts,
- guint *n_contexts);
- void (*init) (GTypeModule *type_module);
- void (*exit) (void);
- GtkIMContext *(*create) (const gchar *context_id);
+ gpointer list;
+ gpointer init;
+ gpointer exit;
+ gpointer create;
gpointer list_ptr;
gpointer init_ptr;
@@ -134,7 +133,7 @@ query_module (const char *dir, const cha
print_escaped (path);
fputs ("\n", stdout);
- (*list) (&contexts, &n_contexts);
+ ((void(*)(const GtkIMContextInfo ***, guint *)) list) (&contexts, &n_contexts);
for (i=0; i<n_contexts; i++)
{
Index: gtk+-2.13.6/tests/testgtk.c
===================================================================
--- gtk+-2.13.6.orig/tests/testgtk.c
+++ gtk+-2.13.6/tests/testgtk.c
@@ -12026,7 +12026,7 @@ find_widget (GtkWidget *widget, FindWidg
static GtkWidget *
find_widget_at_pointer (GdkDisplay *display)
{
- GtkWidget *widget = NULL;
+ gpointer widget = NULL;
GdkWindow *pointer_window;
gint x, y;
FindWidgetData data;
@@ -12043,8 +12043,8 @@ find_widget_at_pointer (GdkDisplay *disp
if (widget)
{
- gdk_window_get_pointer (widget->window,
- &x, &y, NULL);
+ gdk_window_get_pointer (((GtkWidget *) widget)->window,
+ &x, &y, NULL);
data.x = x;
data.y = y;
Index: gtk+-2.13.6/tests/testfilechooserbutton.c
===================================================================
--- gtk+-2.13.6.orig/tests/testfilechooserbutton.c
+++ gtk+-2.13.6/tests/testfilechooserbutton.c
@@ -31,6 +31,7 @@
#include <string.h>
+#undef GTK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#ifdef G_OS_WIN32