diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2016-05-18 00:06:12 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2016-05-18 00:49:29 -0700 |
commit | 374f6a5f34a83d3e4c518f0726558642293fdd71 (patch) | |
tree | 1b99d7c785c9916322ea03565b846a5056a0d25e /src/dispnew.c | |
parent | 6f5db0255cab2e17ab53ee68f6dc2f4d75978d80 (diff) | |
download | emacs-374f6a5f34a83d3e4c518f0726558642293fdd71.tar.gz |
Port --enable-gcc-warnings to GCC 6.1
* configure.ac (WERROR_CFLAGS): Omit -Wunused-const-variable=2.
* lib-src/etags.c (LOOKING_AT, LOOKING_AT_NOCASE):
Omit test whether pointer plus a constant equals a null pointer.
* src/alloc.c (compact_small_strings):
Avoid pointer arithmetic on null pointers.
* src/alloc.c (mark_face_cache):
* src/fontset.c (free_realized_fontsets, Fset_fontset_font):
* src/fringe.c (draw_fringe_bitmap_1)
(Fset_fringe_bitmap_face):
* src/macfont.m (macfont_draw):
* src/msdos.c (IT_set_face, IT_clear_screen):
* src/nsfont.m (nsfont_draw):
* src/nsterm.h (FRAME_DEFAULT_FACE):
* src/nsterm.m (ns_draw_window_cursor)
(ns_draw_vertical_window_border, ns_draw_window_divider)
(ns_dumpglyphs_box_or_relief)
(ns_maybe_dumpglyphs_background, ns_dumpglyphs_image)
(ns_dumpglyphs_stretch):
* src/w32term.c (w32_draw_vertical_window_border)
(w32_draw_window_divider, x_set_mouse_face_gc):
* src/xdisp.c (estimate_mode_line_height, init_iterator)
(handle_face_prop, handle_single_display_spec, pop_it)
(CHAR_COMPOSED_P, get_next_display_element)
(next_element_from_display_vector, extend_face_to_end_of_line)
(fill_gstring_glyph_string,BUILD_COMPOSITE_GLYPH_STRING):
* src/xfaces.c (Finternal_merge_in_global_face, Fface_font)
(lookup_named_face):
* src/xterm.c (x_draw_vertical_window_border)
(x_draw_window_divider, x_set_mouse_face_gc):
Prefer FACE_OPT_FROM_ID to FACE_FROM_ID when the result might be null.
* src/xterm.c (try_window_id):
Redo loop to convince GCC 6.1 that it is null pointer safe.
(x_color_cells):
Use eassume as necessary to pacify GCC 6.1.
* src/dispextern.h (FACE_FROM_ID, IMAGE_FROM_ID): Now returns non-null.
(FACE_OPT_FROM_ID, IMAGE_OPT_FROM_ID): New macro, with the old
behavior of the non-_OPT macro, to be used when the result
might be a null pointer.
* src/dispnew.c (buffer_posn_from_coords, marginal_area_string)
[HAVE_WINDOW_SYSTEM]:
* src/intervals.h (INTERVAL_WRITABLE_P):
* src/term.c (turn_off_face):
* src/xdisp.c (get_glyph_face_and_encoding, fill_image_glyph_string)
(produce_image_glyph, produce_xwidget_glyph):
* src/xfaces.c (lookup_named_face):
Remove unnecessary test for null pointer.
* src/keyboard.c (read_char): Suppress bogus -Wclobbered warning.
* src/process.c (would_block): New function.
(server_accept_connection, wait_reading_process_output, send_process):
Use it.
* src/xdisp.c (get_window_cursor_type, note_mouse_highlight):
Prefer IMAGE_OPT_FROM_ID to IMAGE_FROM_ID when the result
might be null.
Diffstat (limited to 'src/dispnew.c')
-rw-r--r-- | src/dispnew.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index 51caa5b10e7..4cc908a3c2a 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -5177,8 +5177,8 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p #ifdef HAVE_WINDOW_SYSTEM if (it.what == IT_IMAGE) { - if ((img = IMAGE_FROM_ID (it.f, it.image_id)) != NULL - && !NILP (img->spec)) + img = IMAGE_OPT_FROM_ID (it.f, it.image_id); + if (img && !NILP (img->spec)) *object = img->spec; } #endif @@ -5275,7 +5275,7 @@ mode_line_string (struct window *w, enum window_part part, if (glyph->type == IMAGE_GLYPH) { struct image *img; - img = IMAGE_FROM_ID (WINDOW_XFRAME (w), glyph->u.img_id); + img = IMAGE_OPT_FROM_ID (WINDOW_XFRAME (w), glyph->u.img_id); if (img != NULL) *object = img->spec; y0 -= row->ascent - glyph->ascent; @@ -5362,7 +5362,7 @@ marginal_area_string (struct window *w, enum window_part part, if (glyph->type == IMAGE_GLYPH) { struct image *img; - img = IMAGE_FROM_ID (WINDOW_XFRAME (w), glyph->u.img_id); + img = IMAGE_OPT_FROM_ID (WINDOW_XFRAME (w), glyph->u.img_id); if (img != NULL) *object = img->spec; y0 -= row->ascent - glyph->ascent; |