aboutsummaryrefslogtreecommitdiffstats
path: root/src/gtkutil.c
diff options
context:
space:
mode:
authorPaul Eggert2011-03-13 00:31:16 -0800
committerPaul Eggert2011-03-13 00:31:16 -0800
commit1e5524e7cfe4ec2ad1841c28495dce4ecc5f487e (patch)
treef70fbd486380e616fc58ee5a4a924459ccf339cb /src/gtkutil.c
parentb0afc268e8513939e5fc0551f33aec6884e7a4e6 (diff)
downloademacs-1e5524e7cfe4ec2ad1841c28495dce4ecc5f487e.tar.gz
emacs-1e5524e7cfe4ec2ad1841c28495dce4ecc5f487e.zip
* gtkutil.c (int_gtk_range_get_value): New function, which avoids a diagnostic
from gcc -Wbad-function-cast. (xg_set_toolkit_scroll_bar_thumb): Use it. (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid diagnostic from gcc -Wbad-function-cast.
Diffstat (limited to 'src/gtkutil.c')
-rw-r--r--src/gtkutil.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 04b8a64c995..b66a9a9c555 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -84,6 +84,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
84 84
85#define XG_BIN_CHILD(x) gtk_bin_get_child (GTK_BIN (x)) 85#define XG_BIN_CHILD(x) gtk_bin_get_child (GTK_BIN (x))
86 86
87/* Get the current value of the range, truncated to an integer. */
88static int
89int_gtk_range_get_value (GtkRange *range)
90{
91 return gtk_range_get_value (range);
92}
93
87 94
88/*********************************************************************** 95/***********************************************************************
89 Display handling functions 96 Display handling functions
@@ -3562,7 +3569,7 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar,
3562 changed = 1; 3569 changed = 1;
3563 } 3570 }
3564 3571
3565 if (changed || (int) gtk_range_get_value (GTK_RANGE (wscroll)) != value) 3572 if (changed || int_gtk_range_get_value (GTK_RANGE (wscroll)) != value)
3566 { 3573 {
3567 BLOCK_INPUT; 3574 BLOCK_INPUT;
3568 3575
@@ -3570,7 +3577,7 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar,
3570 ignore_gtk_scrollbar to make the callback do nothing */ 3577 ignore_gtk_scrollbar to make the callback do nothing */
3571 xg_ignore_gtk_scrollbar = 1; 3578 xg_ignore_gtk_scrollbar = 1;
3572 3579
3573 if ((int) gtk_range_get_value (GTK_RANGE (wscroll)) != value) 3580 if (int_gtk_range_get_value (GTK_RANGE (wscroll)) != value)
3574 gtk_range_set_value (GTK_RANGE (wscroll), (gdouble)value); 3581 gtk_range_set_value (GTK_RANGE (wscroll), (gdouble)value);
3575 else if (changed) 3582 else if (changed)
3576 gtk_adjustment_changed (adj); 3583 gtk_adjustment_changed (adj);
@@ -3666,8 +3673,8 @@ xg_tool_bar_callback (GtkWidget *w, gpointer client_data)
3666{ 3673{
3667 /* The EMACS_INT cast avoids a warning. */ 3674 /* The EMACS_INT cast avoids a warning. */
3668 int idx = (int) (EMACS_INT) client_data; 3675 int idx = (int) (EMACS_INT) client_data;
3669 int mod = (int) (EMACS_INT) g_object_get_data (G_OBJECT (w), 3676 gpointer gmod = g_object_get_data (G_OBJECT (w), XG_TOOL_BAR_LAST_MODIFIER);
3670 XG_TOOL_BAR_LAST_MODIFIER); 3677 int mod = (int) (EMACS_INT) gmod;
3671 3678
3672 FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA); 3679 FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA);
3673 Lisp_Object key, frame; 3680 Lisp_Object key, frame;
@@ -4218,9 +4225,9 @@ xg_tool_item_stale_p (GtkWidget *wbutton, const char *stock_name,
4218 } 4225 }
4219 else 4226 else
4220 { 4227 {
4221 Pixmap old_img 4228 gpointer gold_img = g_object_get_data (G_OBJECT (wimage),
4222 = (Pixmap) g_object_get_data (G_OBJECT (wimage), 4229 XG_TOOL_BAR_IMAGE_DATA);
4223 XG_TOOL_BAR_IMAGE_DATA); 4230 Pixmap old_img = (Pixmap) gold_img;
4224 if (old_img != img->pixmap) 4231 if (old_img != img->pixmap)
4225 return 1; 4232 return 1;
4226 } 4233 }