2011-04-19 Paul Eggert <eggert@cs.ucla.edu>
+ * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
+ (GDK_KEY_g): Don't define if already defined.
+ (xg_prepare_tooltip): Avoid pointer signedness problem.
+ (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
+
* process.c (Fnetwork_interface_info): Avoid left-shift undefined
behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
gdk_window_get_geometry (w, a, b, c, d, 0)
#define gdk_x11_window_lookup_for_display(d, w) \
gdk_xid_table_lookup_for_display (d, w)
+#ifndef GDK_KEY_g
#define GDK_KEY_g GDK_g
#endif
+#endif
#define XG_BIN_CHILD(x) gtk_bin_get_child (GTK_BIN (x))
hierarchy-changed. */
gtk_tooltip_set_custom (x->ttip_widget, widget);
- gtk_tooltip_set_text (x->ttip_widget, SDATA (encoded_string));
+ gtk_tooltip_set_text (x->ttip_widget, SSDATA (encoded_string));
gtk_widget_get_preferred_size (GTK_WIDGET (x->ttip_window), NULL, &req);
if (width) *width = req.width;
if (height) *height = req.height;
gdouble shown;
gdouble top;
int size, value;
+ int old_size;
int new_step;
int changed = 0;
/* Assume all lines are of equal size. */
new_step = size / max (1, FRAME_LINES (f));
- if ((int) gtk_adjustment_get_page_size (adj) != size
- || (int) gtk_adjustment_get_step_increment (adj) != new_step)
- {
- gtk_adjustment_set_page_size (adj, size);
- gtk_adjustment_set_step_increment (adj, new_step);
- /* Assume a page increment is about 95% of the page size */
- gtk_adjustment_set_page_increment (adj,(int) (0.95*size));
- changed = 1;
- }
+ old_size = gtk_adjustment_get_page_size (adj);
+ if (old_size != size)
+ {
+ int old_step = gtk_adjustment_get_step_increment (adj);
+ if (old_step != new_step)
+ {
+ gtk_adjustment_set_page_size (adj, size);
+ gtk_adjustment_set_step_increment (adj, new_step);
+ /* Assume a page increment is about 95% of the page size */
+ gtk_adjustment_set_page_increment (adj,(int) (0.95*size));
+ changed = 1;
+ }
+ }
if (changed || int_gtk_range_get_value (GTK_RANGE (wscroll)) != value)
{