diff options
| author | Paul Eggert | 2017-05-16 10:24:19 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-05-16 10:27:41 -0700 |
| commit | 2e1bebe279b7108f74c3a1e7e30e8a43c2cfa31f (patch) | |
| tree | 869b2d36a6a07dca857254202d620358c004489f /src/gtkutil.c | |
| parent | 138c8256f41f242341c7d146c99f4e6fa267a638 (diff) | |
| download | emacs-2e1bebe279b7108f74c3a1e7e30e8a43c2cfa31f.tar.gz emacs-2e1bebe279b7108f74c3a1e7e30e8a43c2cfa31f.zip | |
Merge with gnulib, pacifying GCC 7
This incorporates:
2017-05-16 manywarnings: update for GCC 7
2017-05-15 sys_select: Avoid "was expanded before it was required"
* configure.ac (nw): Suppress GCC 7’s new -Wduplicated-branches and
-Wformat-overflow=2 options, due to too many false alarms.
* doc/misc/texinfo.tex, lib/strftime.c, m4/manywarnings.m4:
Copy from gnulib.
* m4/gnulib-comp.m4: Regenerate.
* src/coding.c (decode_coding_iso_2022):
Fix bug uncovered by -Wimplicit-fallthrough.
* src/conf_post.h (FALLTHROUGH): New macro.
Use it to mark all switch cases that fall through.
* src/editfns.c (styled_format): Use !, not ~, on bool.
* src/gtkutil.c (xg_check_special_colors):
When using sprintf, don’t trust Gtk to output colors in [0, 1] range.
(xg_update_scrollbar_pos): Avoid use of possibly-uninitialized bool;
this bug was actually caught by Clang.
* src/search.c (boyer_moore):
Tell GCC that CHAR_BASE, if nonzero, must be a non-ASCII character.
* src/xterm.c (x_draw_glyphless_glyph_string_foreground):
Tell GCC that glyph->u.glyphless.ch must be a character.
Diffstat (limited to 'src/gtkutil.c')
| -rw-r--r-- | src/gtkutil.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c index 1b63293fe55..16eb284d7c7 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -554,10 +554,11 @@ xg_check_special_colors (struct frame *f, | |||
| 554 | else | 554 | else |
| 555 | gtk_style_context_get_background_color (gsty, state, &col); | 555 | gtk_style_context_get_background_color (gsty, state, &col); |
| 556 | 556 | ||
| 557 | sprintf (buf, "rgb:%04x/%04x/%04x", | 557 | unsigned short |
| 558 | (unsigned) (col.red * 65535), | 558 | r = col.red * 65535, |
| 559 | (unsigned) (col.green * 65535), | 559 | g = col.green * 65535, |
| 560 | (unsigned) (col.blue * 65535)); | 560 | b = col.blue * 65535; |
| 561 | sprintf (buf, "rgb:%04x/%04x/%04x", r, g, b); | ||
| 561 | success_p = x_parse_color (f, buf, color) != 0; | 562 | success_p = x_parse_color (f, buf, color) != 0; |
| 562 | #else | 563 | #else |
| 563 | GtkStyle *gsty = gtk_widget_get_style (FRAME_GTK_WIDGET (f)); | 564 | GtkStyle *gsty = gtk_widget_get_style (FRAME_GTK_WIDGET (f)); |
| @@ -3856,7 +3857,6 @@ xg_update_scrollbar_pos (struct frame *f, | |||
| 3856 | GtkWidget *wparent = gtk_widget_get_parent (wscroll); | 3857 | GtkWidget *wparent = gtk_widget_get_parent (wscroll); |
| 3857 | gint msl; | 3858 | gint msl; |
| 3858 | int scale = xg_get_gdk_scale (); | 3859 | int scale = xg_get_gdk_scale (); |
| 3859 | bool hidden; | ||
| 3860 | 3860 | ||
| 3861 | top /= scale; | 3861 | top /= scale; |
| 3862 | left /= scale; | 3862 | left /= scale; |
| @@ -3875,13 +3875,13 @@ xg_update_scrollbar_pos (struct frame *f, | |||
| 3875 | /* Move and resize to new values. */ | 3875 | /* Move and resize to new values. */ |
| 3876 | gtk_fixed_move (GTK_FIXED (wfixed), wparent, left, top); | 3876 | gtk_fixed_move (GTK_FIXED (wfixed), wparent, left, top); |
| 3877 | gtk_widget_style_get (wscroll, "min-slider-length", &msl, NULL); | 3877 | gtk_widget_style_get (wscroll, "min-slider-length", &msl, NULL); |
| 3878 | if (msl > height) | 3878 | bool hidden = height < msl; |
| 3879 | if (hidden) | ||
| 3879 | { | 3880 | { |
| 3880 | /* No room. Hide scroll bar as some themes output a warning if | 3881 | /* No room. Hide scroll bar as some themes output a warning if |
| 3881 | the height is less than the min size. */ | 3882 | the height is less than the min size. */ |
| 3882 | gtk_widget_hide (wparent); | 3883 | gtk_widget_hide (wparent); |
| 3883 | gtk_widget_hide (wscroll); | 3884 | gtk_widget_hide (wscroll); |
| 3884 | hidden = true; | ||
| 3885 | } | 3885 | } |
| 3886 | else | 3886 | else |
| 3887 | { | 3887 | { |