diff options
| author | Paul Eggert | 2016-06-22 03:04:16 +0200 |
|---|---|---|
| committer | Paul Eggert | 2016-06-22 03:05:22 +0200 |
| commit | 1c0199050bfa594287f3975aca56fc2a57ba0f66 (patch) | |
| tree | 20073a58d1d5874f25875be88b097409de29487a /src | |
| parent | c98bc9821f4a402d5fda67fe141ed34622c50e4f (diff) | |
| download | emacs-1c0199050bfa594287f3975aca56fc2a57ba0f66.tar.gz emacs-1c0199050bfa594287f3975aca56fc2a57ba0f66.zip | |
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')
| -rw-r--r-- | src/composite.c | 6 | ||||
| -rw-r--r-- | src/conf_post.h | 3 | ||||
| -rw-r--r-- | src/dispextern.h | 40 | ||||
| -rw-r--r-- | src/frame.c | 75 | ||||
| -rw-r--r-- | src/frame.h | 96 | ||||
| -rw-r--r-- | src/gnutls.c | 7 | ||||
| -rw-r--r-- | src/gnutls.h | 2 | ||||
| -rw-r--r-- | src/image.c | 3 | ||||
| -rw-r--r-- | src/lisp.h | 4 | ||||
| -rw-r--r-- | src/vm-limit.c | 6 | ||||
| -rw-r--r-- | src/xdisp.c | 78 | ||||
| -rw-r--r-- | src/xfaces.c | 12 | ||||
| -rw-r--r-- | src/xfns.c | 2 |
13 files changed, 148 insertions, 186 deletions
diff --git a/src/composite.c b/src/composite.c index 5696e3ee3a9..8aa69746595 100644 --- a/src/composite.c +++ b/src/composite.c | |||
| @@ -867,11 +867,7 @@ autocmp_chars (Lisp_Object rule, ptrdiff_t charpos, ptrdiff_t bytepos, | |||
| 867 | Lisp_Object string) | 867 | Lisp_Object string) |
| 868 | { | 868 | { |
| 869 | ptrdiff_t count = SPECPDL_INDEX (); | 869 | ptrdiff_t count = SPECPDL_INDEX (); |
| 870 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 871 | struct frame *f = XFRAME (win->frame); | 870 | struct frame *f = XFRAME (win->frame); |
| 872 | #else | ||
| 873 | (void) XFRAME (win->frame); | ||
| 874 | #endif | ||
| 875 | Lisp_Object pos = make_number (charpos); | 871 | Lisp_Object pos = make_number (charpos); |
| 876 | ptrdiff_t to; | 872 | ptrdiff_t to; |
| 877 | ptrdiff_t pt = PT, pt_byte = PT_BYTE; | 873 | ptrdiff_t pt = PT, pt_byte = PT_BYTE; |
| @@ -895,7 +891,6 @@ autocmp_chars (Lisp_Object rule, ptrdiff_t charpos, ptrdiff_t bytepos, | |||
| 895 | if (len <= 0) | 891 | if (len <= 0) |
| 896 | return unbind_to (count, Qnil); | 892 | return unbind_to (count, Qnil); |
| 897 | to = limit = charpos + len; | 893 | to = limit = charpos + len; |
| 898 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 899 | if (FRAME_WINDOW_P (f)) | 894 | if (FRAME_WINDOW_P (f)) |
| 900 | { | 895 | { |
| 901 | font_object = font_range (charpos, bytepos, &to, win, face, string); | 896 | font_object = font_range (charpos, bytepos, &to, win, face, string); |
| @@ -906,7 +901,6 @@ autocmp_chars (Lisp_Object rule, ptrdiff_t charpos, ptrdiff_t bytepos, | |||
| 906 | return unbind_to (count, Qnil); | 901 | return unbind_to (count, Qnil); |
| 907 | } | 902 | } |
| 908 | else | 903 | else |
| 909 | #endif /* not HAVE_WINDOW_SYSTEM */ | ||
| 910 | font_object = win->frame; | 904 | font_object = win->frame; |
| 911 | lgstring = Fcomposition_get_gstring (pos, make_number (to), font_object, | 905 | lgstring = Fcomposition_get_gstring (pos, make_number (to), font_object, |
| 912 | string); | 906 | string); |
diff --git a/src/conf_post.h b/src/conf_post.h index 431b7a9d826..7aa5baeb30e 100644 --- a/src/conf_post.h +++ b/src/conf_post.h | |||
| @@ -211,8 +211,7 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */ | |||
| 211 | extern void _DebPrint (const char *fmt, ...); | 211 | extern void _DebPrint (const char *fmt, ...); |
| 212 | # define DebPrint(stuff) _DebPrint stuff | 212 | # define DebPrint(stuff) _DebPrint stuff |
| 213 | # else | 213 | # else |
| 214 | /* Avoid compiler warnings about empty body of 'if' statement. */ | 214 | # define DebPrint(stuff) ((void) 0) |
| 215 | # define DebPrint(stuff) do {} while (false) | ||
| 216 | # endif | 215 | # endif |
| 217 | #endif | 216 | #endif |
| 218 | 217 | ||
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; | |||
| 82 | 82 | ||
| 83 | #ifdef HAVE_WINDOW_SYSTEM | 83 | #ifdef HAVE_WINDOW_SYSTEM |
| 84 | # include <time.h> | 84 | # include <time.h> |
| 85 | # include "fontset.h" | ||
| 85 | #endif | 86 | #endif |
| 86 | 87 | ||
| 87 | #ifndef HAVE_WINDOW_SYSTEM | 88 | #ifndef HAVE_WINDOW_SYSTEM |
| @@ -1825,31 +1826,32 @@ struct face_cache | |||
| 1825 | ? FACE_FROM_ID (F, ID) \ | 1826 | ? FACE_FROM_ID (F, ID) \ |
| 1826 | : NULL) | 1827 | : NULL) |
| 1827 | 1828 | ||
| 1829 | /* True if FACE is suitable for displaying ASCII characters. */ | ||
| 1830 | INLINE bool | ||
| 1831 | FACE_SUITABLE_FOR_ASCII_CHAR_P (struct face *face) | ||
| 1832 | { | ||
| 1828 | #ifdef HAVE_WINDOW_SYSTEM | 1833 | #ifdef HAVE_WINDOW_SYSTEM |
| 1829 | 1834 | return face == face->ascii_face; | |
| 1830 | /* Non-zero if FACE is suitable for displaying character CHAR. */ | 1835 | #else |
| 1831 | 1836 | return true; | |
| 1832 | #define FACE_SUITABLE_FOR_ASCII_CHAR_P(FACE, CHAR) \ | 1837 | #endif |
| 1833 | ((FACE) == (FACE)->ascii_face) | 1838 | } |
| 1834 | 1839 | ||
| 1835 | /* Return the id of the realized face on frame F that is like the face | 1840 | /* Return the id of the realized face on frame F that is like the face |
| 1836 | FACE, but is suitable for displaying character CHAR at buffer or | 1841 | FACE, but is suitable for displaying character CHARACTER at buffer or |
| 1837 | string position POS. OBJECT is the string object, or nil for | 1842 | string position POS. OBJECT is the string object, or nil for |
| 1838 | buffer. This macro is only meaningful for multibyte character | 1843 | buffer. This macro is only meaningful for multibyte character |
| 1839 | CHAR. */ | 1844 | CHAR. */ |
| 1840 | 1845 | INLINE int | |
| 1841 | #define FACE_FOR_CHAR(F, FACE, CHAR, POS, OBJECT) \ | 1846 | FACE_FOR_CHAR (struct frame *f, struct face *face, int character, |
| 1842 | face_for_char ((F), (FACE), (CHAR), (POS), (OBJECT)) | 1847 | ptrdiff_t pos, Lisp_Object object) |
| 1843 | 1848 | { | |
| 1844 | #else /* not HAVE_WINDOW_SYSTEM */ | 1849 | #ifdef HAVE_WINDOW_SYSTEM |
| 1845 | 1850 | return face_for_char (f, face, character, pos, object); | |
| 1846 | #define FACE_SUITABLE_FOR_ASCII_CHAR_P(FACE, CHAR) \ | 1851 | #else |
| 1847 | ((void) (FACE), (void) (CHAR), true) | 1852 | return face->id; |
| 1848 | #define FACE_FOR_CHAR(F, FACE, CHAR, POS, OBJECT) \ | 1853 | #endif |
| 1849 | ((void) (F), (void) (FACE), (void) (CHAR), (void) (POS), \ | 1854 | } |
| 1850 | (void) (OBJECT), (FACE)->id) | ||
| 1851 | |||
| 1852 | #endif /* not HAVE_WINDOW_SYSTEM */ | ||
| 1853 | 1855 | ||
| 1854 | /* Return true if G contains a valid character code. */ | 1856 | /* Return true if G contains a valid character code. */ |
| 1855 | INLINE bool | 1857 | INLINE bool |
diff --git a/src/frame.c b/src/frame.c index 9048452381c..aa06a381108 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -106,39 +106,32 @@ decode_any_frame (register Lisp_Object frame) | |||
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | #ifdef HAVE_WINDOW_SYSTEM | 108 | #ifdef HAVE_WINDOW_SYSTEM |
| 109 | |||
| 110 | bool | 109 | bool |
| 111 | window_system_available (struct frame *f) | 110 | display_available (void) |
| 112 | { | 111 | { |
| 113 | return f ? FRAME_WINDOW_P (f) || FRAME_MSDOS_P (f) : x_display_list != NULL; | 112 | return x_display_list != NULL; |
| 114 | } | 113 | } |
| 114 | #endif | ||
| 115 | 115 | ||
| 116 | struct frame * | 116 | struct frame * |
| 117 | decode_window_system_frame (Lisp_Object frame) | 117 | decode_window_system_frame (Lisp_Object frame) |
| 118 | { | 118 | { |
| 119 | struct frame *f = decode_live_frame (frame); | 119 | struct frame *f = decode_live_frame (frame); |
| 120 | 120 | check_window_system (f); | |
| 121 | if (!window_system_available (f)) | 121 | #ifdef HAVE_WINDOW_SYSTEM |
| 122 | error ("Window system frame should be used"); | ||
| 123 | return f; | 122 | return f; |
| 123 | #endif | ||
| 124 | } | 124 | } |
| 125 | 125 | ||
| 126 | #else /* not HAVE_WINDOW_SYSTEM */ | ||
| 127 | |||
| 128 | _Noreturn void | ||
| 129 | decode_window_system_frame (Lisp_Object frame) | ||
| 130 | { | ||
| 131 | error ("Window system is not in use"); | ||
| 132 | } | ||
| 133 | |||
| 134 | _Noreturn | ||
| 135 | #endif /* not HAVE_WINDOW_SYSTEM */ | ||
| 136 | void | 126 | void |
| 137 | check_window_system (struct frame *f) | 127 | check_window_system (struct frame *f) |
| 138 | { | 128 | { |
| 139 | if (!window_system_available (f)) | 129 | #ifdef HAVE_WINDOW_SYSTEM |
| 140 | error (f ? "Window system frame should be used" | 130 | if (window_system_available (f)) |
| 141 | : "Window system is not in use or not initialized"); | 131 | return; |
| 132 | #endif | ||
| 133 | error (f ? "Window system frame should be used" | ||
| 134 | : "Window system is not in use or not initialized"); | ||
| 142 | } | 135 | } |
| 143 | 136 | ||
| 144 | /* Return the value of frame parameter PROP in frame FRAME. */ | 137 | /* Return the value of frame parameter PROP in frame FRAME. */ |
| @@ -2137,20 +2130,18 @@ DEFUN ("iconify-frame", Ficonify_frame, Siconify_frame, | |||
| 2137 | If omitted, FRAME defaults to the currently selected frame. */) | 2130 | If omitted, FRAME defaults to the currently selected frame. */) |
| 2138 | (Lisp_Object frame) | 2131 | (Lisp_Object frame) |
| 2139 | { | 2132 | { |
| 2140 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 2141 | struct frame *f = decode_live_frame (frame); | 2133 | struct frame *f = decode_live_frame (frame); |
| 2142 | #else | ||
| 2143 | (void) decode_live_frame (frame); | ||
| 2144 | #endif | ||
| 2145 | 2134 | ||
| 2146 | /* Don't allow minibuf_window to remain on an iconified frame. */ | 2135 | /* Don't allow minibuf_window to remain on an iconified frame. */ |
| 2147 | check_minibuf_window (frame, EQ (minibuf_window, selected_window)); | 2136 | check_minibuf_window (frame, EQ (minibuf_window, selected_window)); |
| 2148 | 2137 | ||
| 2149 | /* I think this should be done with a hook. */ | 2138 | /* I think this should be done with a hook. */ |
| 2150 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 2151 | if (FRAME_WINDOW_P (f)) | 2139 | if (FRAME_WINDOW_P (f)) |
| 2140 | { | ||
| 2141 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 2152 | x_iconify_frame (f); | 2142 | x_iconify_frame (f); |
| 2153 | #endif | 2143 | #endif |
| 2144 | } | ||
| 2154 | 2145 | ||
| 2155 | /* Make menu bar update for the Buffers and Frames menus. */ | 2146 | /* Make menu bar update for the Buffers and Frames menus. */ |
| 2156 | windows_or_buffers_changed = 17; | 2147 | windows_or_buffers_changed = 17; |
| @@ -3013,20 +3004,18 @@ or bottom edge of the outer frame of FRAME relative to the right or | |||
| 3013 | bottom edge of FRAME's display. */) | 3004 | bottom edge of FRAME's display. */) |
| 3014 | (Lisp_Object frame, Lisp_Object x, Lisp_Object y) | 3005 | (Lisp_Object frame, Lisp_Object x, Lisp_Object y) |
| 3015 | { | 3006 | { |
| 3016 | #ifdef HAVE_WINDOW_SYSTEM | 3007 | struct frame *f = decode_live_frame (frame); |
| 3017 | register struct frame *f = decode_live_frame (frame); | ||
| 3018 | #else | ||
| 3019 | (void) decode_live_frame (frame); | ||
| 3020 | #endif | ||
| 3021 | 3008 | ||
| 3022 | CHECK_TYPE_RANGED_INTEGER (int, x); | 3009 | CHECK_TYPE_RANGED_INTEGER (int, x); |
| 3023 | CHECK_TYPE_RANGED_INTEGER (int, y); | 3010 | CHECK_TYPE_RANGED_INTEGER (int, y); |
| 3024 | 3011 | ||
| 3025 | /* I think this should be done with a hook. */ | 3012 | /* I think this should be done with a hook. */ |
| 3026 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 3027 | if (FRAME_WINDOW_P (f)) | 3013 | if (FRAME_WINDOW_P (f)) |
| 3028 | x_set_offset (f, XINT (x), XINT (y), 1); | 3014 | { |
| 3015 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 3016 | x_set_offset (f, XINT (x), XINT (y), 1); | ||
| 3029 | #endif | 3017 | #endif |
| 3018 | } | ||
| 3030 | 3019 | ||
| 3031 | return Qt; | 3020 | return Qt; |
| 3032 | } | 3021 | } |
| @@ -3755,8 +3744,8 @@ x_set_left_fringe (struct frame *f, Lisp_Object new_value, Lisp_Object old_value | |||
| 3755 | 3744 | ||
| 3756 | if (new_width != old_width) | 3745 | if (new_width != old_width) |
| 3757 | { | 3746 | { |
| 3758 | FRAME_LEFT_FRINGE_WIDTH (f) = new_width; | 3747 | f->left_fringe_width = new_width; |
| 3759 | FRAME_FRINGE_COLS (f) /* Round up. */ | 3748 | f->fringe_cols /* Round up. */ |
| 3760 | = (new_width + FRAME_RIGHT_FRINGE_WIDTH (f) + unit - 1) / unit; | 3749 | = (new_width + FRAME_RIGHT_FRINGE_WIDTH (f) + unit - 1) / unit; |
| 3761 | 3750 | ||
| 3762 | if (FRAME_X_WINDOW (f) != 0) | 3751 | if (FRAME_X_WINDOW (f) != 0) |
| @@ -3779,8 +3768,8 @@ x_set_right_fringe (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu | |||
| 3779 | 3768 | ||
| 3780 | if (new_width != old_width) | 3769 | if (new_width != old_width) |
| 3781 | { | 3770 | { |
| 3782 | FRAME_RIGHT_FRINGE_WIDTH (f) = new_width; | 3771 | f->right_fringe_width = new_width; |
| 3783 | FRAME_FRINGE_COLS (f) /* Round up. */ | 3772 | f->fringe_cols /* Round up. */ |
| 3784 | = (new_width + FRAME_LEFT_FRINGE_WIDTH (f) + unit - 1) / unit; | 3773 | = (new_width + FRAME_LEFT_FRINGE_WIDTH (f) + unit - 1) / unit; |
| 3785 | 3774 | ||
| 3786 | if (FRAME_X_WINDOW (f) != 0) | 3775 | if (FRAME_X_WINDOW (f) != 0) |
| @@ -3809,13 +3798,11 @@ void | |||
| 3809 | x_set_right_divider_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval) | 3798 | x_set_right_divider_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval) |
| 3810 | { | 3799 | { |
| 3811 | int old = FRAME_RIGHT_DIVIDER_WIDTH (f); | 3800 | int old = FRAME_RIGHT_DIVIDER_WIDTH (f); |
| 3812 | |||
| 3813 | CHECK_TYPE_RANGED_INTEGER (int, arg); | 3801 | CHECK_TYPE_RANGED_INTEGER (int, arg); |
| 3814 | FRAME_RIGHT_DIVIDER_WIDTH (f) = XINT (arg); | 3802 | int new = max (0, XINT (arg)); |
| 3815 | if (FRAME_RIGHT_DIVIDER_WIDTH (f) < 0) | 3803 | if (new != old) |
| 3816 | FRAME_RIGHT_DIVIDER_WIDTH (f) = 0; | ||
| 3817 | if (FRAME_RIGHT_DIVIDER_WIDTH (f) != old) | ||
| 3818 | { | 3804 | { |
| 3805 | f->right_divider_width = new; | ||
| 3819 | adjust_frame_size (f, -1, -1, 4, 0, Qright_divider_width); | 3806 | adjust_frame_size (f, -1, -1, 4, 0, Qright_divider_width); |
| 3820 | adjust_frame_glyphs (f); | 3807 | adjust_frame_glyphs (f); |
| 3821 | SET_FRAME_GARBAGED (f); | 3808 | SET_FRAME_GARBAGED (f); |
| @@ -3827,13 +3814,11 @@ void | |||
| 3827 | x_set_bottom_divider_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval) | 3814 | x_set_bottom_divider_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval) |
| 3828 | { | 3815 | { |
| 3829 | int old = FRAME_BOTTOM_DIVIDER_WIDTH (f); | 3816 | int old = FRAME_BOTTOM_DIVIDER_WIDTH (f); |
| 3830 | |||
| 3831 | CHECK_TYPE_RANGED_INTEGER (int, arg); | 3817 | CHECK_TYPE_RANGED_INTEGER (int, arg); |
| 3832 | FRAME_BOTTOM_DIVIDER_WIDTH (f) = XINT (arg); | 3818 | int new = max (0, XINT (arg)); |
| 3833 | if (FRAME_BOTTOM_DIVIDER_WIDTH (f) < 0) | 3819 | if (new != old) |
| 3834 | FRAME_BOTTOM_DIVIDER_WIDTH (f) = 0; | ||
| 3835 | if (FRAME_BOTTOM_DIVIDER_WIDTH (f) != old) | ||
| 3836 | { | 3820 | { |
| 3821 | f->bottom_divider_width = new; | ||
| 3837 | adjust_frame_size (f, -1, -1, 4, 0, Qbottom_divider_width); | 3822 | adjust_frame_size (f, -1, -1, 4, 0, Qbottom_divider_width); |
| 3838 | adjust_frame_glyphs (f); | 3823 | adjust_frame_glyphs (f); |
| 3839 | SET_FRAME_GARBAGED (f); | 3824 | SET_FRAME_GARBAGED (f); |
diff --git a/src/frame.h b/src/frame.h index 4ee0a7411f9..5e3ee68942a 100644 --- a/src/frame.h +++ b/src/frame.h | |||
| @@ -1102,23 +1102,37 @@ extern Lisp_Object selected_frame; | |||
| 1102 | extern int frame_default_tool_bar_height; | 1102 | extern int frame_default_tool_bar_height; |
| 1103 | #endif | 1103 | #endif |
| 1104 | 1104 | ||
| 1105 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 1106 | # define WINDOW_SYSTEM_RETURN | ||
| 1107 | #else | ||
| 1108 | # define WINDOW_SYSTEM_RETURN _Noreturn | ||
| 1109 | #endif | ||
| 1110 | |||
| 1111 | extern WINDOW_SYSTEM_RETURN struct frame * | ||
| 1112 | decode_window_system_frame (Lisp_Object); | ||
| 1105 | extern struct frame *decode_live_frame (Lisp_Object); | 1113 | extern struct frame *decode_live_frame (Lisp_Object); |
| 1106 | extern struct frame *decode_any_frame (Lisp_Object); | 1114 | extern struct frame *decode_any_frame (Lisp_Object); |
| 1107 | extern struct frame *make_initial_frame (void); | 1115 | extern struct frame *make_initial_frame (void); |
| 1108 | extern struct frame *make_frame (bool); | 1116 | extern struct frame *make_frame (bool); |
| 1109 | #ifdef HAVE_WINDOW_SYSTEM | 1117 | #ifdef HAVE_WINDOW_SYSTEM |
| 1110 | extern void check_window_system (struct frame *); | ||
| 1111 | extern struct frame *decode_window_system_frame (Lisp_Object); | ||
| 1112 | extern struct frame *make_minibuffer_frame (void); | 1118 | extern struct frame *make_minibuffer_frame (void); |
| 1113 | extern struct frame *make_frame_without_minibuffer (Lisp_Object, | 1119 | extern struct frame *make_frame_without_minibuffer (Lisp_Object, |
| 1114 | struct kboard *, | 1120 | struct kboard *, |
| 1115 | Lisp_Object); | 1121 | Lisp_Object); |
| 1116 | extern bool window_system_available (struct frame *); | 1122 | extern bool display_available (void); |
| 1117 | #else /* not HAVE_WINDOW_SYSTEM */ | 1123 | #endif |
| 1118 | extern _Noreturn void check_window_system (struct frame *); | 1124 | |
| 1119 | extern _Noreturn void decode_window_system_frame (Lisp_Object); | 1125 | INLINE bool |
| 1120 | #define window_system_available(f) ((void) (f), false) | 1126 | window_system_available (struct frame *f) |
| 1121 | #endif /* HAVE_WINDOW_SYSTEM */ | 1127 | { |
| 1128 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 1129 | return f ? FRAME_WINDOW_P (f) || FRAME_MSDOS_P (f) : display_available (); | ||
| 1130 | #else | ||
| 1131 | return false; | ||
| 1132 | #endif | ||
| 1133 | } | ||
| 1134 | |||
| 1135 | extern WINDOW_SYSTEM_RETURN void check_window_system (struct frame *); | ||
| 1122 | extern void frame_make_pointer_invisible (struct frame *); | 1136 | extern void frame_make_pointer_invisible (struct frame *); |
| 1123 | extern void frame_make_pointer_visible (struct frame *); | 1137 | extern void frame_make_pointer_visible (struct frame *); |
| 1124 | extern Lisp_Object delete_frame (Lisp_Object, Lisp_Object); | 1138 | extern Lisp_Object delete_frame (Lisp_Object, Lisp_Object); |
| @@ -1152,46 +1166,68 @@ extern Lisp_Object Vframe_list; | |||
| 1152 | This value currently equals the average width of the default font of F. */ | 1166 | This value currently equals the average width of the default font of F. */ |
| 1153 | #define FRAME_COLUMN_WIDTH(F) ((F)->column_width) | 1167 | #define FRAME_COLUMN_WIDTH(F) ((F)->column_width) |
| 1154 | 1168 | ||
| 1155 | /* Pixel width of areas used to display truncation marks, continuation | 1169 | /* Get a frame's window system dimension. If no window system, this is 0. */ |
| 1156 | marks, overlay arrows. This is 0 for terminal frames. */ | ||
| 1157 | 1170 | ||
| 1171 | INLINE int | ||
| 1172 | frame_dimension (int x) | ||
| 1173 | { | ||
| 1158 | #ifdef HAVE_WINDOW_SYSTEM | 1174 | #ifdef HAVE_WINDOW_SYSTEM |
| 1175 | return x; | ||
| 1176 | #else | ||
| 1177 | return 0; | ||
| 1178 | #endif | ||
| 1179 | } | ||
| 1159 | 1180 | ||
| 1160 | /* Total width of fringes reserved for drawing truncation bitmaps, | 1181 | /* Total width of fringes reserved for drawing truncation bitmaps, |
| 1161 | continuation bitmaps and alike. The width is in canonical char | 1182 | continuation bitmaps and alike. The width is in canonical char |
| 1162 | units of the frame. This must currently be the case because window | 1183 | units of the frame. This must currently be the case because window |
| 1163 | sizes aren't pixel values. If it weren't the case, we wouldn't be | 1184 | sizes aren't pixel values. If it weren't the case, we wouldn't be |
| 1164 | able to split windows horizontally nicely. */ | 1185 | able to split windows horizontally nicely. */ |
| 1165 | #define FRAME_FRINGE_COLS(F) ((F)->fringe_cols) | 1186 | INLINE int |
| 1187 | FRAME_FRINGE_COLS (struct frame *f) | ||
| 1188 | { | ||
| 1189 | return frame_dimension (f->fringe_cols); | ||
| 1190 | } | ||
| 1166 | 1191 | ||
| 1167 | /* Pixel-width of the left and right fringe. */ | 1192 | /* Pixel-width of the left and right fringe. */ |
| 1168 | 1193 | ||
| 1169 | #define FRAME_LEFT_FRINGE_WIDTH(F) ((F)->left_fringe_width) | 1194 | INLINE int |
| 1170 | #define FRAME_RIGHT_FRINGE_WIDTH(F) ((F)->right_fringe_width) | 1195 | FRAME_LEFT_FRINGE_WIDTH (struct frame *f) |
| 1196 | { | ||
| 1197 | return frame_dimension (f->left_fringe_width); | ||
| 1198 | } | ||
| 1199 | INLINE int | ||
| 1200 | FRAME_RIGHT_FRINGE_WIDTH (struct frame *f) | ||
| 1201 | { | ||
| 1202 | return frame_dimension (f->right_fringe_width); | ||
| 1203 | } | ||
| 1171 | 1204 | ||
| 1172 | /* Total width of fringes in pixels. */ | 1205 | /* Total width of fringes in pixels. */ |
| 1173 | 1206 | ||
| 1174 | #define FRAME_TOTAL_FRINGE_WIDTH(F) \ | 1207 | INLINE int |
| 1175 | (FRAME_LEFT_FRINGE_WIDTH (F) + FRAME_RIGHT_FRINGE_WIDTH (F)) | 1208 | FRAME_TOTAL_FRINGE_WIDTH (struct frame *f) |
| 1209 | { | ||
| 1210 | return FRAME_LEFT_FRINGE_WIDTH (f) + FRAME_RIGHT_FRINGE_WIDTH (f); | ||
| 1211 | } | ||
| 1176 | 1212 | ||
| 1177 | /* Pixel-width of internal border lines */ | 1213 | /* Pixel-width of internal border lines */ |
| 1178 | #define FRAME_INTERNAL_BORDER_WIDTH(F) ((F)->internal_border_width) | 1214 | INLINE int |
| 1215 | FRAME_INTERNAL_BORDER_WIDTH (struct frame *f) | ||
| 1216 | { | ||
| 1217 | return frame_dimension (f->internal_border_width); | ||
| 1218 | } | ||
| 1179 | 1219 | ||
| 1180 | /* Pixel-size of window border lines */ | 1220 | /* Pixel-size of window border lines */ |
| 1181 | #define FRAME_RIGHT_DIVIDER_WIDTH(F) ((F)->right_divider_width) | 1221 | INLINE int |
| 1182 | #define FRAME_BOTTOM_DIVIDER_WIDTH(F) ((F)->bottom_divider_width) | 1222 | FRAME_RIGHT_DIVIDER_WIDTH (struct frame *f) |
| 1183 | 1223 | { | |
| 1184 | #else /* not HAVE_WINDOW_SYSTEM */ | 1224 | return frame_dimension (f->right_divider_width); |
| 1185 | 1225 | } | |
| 1186 | #define FRAME_FRINGE_COLS(F) ((void) (F), 0) | 1226 | INLINE int |
| 1187 | #define FRAME_TOTAL_FRINGE_WIDTH(F) ((void) (F), 0) | 1227 | FRAME_BOTTOM_DIVIDER_WIDTH (struct frame *f) |
| 1188 | #define FRAME_LEFT_FRINGE_WIDTH(F) ((void) (F), 0) | 1228 | { |
| 1189 | #define FRAME_RIGHT_FRINGE_WIDTH(F) ((void) (F), 0) | 1229 | return frame_dimension (f->bottom_divider_width); |
| 1190 | #define FRAME_INTERNAL_BORDER_WIDTH(F) ((void) (F), 0) | 1230 | } |
| 1191 | #define FRAME_RIGHT_DIVIDER_WIDTH(F) ((void) (F), 0) | ||
| 1192 | #define FRAME_BOTTOM_DIVIDER_WIDTH(F) ((void) (F), 0) | ||
| 1193 | |||
| 1194 | #endif /* not HAVE_WINDOW_SYSTEM */ | ||
| 1195 | 1231 | ||
| 1196 | /*********************************************************************** | 1232 | /*********************************************************************** |
| 1197 | Conversion between canonical units and pixels | 1233 | Conversion between canonical units and pixels |
diff --git a/src/gnutls.c b/src/gnutls.c index 8ee066f46b5..7f05ac4bc47 100644 --- a/src/gnutls.c +++ b/src/gnutls.c | |||
| @@ -383,13 +383,6 @@ gnutls_log_function2 (int level, const char *string, const char *extra) | |||
| 383 | message ("gnutls.c: [%d] %s %s", level, string, extra); | 383 | message ("gnutls.c: [%d] %s %s", level, string, extra); |
| 384 | } | 384 | } |
| 385 | 385 | ||
| 386 | /* Log a message and an integer. */ | ||
| 387 | static void | ||
| 388 | gnutls_log_function2i (int level, const char *string, int extra) | ||
| 389 | { | ||
| 390 | message ("gnutls.c: [%d] %s %d", level, string, extra); | ||
| 391 | } | ||
| 392 | |||
| 393 | int | 386 | int |
| 394 | gnutls_try_handshake (struct Lisp_Process *proc) | 387 | gnutls_try_handshake (struct Lisp_Process *proc) |
| 395 | { | 388 | { |
diff --git a/src/gnutls.h b/src/gnutls.h index 47e11f2905f..41769a47f54 100644 --- a/src/gnutls.h +++ b/src/gnutls.h | |||
| @@ -71,7 +71,7 @@ typedef enum | |||
| 71 | #define GNUTLS_LOG2i(level, max, string, extra) \ | 71 | #define GNUTLS_LOG2i(level, max, string, extra) \ |
| 72 | do { \ | 72 | do { \ |
| 73 | if ((level) <= (max)) \ | 73 | if ((level) <= (max)) \ |
| 74 | gnutls_log_function2i (level, "(Emacs) " string, extra); \ | 74 | message ("gnutls.c: [%d] %s %d", level, string, extra); \ |
| 75 | } while (false) | 75 | } while (false) |
| 76 | 76 | ||
| 77 | extern ptrdiff_t | 77 | extern ptrdiff_t |
diff --git a/src/image.c b/src/image.c index 0df415c37c9..572557dd264 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -80,9 +80,6 @@ typedef struct w32_bitmap_record Bitmap_Record; | |||
| 80 | #define PIX_MASK_DRAW 1 | 80 | #define PIX_MASK_DRAW 1 |
| 81 | 81 | ||
| 82 | #define x_defined_color w32_defined_color | 82 | #define x_defined_color w32_defined_color |
| 83 | #if 0 /* unused */ | ||
| 84 | #define DefaultDepthOfScreen(screen) (one_w32_display_info.n_cbits) | ||
| 85 | #endif | ||
| 86 | 83 | ||
| 87 | #endif /* HAVE_NTGUI */ | 84 | #endif /* HAVE_NTGUI */ |
| 88 | 85 | ||
diff --git a/src/lisp.h b/src/lisp.h index 6a8f829546e..e0eb52a84ea 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -4634,10 +4634,8 @@ enum | |||
| 4634 | STR's value is not necessarily copied. The resulting Lisp string | 4634 | STR's value is not necessarily copied. The resulting Lisp string |
| 4635 | should not be modified or made visible to user code. */ | 4635 | should not be modified or made visible to user code. */ |
| 4636 | 4636 | ||
| 4637 | /* Avoid initializing NAME to prevent "jump-misses-init" compiler | ||
| 4638 | warnings. */ | ||
| 4639 | #define AUTO_STRING_WITH_LEN(name, str, len) \ | 4637 | #define AUTO_STRING_WITH_LEN(name, str, len) \ |
| 4640 | Lisp_Object name; name = \ | 4638 | Lisp_Object name = \ |
| 4641 | (USE_STACK_STRING \ | 4639 | (USE_STACK_STRING \ |
| 4642 | ? (make_lisp_ptr \ | 4640 | ? (make_lisp_ptr \ |
| 4643 | ((&(union Aligned_String) \ | 4641 | ((&(union Aligned_String) \ |
diff --git a/src/vm-limit.c b/src/vm-limit.c index 7eeca3c8250..58e7729186c 100644 --- a/src/vm-limit.c +++ b/src/vm-limit.c | |||
| @@ -54,10 +54,10 @@ char data_start[1] = { 1 }; | |||
| 54 | #ifdef HAVE_MALLOC_H | 54 | #ifdef HAVE_MALLOC_H |
| 55 | # include <malloc.h> | 55 | # include <malloc.h> |
| 56 | #endif | 56 | #endif |
| 57 | #ifndef __MALLOC_HOOK_VOLATILE | ||
| 58 | # define __MALLOC_HOOK_VOLATILE volatile | ||
| 59 | #endif | ||
| 60 | #ifndef HAVE_MALLOC_H | 57 | #ifndef HAVE_MALLOC_H |
| 58 | # ifndef __MALLOC_HOOK_VOLATILE | ||
| 59 | # define __MALLOC_HOOK_VOLATILE volatile | ||
| 60 | # endif | ||
| 61 | extern void *(*__morecore) (ptrdiff_t); | 61 | extern void *(*__morecore) (ptrdiff_t); |
| 62 | extern void (*__MALLOC_HOOK_VOLATILE __after_morecore_hook) (void); | 62 | extern void (*__MALLOC_HOOK_VOLATILE __after_morecore_hook) (void); |
| 63 | #endif | 63 | #endif |
diff --git a/src/xdisp.c b/src/xdisp.c index da0e84f0043..9df73f2d833 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -5040,11 +5040,9 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object, | |||
| 5040 | return 1; | 5040 | return 1; |
| 5041 | 5041 | ||
| 5042 | #ifdef HAVE_WINDOW_SYSTEM | 5042 | #ifdef HAVE_WINDOW_SYSTEM |
| 5043 | int fringe_bitmap; | ||
| 5044 | |||
| 5045 | value = XCAR (XCDR (spec)); | 5043 | value = XCAR (XCDR (spec)); |
| 5046 | if (!SYMBOLP (value) | 5044 | int fringe_bitmap = SYMBOLP (value) ? lookup_fringe_bitmap (value) : 0; |
| 5047 | || !(fringe_bitmap = lookup_fringe_bitmap (value))) | 5045 | if (! fringe_bitmap) |
| 5048 | /* If we return here, POSITION has been advanced | 5046 | /* If we return here, POSITION has been advanced |
| 5049 | across the text with this property. */ | 5047 | across the text with this property. */ |
| 5050 | { | 5048 | { |
| @@ -21691,9 +21689,7 @@ Value is the new character position of point. */) | |||
| 21691 | int pt_x, target_x, pixel_width, pt_vpos; | 21689 | int pt_x, target_x, pixel_width, pt_vpos; |
| 21692 | bool at_eol_p; | 21690 | bool at_eol_p; |
| 21693 | bool overshoot_expected = false; | 21691 | bool overshoot_expected = false; |
| 21694 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 21695 | bool target_is_eol_p = false; | 21692 | bool target_is_eol_p = false; |
| 21696 | #endif | ||
| 21697 | 21693 | ||
| 21698 | /* Setup the arena. */ | 21694 | /* Setup the arena. */ |
| 21699 | SET_TEXT_POS (pt, PT, PT_BYTE); | 21695 | SET_TEXT_POS (pt, PT, PT_BYTE); |
| @@ -21808,9 +21804,7 @@ Value is the new character position of point. */) | |||
| 21808 | { | 21804 | { |
| 21809 | move_it_by_lines (&it, -1); | 21805 | move_it_by_lines (&it, -1); |
| 21810 | target_x = it.last_visible_x - !FRAME_WINDOW_P (it.f); | 21806 | target_x = it.last_visible_x - !FRAME_WINDOW_P (it.f); |
| 21811 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 21812 | target_is_eol_p = true; | 21807 | target_is_eol_p = true; |
| 21813 | #endif | ||
| 21814 | /* Under word-wrap, we don't know the x coordinate of | 21808 | /* Under word-wrap, we don't know the x coordinate of |
| 21815 | the last character displayed on the previous line, | 21809 | the last character displayed on the previous line, |
| 21816 | which immediately precedes the wrap point. To find | 21810 | which immediately precedes the wrap point. To find |
| @@ -21851,7 +21845,6 @@ Value is the new character position of point. */) | |||
| 21851 | } | 21845 | } |
| 21852 | 21846 | ||
| 21853 | /* Move to the target X coordinate. */ | 21847 | /* Move to the target X coordinate. */ |
| 21854 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 21855 | /* On GUI frames, as we don't know the X coordinate of the | 21848 | /* On GUI frames, as we don't know the X coordinate of the |
| 21856 | character to the left of point, moving point to the left | 21849 | character to the left of point, moving point to the left |
| 21857 | requires walking, one grapheme cluster at a time, until we | 21850 | requires walking, one grapheme cluster at a time, until we |
| @@ -21908,9 +21901,7 @@ Value is the new character position of point. */) | |||
| 21908 | new_pos.bytepos = CHAR_TO_BYTE (new_pos.charpos); | 21901 | new_pos.bytepos = CHAR_TO_BYTE (new_pos.charpos); |
| 21909 | it.current.pos = new_pos; | 21902 | it.current.pos = new_pos; |
| 21910 | } | 21903 | } |
| 21911 | else | 21904 | else if (it.current_x != target_x) |
| 21912 | #endif | ||
| 21913 | if (it.current_x != target_x) | ||
| 21914 | move_it_in_display_line_to (&it, ZV, target_x, MOVE_TO_POS | MOVE_TO_X); | 21905 | move_it_in_display_line_to (&it, ZV, target_x, MOVE_TO_POS | MOVE_TO_X); |
| 21915 | 21906 | ||
| 21916 | /* If we ended up in a display string that covers point, move to | 21907 | /* If we ended up in a display string that covers point, move to |
| @@ -28602,11 +28593,7 @@ static void | |||
| 28602 | show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw) | 28593 | show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw) |
| 28603 | { | 28594 | { |
| 28604 | struct window *w = XWINDOW (hlinfo->mouse_face_window); | 28595 | struct window *w = XWINDOW (hlinfo->mouse_face_window); |
| 28605 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 28606 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 28596 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 28607 | #else | ||
| 28608 | (void) XFRAME (WINDOW_FRAME (w)); | ||
| 28609 | #endif | ||
| 28610 | 28597 | ||
| 28611 | if (/* If window is in the process of being destroyed, don't bother | 28598 | if (/* If window is in the process of being destroyed, don't bother |
| 28612 | to do anything. */ | 28599 | to do anything. */ |
| @@ -28617,9 +28604,7 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw) | |||
| 28617 | anymore. This can happen when a window is split. */ | 28604 | anymore. This can happen when a window is split. */ |
| 28618 | && hlinfo->mouse_face_end_row < w->current_matrix->nrows) | 28605 | && hlinfo->mouse_face_end_row < w->current_matrix->nrows) |
| 28619 | { | 28606 | { |
| 28620 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 28621 | bool phys_cursor_on_p = w->phys_cursor_on_p; | 28607 | bool phys_cursor_on_p = w->phys_cursor_on_p; |
| 28622 | #endif | ||
| 28623 | struct glyph_row *row, *first, *last; | 28608 | struct glyph_row *row, *first, *last; |
| 28624 | 28609 | ||
| 28625 | first = MATRIX_ROW (w->current_matrix, hlinfo->mouse_face_beg_row); | 28610 | first = MATRIX_ROW (w->current_matrix, hlinfo->mouse_face_beg_row); |
| @@ -28695,12 +28680,12 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw) | |||
| 28695 | } | 28680 | } |
| 28696 | } | 28681 | } |
| 28697 | 28682 | ||
| 28698 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 28699 | /* When we've written over the cursor, arrange for it to | 28683 | /* When we've written over the cursor, arrange for it to |
| 28700 | be displayed again. */ | 28684 | be displayed again. */ |
| 28701 | if (FRAME_WINDOW_P (f) | 28685 | if (FRAME_WINDOW_P (f) |
| 28702 | && phys_cursor_on_p && !w->phys_cursor_on_p) | 28686 | && phys_cursor_on_p && !w->phys_cursor_on_p) |
| 28703 | { | 28687 | { |
| 28688 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 28704 | int hpos = w->phys_cursor.hpos; | 28689 | int hpos = w->phys_cursor.hpos; |
| 28705 | 28690 | ||
| 28706 | /* When the window is hscrolled, cursor hpos can legitimately be | 28691 | /* When the window is hscrolled, cursor hpos can legitimately be |
| @@ -28715,8 +28700,8 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw) | |||
| 28715 | display_and_set_cursor (w, true, hpos, w->phys_cursor.vpos, | 28700 | display_and_set_cursor (w, true, hpos, w->phys_cursor.vpos, |
| 28716 | w->phys_cursor.x, w->phys_cursor.y); | 28701 | w->phys_cursor.x, w->phys_cursor.y); |
| 28717 | unblock_input (); | 28702 | unblock_input (); |
| 28718 | } | ||
| 28719 | #endif /* HAVE_WINDOW_SYSTEM */ | 28703 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 28704 | } | ||
| 28720 | } | 28705 | } |
| 28721 | 28706 | ||
| 28722 | #ifdef HAVE_WINDOW_SYSTEM | 28707 | #ifdef HAVE_WINDOW_SYSTEM |
| @@ -29656,12 +29641,17 @@ Returns the alist element for the first matching AREA in MAP. */) | |||
| 29656 | clip_to_bounds (INT_MIN, XINT (x), INT_MAX), | 29641 | clip_to_bounds (INT_MIN, XINT (x), INT_MAX), |
| 29657 | clip_to_bounds (INT_MIN, XINT (y), INT_MAX)); | 29642 | clip_to_bounds (INT_MIN, XINT (y), INT_MAX)); |
| 29658 | } | 29643 | } |
| 29644 | #endif /* HAVE_WINDOW_SYSTEM */ | ||
| 29659 | 29645 | ||
| 29660 | 29646 | ||
| 29661 | /* Display frame CURSOR, optionally using shape defined by POINTER. */ | 29647 | /* Display frame CURSOR, optionally using shape defined by POINTER. */ |
| 29662 | static void | 29648 | static void |
| 29663 | define_frame_cursor1 (struct frame *f, Cursor cursor, Lisp_Object pointer) | 29649 | define_frame_cursor1 (struct frame *f, Cursor cursor, Lisp_Object pointer) |
| 29664 | { | 29650 | { |
| 29651 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 29652 | if (!FRAME_WINDOW_P (f)) | ||
| 29653 | return; | ||
| 29654 | |||
| 29665 | /* Do not change cursor shape while dragging mouse. */ | 29655 | /* Do not change cursor shape while dragging mouse. */ |
| 29666 | if (EQ (do_mouse_tracking, Qdragging)) | 29656 | if (EQ (do_mouse_tracking, Qdragging)) |
| 29667 | return; | 29657 | return; |
| @@ -29678,10 +29668,10 @@ define_frame_cursor1 (struct frame *f, Cursor cursor, Lisp_Object pointer) | |||
| 29678 | cursor = FRAME_X_OUTPUT (f)->horizontal_drag_cursor; | 29668 | cursor = FRAME_X_OUTPUT (f)->horizontal_drag_cursor; |
| 29679 | else if (EQ (pointer, intern ("nhdrag"))) | 29669 | else if (EQ (pointer, intern ("nhdrag"))) |
| 29680 | cursor = FRAME_X_OUTPUT (f)->vertical_drag_cursor; | 29670 | cursor = FRAME_X_OUTPUT (f)->vertical_drag_cursor; |
| 29681 | #ifdef HAVE_X_WINDOWS | 29671 | # ifdef HAVE_X_WINDOWS |
| 29682 | else if (EQ (pointer, intern ("vdrag"))) | 29672 | else if (EQ (pointer, intern ("vdrag"))) |
| 29683 | cursor = FRAME_DISPLAY_INFO (f)->vertical_scroll_bar_cursor; | 29673 | cursor = FRAME_DISPLAY_INFO (f)->vertical_scroll_bar_cursor; |
| 29684 | #endif | 29674 | # endif |
| 29685 | else if (EQ (pointer, intern ("hourglass"))) | 29675 | else if (EQ (pointer, intern ("hourglass"))) |
| 29686 | cursor = FRAME_X_OUTPUT (f)->hourglass_cursor; | 29676 | cursor = FRAME_X_OUTPUT (f)->hourglass_cursor; |
| 29687 | else if (EQ (pointer, Qmodeline)) | 29677 | else if (EQ (pointer, Qmodeline)) |
| @@ -29692,10 +29682,9 @@ define_frame_cursor1 (struct frame *f, Cursor cursor, Lisp_Object pointer) | |||
| 29692 | 29682 | ||
| 29693 | if (cursor != No_Cursor) | 29683 | if (cursor != No_Cursor) |
| 29694 | FRAME_RIF (f)->define_frame_cursor (f, cursor); | 29684 | FRAME_RIF (f)->define_frame_cursor (f, cursor); |
| 29685 | #endif | ||
| 29695 | } | 29686 | } |
| 29696 | 29687 | ||
| 29697 | #endif /* HAVE_WINDOW_SYSTEM */ | ||
| 29698 | |||
| 29699 | /* Take proper action when mouse has moved to the mode or header line | 29688 | /* Take proper action when mouse has moved to the mode or header line |
| 29700 | or marginal area AREA of window W, x-position X and y-position Y. | 29689 | or marginal area AREA of window W, x-position X and y-position Y. |
| 29701 | X is relative to the start of the text display area of W, so the | 29690 | X is relative to the start of the text display area of W, so the |
| @@ -29711,9 +29700,9 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y, | |||
| 29711 | Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); | 29700 | Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); |
| 29712 | #ifdef HAVE_WINDOW_SYSTEM | 29701 | #ifdef HAVE_WINDOW_SYSTEM |
| 29713 | Display_Info *dpyinfo; | 29702 | Display_Info *dpyinfo; |
| 29703 | #endif | ||
| 29714 | Cursor cursor = No_Cursor; | 29704 | Cursor cursor = No_Cursor; |
| 29715 | Lisp_Object pointer = Qnil; | 29705 | Lisp_Object pointer = Qnil; |
| 29716 | #endif | ||
| 29717 | int dx, dy, width, height; | 29706 | int dx, dy, width, height; |
| 29718 | ptrdiff_t charpos; | 29707 | ptrdiff_t charpos; |
| 29719 | Lisp_Object string, object = Qnil; | 29708 | Lisp_Object string, object = Qnil; |
| @@ -29964,12 +29953,8 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y, | |||
| 29964 | && hlinfo->mouse_face_beg_row == vpos ) | 29953 | && hlinfo->mouse_face_beg_row == vpos ) |
| 29965 | return; | 29954 | return; |
| 29966 | 29955 | ||
| 29967 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 29968 | if (clear_mouse_face (hlinfo)) | 29956 | if (clear_mouse_face (hlinfo)) |
| 29969 | cursor = No_Cursor; | 29957 | cursor = No_Cursor; |
| 29970 | #else | ||
| 29971 | (void) clear_mouse_face (hlinfo); | ||
| 29972 | #endif | ||
| 29973 | 29958 | ||
| 29974 | if (!row->reversed_p) | 29959 | if (!row->reversed_p) |
| 29975 | { | 29960 | { |
| @@ -30003,10 +29988,8 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y, | |||
| 30003 | show_mouse_face (hlinfo, DRAW_MOUSE_FACE); | 29988 | show_mouse_face (hlinfo, DRAW_MOUSE_FACE); |
| 30004 | mouse_face_shown = true; | 29989 | mouse_face_shown = true; |
| 30005 | 29990 | ||
| 30006 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 30007 | if (NILP (pointer)) | 29991 | if (NILP (pointer)) |
| 30008 | pointer = Qhand; | 29992 | pointer = Qhand; |
| 30009 | #endif | ||
| 30010 | } | 29993 | } |
| 30011 | } | 29994 | } |
| 30012 | 29995 | ||
| @@ -30015,10 +29998,7 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y, | |||
| 30015 | if ((area == ON_MODE_LINE || area == ON_HEADER_LINE) && !mouse_face_shown) | 29998 | if ((area == ON_MODE_LINE || area == ON_HEADER_LINE) && !mouse_face_shown) |
| 30016 | clear_mouse_face (hlinfo); | 29999 | clear_mouse_face (hlinfo); |
| 30017 | 30000 | ||
| 30018 | #ifdef HAVE_WINDOW_SYSTEM | 30001 | define_frame_cursor1 (f, cursor, pointer); |
| 30019 | if (FRAME_WINDOW_P (f)) | ||
| 30020 | define_frame_cursor1 (f, cursor, pointer); | ||
| 30021 | #endif | ||
| 30022 | } | 30002 | } |
| 30023 | 30003 | ||
| 30024 | 30004 | ||
| @@ -30037,10 +30017,8 @@ note_mouse_highlight (struct frame *f, int x, int y) | |||
| 30037 | enum window_part part = ON_NOTHING; | 30017 | enum window_part part = ON_NOTHING; |
| 30038 | Lisp_Object window; | 30018 | Lisp_Object window; |
| 30039 | struct window *w; | 30019 | struct window *w; |
| 30040 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 30041 | Cursor cursor = No_Cursor; | 30020 | Cursor cursor = No_Cursor; |
| 30042 | Lisp_Object pointer = Qnil; /* Takes precedence over cursor! */ | 30021 | Lisp_Object pointer = Qnil; /* Takes precedence over cursor! */ |
| 30043 | #endif | ||
| 30044 | struct buffer *b; | 30022 | struct buffer *b; |
| 30045 | 30023 | ||
| 30046 | /* When a menu is active, don't highlight because this looks odd. */ | 30024 | /* When a menu is active, don't highlight because this looks odd. */ |
| @@ -30223,19 +30201,17 @@ note_mouse_highlight (struct frame *f, int x, int y) | |||
| 30223 | && glyph->type == STRETCH_GLYPH | 30201 | && glyph->type == STRETCH_GLYPH |
| 30224 | && glyph->avoid_cursor_p)) | 30202 | && glyph->avoid_cursor_p)) |
| 30225 | { | 30203 | { |
| 30226 | #ifndef HAVE_WINDOW_SYSTEM | ||
| 30227 | (void) clear_mouse_face (hlinfo); | ||
| 30228 | #else /* HAVE_WINDOW_SYSTEM */ | ||
| 30229 | if (clear_mouse_face (hlinfo)) | 30204 | if (clear_mouse_face (hlinfo)) |
| 30230 | cursor = No_Cursor; | 30205 | cursor = No_Cursor; |
| 30231 | if (FRAME_WINDOW_P (f) && NILP (pointer)) | 30206 | if (FRAME_WINDOW_P (f) && NILP (pointer)) |
| 30232 | { | 30207 | { |
| 30208 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 30233 | if (area != TEXT_AREA) | 30209 | if (area != TEXT_AREA) |
| 30234 | cursor = FRAME_X_OUTPUT (f)->nontext_cursor; | 30210 | cursor = FRAME_X_OUTPUT (f)->nontext_cursor; |
| 30235 | else | 30211 | else |
| 30236 | pointer = Vvoid_text_area_pointer; | 30212 | pointer = Vvoid_text_area_pointer; |
| 30213 | #endif | ||
| 30237 | } | 30214 | } |
| 30238 | #endif /* HAVE_WINDOW_SYSTEM */ | ||
| 30239 | goto set_cursor; | 30215 | goto set_cursor; |
| 30240 | } | 30216 | } |
| 30241 | 30217 | ||
| @@ -30280,10 +30256,8 @@ note_mouse_highlight (struct frame *f, int x, int y) | |||
| 30280 | 30256 | ||
| 30281 | same_region = coords_in_mouse_face_p (w, hpos, vpos); | 30257 | same_region = coords_in_mouse_face_p (w, hpos, vpos); |
| 30282 | 30258 | ||
| 30283 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 30284 | if (same_region) | 30259 | if (same_region) |
| 30285 | cursor = No_Cursor; | 30260 | cursor = No_Cursor; |
| 30286 | #endif | ||
| 30287 | 30261 | ||
| 30288 | /* Check mouse-face highlighting. */ | 30262 | /* Check mouse-face highlighting. */ |
| 30289 | if (! same_region | 30263 | if (! same_region |
| @@ -30310,12 +30284,8 @@ note_mouse_highlight (struct frame *f, int x, int y) | |||
| 30310 | hlinfo->mouse_face_overlay = overlay; | 30284 | hlinfo->mouse_face_overlay = overlay; |
| 30311 | 30285 | ||
| 30312 | /* Clear the display of the old active region, if any. */ | 30286 | /* Clear the display of the old active region, if any. */ |
| 30313 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 30314 | if (clear_mouse_face (hlinfo)) | 30287 | if (clear_mouse_face (hlinfo)) |
| 30315 | cursor = No_Cursor; | 30288 | cursor = No_Cursor; |
| 30316 | #else | ||
| 30317 | (void) clear_mouse_face (hlinfo); | ||
| 30318 | #endif | ||
| 30319 | 30289 | ||
| 30320 | /* If no overlay applies, get a text property. */ | 30290 | /* If no overlay applies, get a text property. */ |
| 30321 | if (NILP (overlay)) | 30291 | if (NILP (overlay)) |
| @@ -30346,9 +30316,7 @@ note_mouse_highlight (struct frame *f, int x, int y) | |||
| 30346 | = face_at_string_position (w, object, pos, 0, &ignore, | 30316 | = face_at_string_position (w, object, pos, 0, &ignore, |
| 30347 | glyph->face_id, true); | 30317 | glyph->face_id, true); |
| 30348 | show_mouse_face (hlinfo, DRAW_MOUSE_FACE); | 30318 | show_mouse_face (hlinfo, DRAW_MOUSE_FACE); |
| 30349 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 30350 | cursor = No_Cursor; | 30319 | cursor = No_Cursor; |
| 30351 | #endif | ||
| 30352 | } | 30320 | } |
| 30353 | else | 30321 | else |
| 30354 | { | 30322 | { |
| @@ -30432,9 +30400,7 @@ note_mouse_highlight (struct frame *f, int x, int y) | |||
| 30432 | : XFASTINT (after), | 30400 | : XFASTINT (after), |
| 30433 | before_string, after_string, | 30401 | before_string, after_string, |
| 30434 | disp_string); | 30402 | disp_string); |
| 30435 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 30436 | cursor = No_Cursor; | 30403 | cursor = No_Cursor; |
| 30437 | #endif | ||
| 30438 | } | 30404 | } |
| 30439 | } | 30405 | } |
| 30440 | } | 30406 | } |
| @@ -30557,15 +30523,7 @@ note_mouse_highlight (struct frame *f, int x, int y) | |||
| 30557 | } | 30523 | } |
| 30558 | 30524 | ||
| 30559 | set_cursor: | 30525 | set_cursor: |
| 30560 | 30526 | define_frame_cursor1 (f, cursor, pointer); | |
| 30561 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 30562 | if (FRAME_WINDOW_P (f)) | ||
| 30563 | define_frame_cursor1 (f, cursor, pointer); | ||
| 30564 | #else | ||
| 30565 | /* This is here to prevent a compiler error, about "label at end of | ||
| 30566 | compound statement". */ | ||
| 30567 | return; | ||
| 30568 | #endif | ||
| 30569 | } | 30527 | } |
| 30570 | 30528 | ||
| 30571 | 30529 | ||
diff --git a/src/xfaces.c b/src/xfaces.c index faf28fc513d..97a5ae01e36 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -5287,11 +5287,11 @@ realize_default_face (struct frame *f) | |||
| 5287 | eassert (lface_fully_specified_p (XVECTOR (lface)->contents)); | 5287 | eassert (lface_fully_specified_p (XVECTOR (lface)->contents)); |
| 5288 | check_lface (lface); | 5288 | check_lface (lface); |
| 5289 | memcpy (attrs, XVECTOR (lface)->contents, sizeof attrs); | 5289 | memcpy (attrs, XVECTOR (lface)->contents, sizeof attrs); |
| 5290 | |||
| 5291 | #ifndef HAVE_X_WINDOWS | ||
| 5292 | (void) realize_face (c, attrs, DEFAULT_FACE_ID); | ||
| 5293 | #else /* HAVE_X_WINDOWS */ | ||
| 5294 | struct face *face = realize_face (c, attrs, DEFAULT_FACE_ID); | 5290 | struct face *face = realize_face (c, attrs, DEFAULT_FACE_ID); |
| 5291 | |||
| 5292 | #ifndef HAVE_WINDOW_SYSTEM | ||
| 5293 | (void) face; | ||
| 5294 | #else | ||
| 5295 | if (FRAME_X_P (f) && face->font != FRAME_FONT (f)) | 5295 | if (FRAME_X_P (f) && face->font != FRAME_FONT (f)) |
| 5296 | { | 5296 | { |
| 5297 | /* This can happen when making a frame on a display that does | 5297 | /* This can happen when making a frame on a display that does |
| @@ -5305,7 +5305,7 @@ realize_default_face (struct frame *f) | |||
| 5305 | font. */ | 5305 | font. */ |
| 5306 | x_set_font (f, LFACE_FONT (lface), Qnil); | 5306 | x_set_font (f, LFACE_FONT (lface), Qnil); |
| 5307 | } | 5307 | } |
| 5308 | #endif /* HAVE_X_WINDOWS */ | 5308 | #endif |
| 5309 | return true; | 5309 | return true; |
| 5310 | } | 5310 | } |
| 5311 | 5311 | ||
| @@ -6093,7 +6093,7 @@ face_at_string_position (struct window *w, Lisp_Object string, | |||
| 6093 | if we don't have fonts, so we can stop here if not working | 6093 | if we don't have fonts, so we can stop here if not working |
| 6094 | on a window-system frame. */ | 6094 | on a window-system frame. */ |
| 6095 | || !FRAME_WINDOW_P (f) | 6095 | || !FRAME_WINDOW_P (f) |
| 6096 | || FACE_SUITABLE_FOR_ASCII_CHAR_P (base_face, 0))) | 6096 | || FACE_SUITABLE_FOR_ASCII_CHAR_P (base_face))) |
| 6097 | return base_face->id; | 6097 | return base_face->id; |
| 6098 | 6098 | ||
| 6099 | /* Begin with attributes from the base face. */ | 6099 | /* Begin with attributes from the base face. */ |
diff --git a/src/xfns.c b/src/xfns.c index 35e2a236f89..1120c330e8b 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -1434,7 +1434,7 @@ x_set_internal_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldva | |||
| 1434 | 1434 | ||
| 1435 | if (border != FRAME_INTERNAL_BORDER_WIDTH (f)) | 1435 | if (border != FRAME_INTERNAL_BORDER_WIDTH (f)) |
| 1436 | { | 1436 | { |
| 1437 | FRAME_INTERNAL_BORDER_WIDTH (f) = border; | 1437 | f->internal_border_width = border; |
| 1438 | 1438 | ||
| 1439 | #ifdef USE_X_TOOLKIT | 1439 | #ifdef USE_X_TOOLKIT |
| 1440 | if (FRAME_X_OUTPUT (f)->edit_widget) | 1440 | if (FRAME_X_OUTPUT (f)->edit_widget) |