diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2016-06-22 03:04:16 +0200 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2016-06-22 03:05:22 +0200 |
commit | 1c0199050bfa594287f3975aca56fc2a57ba0f66 (patch) | |
tree | 20073a58d1d5874f25875be88b097409de29487a /src/dispextern.h | |
parent | c98bc9821f4a402d5fda67fe141ed34622c50e4f (diff) | |
download | emacs-1c0199050bfa594287f3975aca56fc2a57ba0f66.tar.gz |
Improve --without-x GCC pacification
* src/composite.c (autocmp_chars):
* src/conf_post.h (DebPrint) [HAVE_NTGUI && !DebPrint && !EMACSDEBUG]:
Use simpler ((void) 0) for no-op expression returning void.
* src/dispextern.h [HAVE_WINDOW_SYSTEM]:
Include fontset.h, for face_for_char.
(FACE_SUITABLE_FOR_ASCII_CHAR_P, FACE_FOR_CHAR):
Now inline functions instead of macros. This avoids the need for
all those casts to void.
(FACE_SUITABLE_FOR_ASCII_CHAR_P): Omit 2nd (unused) arg.
All uses changed.
* src/frame.c (Ficonify_frame, Fset_frame_position):
* src/xdisp.c (Fmove_point_visually, show_mouse_face):
* src/xdisp.c (note_mode_line_or_margin_highlight)
(note_mouse_highlight):
Assume HAVE_WINDOW_SYSTEM for simplicity, since the code should
now work either way without generating warnings.
* src/frame.c (display_available) [HAVE_WINDOW_SYSTEM]: New function.
(window_system_available) [HAVE_WINDOW_SYSTEM]: Move to frame.h.
(decode_window_system_frame): Use check_window_system instead of
rolling the code ourself. Return needed only if HAVE_WINDOW_SYSTEM.
(decode_window_system_frame, check_window_system):
Merge the HAVE_WINDOW_SYSTEM and !HAVE_WINDOW_SYSTEM versions into one.
* src/frame.c (Ficonify_frame, Fset_frame_position):
* src/xdisp.c (show_mouse_face, define_frame_cursor1)
(note_mouse_highlight):
Narrow the scope of the HAVE_WINDOW_SYSTEM #ifdef;
this is a better way to pacify GCC.
* src/xdisp.c (x_set_left_fringe, x_set_right_fringe)
(x_set_right_divider_width, x_set_bottom_divider_width):
* src/xfns.c (x_set_internal_border_width):
Don’t use what are now function calls as lvalues.
* src/frame.h (WINDOW_SYSTEM_RETURN): New macro.
(decode_window_system_frame, check_window_system):
Use it, to avoid the need for duplicate declarations.
(window_system_available): Now an inline function.
(display_available): New decl.
(frame_dimension): New inline function.
(FRAME_FRINGE_COLS, FRAME_LEFT_FRINGE_WIDTH)
(FRAME_RIGHT_FRINGE_WIDTH, FRAME_TOTAL_FRINGE_WIDTH)
(FRAME_INTERNAL_BORDER_WIDTH, FRAME_RIGHT_DIVIDER_WIDTH)
(FRAME_BOTTOM_DIVIDER_WIDTH):
Use it, to avoid the need for duplicate definitions.
Now inline functions instead of macros.
* src/gnutls.c (gnutls_log_function2i): Remove.
* src/gnutls.h (GNUTLS_LOG2i): Use ‘message’ directly.
This avoids complaints about gnutls_log_function2i being defined
and not used on older platforms that do not need to call GNUTLS_LOG2i.
* src/image.c (DefaultDepthOfScreen) [0]: Remove unused macro.
* src/lisp.h (AUTO_STRING_WITH_LEN): Revert change from ‘type id =
expr’ to ‘type id; id = expr’, as this would suppress valid
jump-misses-init diagnostics. Let’s find a better way to address
the problem.
* src/vm-limit.c (__MALLOC_HOOK_VOLATILE):
Define only if needed.
* src/xdisp.c (handle_single_display_spec):
Simplify fringe_bitmap computation.
(define_frame_cursor1): Do nothing unless in a window system.
All callers changed and simplified.
* src/xfaces.c (realize_default_face):
Use a simpler way to pacify GCC when a return value is not used
on some platforms.
Diffstat (limited to 'src/dispextern.h')
-rw-r--r-- | src/dispextern.h | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/src/dispextern.h b/src/dispextern.h index 987d7f8b048..d0fc3b24df7 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -82,6 +82,7 @@ typedef XImagePtr XImagePtr_or_DC; #ifdef HAVE_WINDOW_SYSTEM # include <time.h> +# include "fontset.h" #endif #ifndef HAVE_WINDOW_SYSTEM @@ -1825,31 +1826,32 @@ struct face_cache ? FACE_FROM_ID (F, ID) \ : NULL) +/* True if FACE is suitable for displaying ASCII characters. */ +INLINE bool +FACE_SUITABLE_FOR_ASCII_CHAR_P (struct face *face) +{ #ifdef HAVE_WINDOW_SYSTEM - -/* Non-zero if FACE is suitable for displaying character CHAR. */ - -#define FACE_SUITABLE_FOR_ASCII_CHAR_P(FACE, CHAR) \ - ((FACE) == (FACE)->ascii_face) + return face == face->ascii_face; +#else + return true; +#endif +} /* Return the id of the realized face on frame F that is like the face - FACE, but is suitable for displaying character CHAR at buffer or + FACE, but is suitable for displaying character CHARACTER at buffer or string position POS. OBJECT is the string object, or nil for buffer. This macro is only meaningful for multibyte character CHAR. */ - -#define FACE_FOR_CHAR(F, FACE, CHAR, POS, OBJECT) \ - face_for_char ((F), (FACE), (CHAR), (POS), (OBJECT)) - -#else /* not HAVE_WINDOW_SYSTEM */ - -#define FACE_SUITABLE_FOR_ASCII_CHAR_P(FACE, CHAR) \ - ((void) (FACE), (void) (CHAR), true) -#define FACE_FOR_CHAR(F, FACE, CHAR, POS, OBJECT) \ - ((void) (F), (void) (FACE), (void) (CHAR), (void) (POS), \ - (void) (OBJECT), (FACE)->id) - -#endif /* not HAVE_WINDOW_SYSTEM */ +INLINE int +FACE_FOR_CHAR (struct frame *f, struct face *face, int character, + ptrdiff_t pos, Lisp_Object object) +{ +#ifdef HAVE_WINDOW_SYSTEM + return face_for_char (f, face, character, pos, object); +#else + return face->id; +#endif +} /* Return true if G contains a valid character code. */ INLINE bool |