--- demos/gtk-demo/changedisplay.c
+++ demos/gtk-demo/changedisplay.c
@@ -74,7 +74,7 @@
 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);
 
@@ -82,7 +82,7 @@
    * to the widget that created it.
    */
   if (pointer_window)
-    gdk_window_get_user_data (pointer_window, (gpointer*) &widget);
+    gdk_window_get_user_data (pointer_window, &widget);
 
   return widget ? gtk_widget_get_toplevel (widget) : NULL;
 }
--- demos/gtk-demo/textview.c
+++ demos/gtk-demo/textview.c
@@ -549,7 +549,7 @@
 easter_egg_callback (GtkWidget *button,
                      gpointer   data)
 {
-  static GtkWidget *window = NULL;
+  static gpointer window = NULL;
   GtkTextBuffer *buffer;
   GtkWidget     *view;
   GtkTextIter    iter;
@@ -588,7 +588,7 @@
   gtk_container_add (GTK_CONTAINER (sw), view);
 
   g_object_add_weak_pointer (G_OBJECT (window),
-                             (gpointer *) &window);
+                             &window);
 
   gtk_window_set_default_size (GTK_WINDOW (window), 300, 400);
   
--- gdk-pixbuf/queryloaders.c
+++ gdk-pixbuf/queryloaders.c
@@ -151,8 +151,8 @@
 {
 	char *path;
 	GModule *module;
-	void                    (*fill_info)     (GdkPixbufFormat *info);
-	void                    (*fill_vtable)   (GdkPixbufModule *module);
+	gpointer fill_info;
+	gpointer fill_vtable;
 
 	if (g_path_is_absolute (file)) 
 		path = g_strdup (file);
@@ -161,8 +161,8 @@
 
 	module = g_module_open (path, 0);
 	if (module &&
-	    g_module_symbol (module, "fill_info", (gpointer *) &fill_info) &&
-	    g_module_symbol (module, "fill_vtable", (gpointer *) &fill_vtable)) {
+	    g_module_symbol (module, "fill_info", &fill_info) &&
+	    g_module_symbol (module, "fill_vtable", &fill_vtable)) {
 		GdkPixbufFormat *info;
 		GdkPixbufModule *vtable;
 		
@@ -182,8 +182,8 @@
 		info = g_new0 (GdkPixbufFormat, 1);
 		vtable = g_new0 (GdkPixbufModule, 1);
 		
-		(*fill_info) (info);
-		(*fill_vtable) (vtable);
+		((void(*)(GdkPixbufFormat*)) fill_info) (info);
+		((void(*)(GdkPixbufModule*)) fill_vtable) (vtable);
 		
 		if (loader_sanity_check (path, info, vtable)) 
 			write_loader_info (path, info);
--- gdk/x11/gdkdnd-x11.c
+++ gdk/x11/gdkdnd-x11.c
@@ -906,6 +906,7 @@
   if (motif_find_drag_window (display, FALSE))
     {
       MotifTargetTableHeader *header = NULL;
+      gpointer vp_header = &header;
       guchar *target_bytes = NULL;
       guchar *p;
       gboolean success = FALSE;
@@ -917,7 +918,7 @@
 			  0, (sizeof(MotifTargetTableHeader)+3)/4, FALSE,
 			  motif_drag_targets_atom, 
 			  &type, &format, &nitems, &bytes_after,
-			  (guchar **)&header);
+			  vp_header);
 
       if (gdk_error_trap_pop () || (format != 8) || (nitems < sizeof (MotifTargetTableHeader)))
 	goto error;
@@ -1257,6 +1258,7 @@
 {
   gboolean retval = FALSE;
   MotifDragReceiverInfo *info;
+  gpointer vp_info = &info;
   Atom type = None;
   int format;
   unsigned long nitems, after;
@@ -1267,7 +1269,7 @@
 		      motif_drag_receiver_info_atom, 
 		      0, (sizeof(*info)+3)/4, False, AnyPropertyType,
 		      &type, &format, &nitems, &after, 
-		      (guchar **)&info);
+		      vp_info);
 
   if (gdk_error_trap_pop() == 0)
     {
@@ -1453,6 +1455,7 @@
   gulong nitems;
   gulong bytes_after;
   MotifDragInitiatorInfo *initiator_info;
+  gpointer vp_initiator_info = &initiator_info;
   
   GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display);
   
