aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-04-19 00:10:55 -0700
committerPaul Eggert2011-04-19 00:10:55 -0700
commit6048fb2a5ade88f36ff1e50eb113726c610115d0 (patch)
tree80cd73e7bd3696e26a282b9fe49f8bcfd45bed50 /src
parent6f04d1261b5e973d67dd8f4da9f86559281b67be (diff)
downloademacs-6048fb2a5ade88f36ff1e50eb113726c610115d0.tar.gz
emacs-6048fb2a5ade88f36ff1e50eb113726c610115d0.zip
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/gtkutil.c27
2 files changed, 22 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 1ed289b3964..d1ab9c4961e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
12011-04-19 Paul Eggert <eggert@cs.ucla.edu> 12011-04-19 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
4 (GDK_KEY_g): Don't define if already defined.
5 (xg_prepare_tooltip): Avoid pointer signedness problem.
6 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
7
3 * process.c (Fnetwork_interface_info): Avoid left-shift undefined 8 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
4 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts. 9 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
5 10
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 4b53915c416..9d3bfe6a89c 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -81,8 +81,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
81 gdk_window_get_geometry (w, a, b, c, d, 0) 81 gdk_window_get_geometry (w, a, b, c, d, 0)
82#define gdk_x11_window_lookup_for_display(d, w) \ 82#define gdk_x11_window_lookup_for_display(d, w) \
83 gdk_xid_table_lookup_for_display (d, w) 83 gdk_xid_table_lookup_for_display (d, w)
84#ifndef GDK_KEY_g
84#define GDK_KEY_g GDK_g 85#define GDK_KEY_g GDK_g
85#endif 86#endif
87#endif
86 88
87#define XG_BIN_CHILD(x) gtk_bin_get_child (GTK_BIN (x)) 89#define XG_BIN_CHILD(x) gtk_bin_get_child (GTK_BIN (x))
88 90
@@ -703,7 +705,7 @@ xg_prepare_tooltip (FRAME_PTR f,
703 hierarchy-changed. */ 705 hierarchy-changed. */
704 gtk_tooltip_set_custom (x->ttip_widget, widget); 706 gtk_tooltip_set_custom (x->ttip_widget, widget);
705 707
706 gtk_tooltip_set_text (x->ttip_widget, SDATA (encoded_string)); 708 gtk_tooltip_set_text (x->ttip_widget, SSDATA (encoded_string));
707 gtk_widget_get_preferred_size (GTK_WIDGET (x->ttip_window), NULL, &req); 709 gtk_widget_get_preferred_size (GTK_WIDGET (x->ttip_window), NULL, &req);
708 if (width) *width = req.width; 710 if (width) *width = req.width;
709 if (height) *height = req.height; 711 if (height) *height = req.height;
@@ -3527,6 +3529,7 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar,
3527 gdouble shown; 3529 gdouble shown;
3528 gdouble top; 3530 gdouble top;
3529 int size, value; 3531 int size, value;
3532 int old_size;
3530 int new_step; 3533 int new_step;
3531 int changed = 0; 3534 int changed = 0;
3532 3535
@@ -3559,15 +3562,19 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar,
3559 /* Assume all lines are of equal size. */ 3562 /* Assume all lines are of equal size. */
3560 new_step = size / max (1, FRAME_LINES (f)); 3563 new_step = size / max (1, FRAME_LINES (f));
3561 3564
3562 if ((int) gtk_adjustment_get_page_size (adj) != size 3565 old_size = gtk_adjustment_get_page_size (adj);
3563 || (int) gtk_adjustment_get_step_increment (adj) != new_step) 3566 if (old_size != size)
3564 { 3567 {
3565 gtk_adjustment_set_page_size (adj, size); 3568 int old_step = gtk_adjustment_get_step_increment (adj);
3566 gtk_adjustment_set_step_increment (adj, new_step); 3569 if (old_step != new_step)
3567 /* Assume a page increment is about 95% of the page size */ 3570 {
3568 gtk_adjustment_set_page_increment (adj,(int) (0.95*size)); 3571 gtk_adjustment_set_page_size (adj, size);
3569 changed = 1; 3572 gtk_adjustment_set_step_increment (adj, new_step);
3570 } 3573 /* Assume a page increment is about 95% of the page size */
3574 gtk_adjustment_set_page_increment (adj,(int) (0.95*size));
3575 changed = 1;
3576 }
3577 }
3571 3578
3572 if (changed || int_gtk_range_get_value (GTK_RANGE (wscroll)) != value) 3579 if (changed || int_gtk_range_get_value (GTK_RANGE (wscroll)) != value)
3573 { 3580 {