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/nsterm.m | |
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/nsterm.m')
-rw-r--r-- | src/nsterm.m | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/nsterm.m b/src/nsterm.m index 1d48c041bad..b815d775d76 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -2878,7 +2878,7 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, ns_clip_to_row (w, glyph_row, ANY_AREA, NO); /* do ns_focus(f, &r, 1); if remove */ - face = FACE_FROM_ID (f, phys_cursor_glyph->face_id); + face = FACE_OPT_FROM_ID (f, phys_cursor_glyph->face_id); if (face && NS_FACE_BACKGROUND (face) == ns_index_color (FRAME_CURSOR_COLOR (f), f)) { @@ -2950,7 +2950,7 @@ ns_draw_vertical_window_border (struct window *w, int x, int y0, int y1) NSTRACE ("ns_draw_vertical_window_border"); - face = FACE_FROM_ID (f, VERTICAL_BORDER_FACE_ID); + face = FACE_OPT_FROM_ID (f, VERTICAL_BORDER_FACE_ID); if (face) [ns_lookup_indexed_color(face->foreground, f) set]; @@ -2972,7 +2972,7 @@ ns_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1) NSTRACE ("ns_draw_window_divider"); - face = FACE_FROM_ID (f, WINDOW_DIVIDER_FACE_ID); + face = FACE_OPT_FROM_ID (f, WINDOW_DIVIDER_FACE_ID); if (face) [ns_lookup_indexed_color(face->foreground, f) set]; @@ -3305,9 +3305,9 @@ ns_dumpglyphs_box_or_relief (struct glyph_string *s) if (s->hl == DRAW_MOUSE_FACE) { - face = FACE_FROM_ID (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id); + face = FACE_OPT_FROM_ID (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id); if (!face) - face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); + face = FACE_OPT_FROM_ID (s->f, MOUSE_FACE_ID); } else face = s->face; @@ -3372,8 +3372,9 @@ ns_maybe_dumpglyphs_background (struct glyph_string *s, char force_p) struct face *face; if (s->hl == DRAW_MOUSE_FACE) { - face = FACE_FROM_ID (s->f, - MOUSE_HL_INFO (s->f)->mouse_face_face_id); + face + = FACE_OPT_FROM_ID (s->f, + MOUSE_HL_INFO (s->f)->mouse_face_face_id); if (!face) face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); } @@ -3439,7 +3440,7 @@ ns_dumpglyphs_image (struct glyph_string *s, NSRect r) with its background color), we must clear just the image area. */ if (s->hl == DRAW_MOUSE_FACE) { - face = FACE_FROM_ID (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id); + face = FACE_OPT_FROM_ID (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id); if (!face) face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); } @@ -3556,7 +3557,8 @@ ns_dumpglyphs_stretch (struct glyph_string *s) if (s->hl == DRAW_MOUSE_FACE) { - face = FACE_FROM_ID (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id); + face = FACE_OPT_FROM_ID (s->f, + MOUSE_HL_INFO (s->f)->mouse_face_face_id); if (!face) face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); } |