@@ -1461,7 +1464,7 @@
 		      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);
+		      vp_initiator_info);
 
   if (gdk_error_trap_pop () || (format != 8) || (nitems != sizeof (MotifDragInitiatorInfo)) || (bytes_after != 0))
     {
@@ -2368,7 +2371,9 @@
   int format;
   unsigned long nitems, after;
   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");
@@ -2381,7 +2386,7 @@
 			  xdnd_proxy_atom, 0, 
 			  1, False, AnyPropertyType,
 			  &type, &format, &nitems, &after, 
-			  (guchar **)&proxy_data) == Success)
+			  vp_proxy_data) == Success)
     {
       if (type != None)
 	{
@@ -2401,7 +2406,7 @@
 			       xdnd_aware_atom, 0, 
 			       1, False, AnyPropertyType,
 			       &type, &format, &nitems, &after, 
-			       (guchar **)&version) == Success) &&
+			       vp_version) == Success) &&
 	  type != None)
 	{
 	  if ((format == 32) && (nitems == 1))
@@ -2432,6 +2437,7 @@
   int format;
   gulong nitems, after;
   Atom *data;
+  gpointer vp_data = &data;
 
   gint i;
   
@@ -2448,7 +2454,7 @@
 			      gdk_x11_get_xatom_by_name_for_display (display, "XdndActionList"),
 			      0, 65536,
 			      False, XA_ATOM, &type, &format, &nitems,
-			      &after, (guchar **)&data) == Success &&
+			      &after, vp_data) == Success &&
 	  type == XA_ATOM)
 	{
 	  context->actions = 0;
@@ -2626,6 +2632,7 @@
   int format;
   gulong nitems, after;
   Atom *data;
+  gpointer vp_data = &data;
 
   guint32 source_window;
   gboolean get_types;
@@ -2689,7 +2696,7 @@
 			  gdk_x11_get_xatom_by_name_for_display (display, "XdndTypeList"),
 			  0, 65536,
 			  False, XA_ATOM, &type, &format, &nitems,
-			  &after, (guchar **)&data);
+			  &after, vp_data);
 
       if (gdk_error_trap_pop () || (format != 32) || (type != XA_ATOM))
 	{
--- gdk/x11/gdkevents-x11.c
+++ gdk/x11/gdkevents-x11.c
@@ -453,18 +453,18 @@
 
   if (toplevel->have_sticky)
     {
-      gulong *desktop;
+      guchar *desktop;
       
       XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), 
 			  GDK_WINDOW_XID (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, &desktop);
 
       if (type != None)
         {
-          toplevel->on_all_desktops = (*desktop == 0xFFFFFFFF);
+          toplevel->on_all_desktops = (*(gulong*)desktop == 0xFFFFFFFF);
           XFree (desktop);
         }
       else
@@ -485,6 +485,7 @@
   gulong nitems;
   gulong bytes_after;
   Atom *atoms = NULL;
+  gpointer vp_atoms = &atoms;
   gulong i;
 
   gboolean had_sticky = toplevel->have_sticky;
@@ -497,7 +498,7 @@
   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, vp_atoms);
 
   if (type != None)
     {
@@ -2381,6 +2382,7 @@
   gulong n_items;
   gulong bytes_after;
   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
@@ -2399,7 +2401,7 @@
   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, vp_xwindow);
   
   if (type != XA_WINDOW)
     return;
--- gdk/x11/gdkim-x11.c
+++ gdk/x11/gdkim-x11.c
@@ -133,6 +133,7 @@
 gchar *
 gdk_wcstombs (const GdkWChar *src)
 {
+  gpointer vp_src = &src;
   gchar *mbstr;
 
   if (gdk_use_mb)
@@ -159,7 +160,7 @@
 	}
       else
 	{
-	  if (XwcTextListToTextProperty (xdisplay, (wchar_t**)&src, 1,
+	  if (XwcTextListToTextProperty (xdisplay, vp_src, 1,
 					 XTextStyle, &tpr) != Success)
 	    {
 	      return NULL;
--- gdk/x11/gdkwindow-x11.c
+++ gdk/x11/gdkwindow-x11.c
@@ -3688,7 +3688,7 @@
       gint format;
       gulong nitems;
       gulong bytes_after;
-      gulong *current_desktop;
+      guchar *current_desktop;
       GdkDisplay *display = gdk_drawable_get_display (window);
       
       /* Request unstick from viewport */
@@ -3703,7 +3703,7 @@
 			  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, &current_desktop);
 
       if (type == XA_CARDINAL)
         {
@@ -4031,7 +4031,7 @@
 {
   GdkDisplay *display;
   Atom hints_atom = None;
-  MotifWmHints *hints;
+  guchar *hints;
   Atom type;
   gint format;
   gulong nitems;
@@ -4047,12 +4047,12 @@
   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, &hints);
 
   if (type == None)
     return NULL;
   
-  return hints;
+  return (MotifWmHints*)hints;
 }
 
 static void
@@ -4062,6 +4062,7 @@
   GdkDisplay *display;
   Atom hints_atom = None;
   MotifWmHints *hints;
+  gpointer vp_hints = &hints;
   Atom type;
   gint format;
   gulong nitems;
@@ -4077,7 +4078,7 @@
   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, vp_hints);
   
   if (type == None)
     hints = new_hints;
--- gtk/gtkcombo.c
+++ gtk/gtkcombo.c
@@ -556,7 +556,7 @@
   
   gtk_window_move (GTK_WINDOW (combo->popwin), x, y);
 
-  toplevel = gtk_widget_get_toplevel (combo);
+  toplevel = gtk_widget_get_toplevel ((GtkWidget*)combo);
 
   if (GTK_IS_WINDOW (toplevel))
     {
--- gtk/gtkmain.c
+++ gtk/gtkmain.c
@@ -528,7 +528,7 @@
 load_module (GSList      *module_list,
 	     const gchar *name)
 {
-  GtkModuleInitFunc modinit_func = NULL;
+  gpointer modinit_func = NULL;
   GtkModuleInfo *info;
   GModule *module = NULL;
   
@@ -1348,7 +1348,8 @@
 rewrite_event_for_grabs (GdkEvent *event)
 {
   GdkWindow *grab_window;
-  GtkWidget *event_widget, *grab_widget;
+  GtkWidget *event_widget;
+  gpointer grab_widget;
   gboolean owner_events;
   GdkDisplay *display;
 
@@ -2225,11 +2226,11 @@
 GtkWidget*
 gtk_get_event_widget (GdkEvent *event)
 {
-  GtkWidget *widget;
+  gpointer widget;
 
   widget = NULL;
   if (event && event->any.window)
-    gdk_window_get_user_data (event->any.window, (void**) &widget);
+    gdk_window_get_user_data (event->any.window, &widget);
   
   return widget;
 }
--- gtk/gtkselection.c
+++ gtk/gtkselection.c
@@ -714,7 +714,7 @@
   
   if (owner_window != NULL)
     {
-      GtkWidget *owner_widget;
+      void *owner_widget;
       GtkSelectionData selection_data;
       
       selection_data.selection = selection;
@@ -723,7 +724,7 @@
       selection_data.length = -1;
       selection_data.display = display;
       
-      gdk_window_get_user_data (owner_window, (gpointer *)&owner_widget);
+      gdk_window_get_user_data (owner_window, &owner_widget);
       
       if (owner_widget != NULL)
 	{
--- gtk/gtktipsquery.c
+++ gtk/gtktipsquery.c
@@ -443,7 +443,7 @@
 		      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);
@@ -466,12 +466,12 @@
       
     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;
       if (pointer_window)
-	gdk_window_get_user_data (pointer_window, (gpointer*) &event_widget);
+	gdk_window_get_user_data (pointer_window, &event_widget);
       gtk_tips_query_emit_widget_entered (tips_query, event_widget);
       event_handled = TRUE;
       break;
--- gtk/gtkwidget.c
+++ gtk/gtkwidget.c
@@ -3647,12 +3647,12 @@
 
       for (tmp_list = children; tmp_list; tmp_list = tmp_list->next)
 	{
-	  GtkWidget *child;
+	  gpointer child;
 	  GdkWindow *window = tmp_list->data;
 
-	  gdk_window_get_user_data (window, (void **)&child);
+	  gdk_window_get_user_data (window, &child);
 	  while (child && child != widget)
-	    child = child->parent;
+	    child = ((GtkWidget*)child)->parent;
 
 	  if (child)
 	    gdk_window_reparent (window, new_window, 0, 0);
--- gtk/queryimmodules.c
+++ gtk/queryimmodules.c
@@ -80,11 +80,10 @@
 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;
 
   GModule *module;
   gchar *path;
@@ -104,10 +103,10 @@
     }
 	  
   if (module &&
-      g_module_symbol (module, "im_module_list", (gpointer *) &list) &&
-      g_module_symbol (module, "im_module_init", (gpointer *) &init) &&
-      g_module_symbol (module, "im_module_exit", (gpointer *) &exit) &&
-      g_module_symbol (module, "im_module_create", (gpointer *) &create))
+      g_module_symbol (module, "im_module_list", &list) &&
+      g_module_symbol (module, "im_module_init", &init) &&
+      g_module_symbol (module, "im_module_exit", &exit) &&
+      g_module_symbol (module, "im_module_create", &create))
     {
       const GtkIMContextInfo **contexts;
       guint n_contexts;
@@ -116,7 +115,7 @@
       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++)
 	{
--- tests/testcalendar.c
+++ tests/testcalendar.c
@@ -18,6 +18,8 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+/* gtk_calendar_display_options is deprecated */
+#undef GTK_DISABLE_DEPRECATED
 #include <config.h>
 #include <stdio.h>
 #include <string.h>
--- tests/testentrycompletion.c
+++ tests/testentrycompletion.c
@@ -311,7 +311,7 @@
   g_object_unref (completion);
   
   /* Create a tree model and use it as the completion model */
-  completion_model = gtk_list_store_new (1, G_TYPE_STRING);
+  completion_model = (GtkTreeModel*) gtk_list_store_new (1, G_TYPE_STRING);
 
   gtk_entry_completion_set_model (completion, completion_model);
   g_object_unref (completion_model);
--- tests/testgtk.c
+++ tests/testgtk.c
@@ -1956,7 +1956,7 @@
 static void 
 create_gridded_geometry (GtkWidget *widget)
 {
-  static GtkWidget *window = NULL;
+  static gpointer window = NULL;
   GtkWidget *entry;
   GtkWidget *label;
 
@@ -1980,7 +1980,7 @@
 
       g_signal_connect (window, "response",
 			G_CALLBACK (gridded_geometry_response), entry);
-      g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
+      g_object_add_weak_pointer (G_OBJECT (window), &window);
 
       gtk_widget_show_all (window);
     }
@@ -4115,7 +4115,7 @@
 static void
 create_key_lookup (GtkWidget *widget)
 {
-  static GtkWidget *window = NULL;
+  static gpointer window = NULL;
 
   if (!window)
     {
@@ -4156,7 +4156,7 @@
       button = gtk_button_new_with_mnemonic ("Button 11 (_!)");
       gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
       
-      g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
+      g_object_add_weak_pointer (G_OBJECT (window), &window);
       g_signal_connect (window, "response", G_CALLBACK (gtk_object_destroy), NULL);
 
       gtk_widget_show_all (window);
@@ -11242,7 +11242,7 @@
 static GtkWidget *
 find_widget_at_pointer (GdkDisplay *display)
 {
-  GtkWidget *widget = NULL;
+  gpointer widget = NULL;
   GdkWindow *pointer_window;
   gint x, y;
   FindWidgetData data;
@@ -11250,11 +11250,11 @@
  pointer_window = gdk_display_get_window_at_pointer (display, NULL, NULL);
  
  if (pointer_window)
-   gdk_window_get_user_data (pointer_window, (gpointer*) &widget);
+   gdk_window_get_user_data (pointer_window, &widget);
 
  if (widget)
    {
-     gdk_window_get_pointer (widget->window,
+     gdk_window_get_pointer (((GtkWidget *)widget)->window,
 			     &x, &y, NULL);
      
      data.x = x;
