diff options
| author | Paul Eggert | 2017-11-02 21:02:12 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-11-02 21:02:12 -0700 |
| commit | aa7542467238b06ed056054965ba444595b85453 (patch) | |
| tree | 3071c15ff777ef5727ccd254d9ddbf513a06c0cc /src | |
| parent | 5fcfdf433d74e8ecb35f86fdc071ce11ca0b0364 (diff) | |
| parent | a87ce5c4b41ca8146c764b1186a6162c069b1933 (diff) | |
| download | emacs-aa7542467238b06ed056054965ba444595b85453.tar.gz emacs-aa7542467238b06ed056054965ba444595b85453.zip | |
Merge from origin/emacs-26
a87ce5c4b4 * src/lisp.h (GCALIGNED): Clarify comment (Bug#29040).
8a31e9993f ; etc/NEWS: Add cpp-message-min-time-interval. (Bug#28961)
ac0bb9a192 Improve the doc of eshell-cmpl-* custom variables (Bug#25069)
36400c7dc9 Fix mouse-scrollbar offset on GNUstep and old macOS (bug#2...
04bc1410c2 Merge from Gnulib
6b08ad5263 Fix alignment portability problems
a9f8706fa8 Fix completion of colon after CSS property (Bug#29056)
9031dec527 ; * src/alloc.c (sweep_symbols): Fix last change.
fdd3dcfa4e * src/alloc.c (sweep_symbols): Tweak last change
27964af438 In frame parameters documentation mention desktop saving/r...
1bd4e7c243 ; Fix typo in ChangeLog.3
4182a60d31 Don't have frameset save the 'client' parameter (Bug#29067)
9d31a97092 ; Spelling fixes
460a25f212 Handle generic variables in cl-defgeneric Edebug spec
dc0a25c2f9 Give a more sensible message if file-attributes fails (Bug...
8453423c7c Avoid wrong value from file-attributes on Linux kernel bef...
70621e2571 Fix customization of debugger-print-function (Bug#29077)
# Conflicts:
# etc/NEWS
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog.13 | 4 | ||||
| -rw-r--r-- | src/alloc.c | 20 | ||||
| -rw-r--r-- | src/buffer.c | 4 | ||||
| -rw-r--r-- | src/dired.c | 9 | ||||
| -rw-r--r-- | src/lisp.h | 26 | ||||
| -rw-r--r-- | src/nsterm.m | 21 | ||||
| -rw-r--r-- | src/thread.c | 4 |
7 files changed, 57 insertions, 31 deletions
diff --git a/src/ChangeLog.13 b/src/ChangeLog.13 index e252acfbdb1..9f3fdee210a 100644 --- a/src/ChangeLog.13 +++ b/src/ChangeLog.13 | |||
| @@ -16581,7 +16581,7 @@ | |||
| 16581 | (characterIndexForPoint:): Adjust return type depending on GNUstep | 16581 | (characterIndexForPoint:): Adjust return type depending on GNUstep |
| 16582 | version. | 16582 | version. |
| 16583 | (mouseDown:): delta is CGFloat. | 16583 | (mouseDown:): delta is CGFloat. |
| 16584 | (updateFrameSize): Remove unised variable f. | 16584 | (updateFrameSize): Remove unused variable f. |
| 16585 | (initFrameFromEmacs): Move toggleButton inside NS_IMPL_COCOA. | 16585 | (initFrameFromEmacs): Move toggleButton inside NS_IMPL_COCOA. |
| 16586 | Cast float to EmacsCGFloat. | 16586 | Cast float to EmacsCGFloat. |
| 16587 | (windowWillUseStandardFrame:defaultFrame:): Set maximized_height | 16587 | (windowWillUseStandardFrame:defaultFrame:): Set maximized_height |
| @@ -16593,7 +16593,7 @@ | |||
| 16593 | (setPosition:portion:whole:): por is CGFloat. | 16593 | (setPosition:portion:whole:): por is CGFloat. |
| 16594 | (getMouseMotionPart:window:x:y:): Add F suffix to float. | 16594 | (getMouseMotionPart:window:x:y:): Add F suffix to float. |
| 16595 | (mouseDown:): Use CGFloat. | 16595 | (mouseDown:): Use CGFloat. |
| 16596 | (mouseDragged:): Remove unised variable edge. | 16596 | (mouseDragged:): Remove unused variable edge. |
| 16597 | (EmacsDocument): Implement for NS_IMPL_GNUSTEP. | 16597 | (EmacsDocument): Implement for NS_IMPL_GNUSTEP. |
| 16598 | 16598 | ||
| 16599 | * nsterm.h (EmacsCGFloat): Typedef for OSX and GNUstep when the size | 16599 | * nsterm.h (EmacsCGFloat): Typedef for OSX and GNUstep when the size |
diff --git a/src/alloc.c b/src/alloc.c index 11afdfd7cc0..0fc79fe68ac 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -621,6 +621,12 @@ buffer_memory_full (ptrdiff_t nbytes) | |||
| 621 | #endif | 621 | #endif |
| 622 | } | 622 | } |
| 623 | 623 | ||
| 624 | /* A common multiple of the positive integers A and B. Ideally this | ||
| 625 | would be the least common multiple, but there's no way to do that | ||
| 626 | as a constant expression in C, so do the best that we can easily do. */ | ||
| 627 | #define COMMON_MULTIPLE(a, b) \ | ||
| 628 | ((a) % (b) == 0 ? (a) : (b) % (a) == 0 ? (b) : (a) * (b)) | ||
| 629 | |||
| 624 | #ifndef XMALLOC_OVERRUN_CHECK | 630 | #ifndef XMALLOC_OVERRUN_CHECK |
| 625 | #define XMALLOC_OVERRUN_CHECK_OVERHEAD 0 | 631 | #define XMALLOC_OVERRUN_CHECK_OVERHEAD 0 |
| 626 | #else | 632 | #else |
| @@ -7024,10 +7030,16 @@ sweep_symbols (void) | |||
| 7024 | { | 7030 | { |
| 7025 | if (!sym->s.gcmarkbit) | 7031 | if (!sym->s.gcmarkbit) |
| 7026 | { | 7032 | { |
| 7027 | if (sym->s.redirect == SYMBOL_LOCALIZED | 7033 | if (sym->s.redirect == SYMBOL_LOCALIZED) |
| 7028 | /* Already freed? */ | 7034 | { |
| 7029 | && !EQ (sym->s.function, Vdead)) | 7035 | xfree (SYMBOL_BLV (&sym->s)); |
| 7030 | xfree (SYMBOL_BLV (&sym->s)); | 7036 | /* At every GC we sweep all symbol_blocks and rebuild the |
| 7037 | symbol_free_list, so those symbols which stayed unused | ||
| 7038 | between the two will be re-swept. | ||
| 7039 | So we have to make sure we don't re-free this blv next | ||
| 7040 | time we sweep this symbol_block (bug#29066). */ | ||
| 7041 | sym->s.redirect = SYMBOL_PLAINVAL; | ||
| 7042 | } | ||
| 7031 | sym->s.next = symbol_free_list; | 7043 | sym->s.next = symbol_free_list; |
| 7032 | symbol_free_list = &sym->s; | 7044 | symbol_free_list = &sym->s; |
| 7033 | symbol_free_list->function = Vdead; | 7045 | symbol_free_list->function = Vdead; |
diff --git a/src/buffer.c b/src/buffer.c index 9635733fcff..15735a298ad 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -61,7 +61,7 @@ struct buffer *all_buffers; | |||
| 61 | Setting the default value also goes through the alist of buffers | 61 | Setting the default value also goes through the alist of buffers |
| 62 | and stores into each buffer that does not say it has a local value. */ | 62 | and stores into each buffer that does not say it has a local value. */ |
| 63 | 63 | ||
| 64 | struct buffer alignas (GCALIGNMENT) buffer_defaults; | 64 | struct buffer GCALIGNED buffer_defaults; |
| 65 | 65 | ||
| 66 | /* This structure marks which slots in a buffer have corresponding | 66 | /* This structure marks which slots in a buffer have corresponding |
| 67 | default values in buffer_defaults. | 67 | default values in buffer_defaults. |
| @@ -84,7 +84,7 @@ struct buffer buffer_local_flags; | |||
| 84 | /* This structure holds the names of symbols whose values may be | 84 | /* This structure holds the names of symbols whose values may be |
| 85 | buffer-local. It is indexed and accessed in the same way as the above. */ | 85 | buffer-local. It is indexed and accessed in the same way as the above. */ |
| 86 | 86 | ||
| 87 | struct buffer alignas (GCALIGNMENT) buffer_local_symbols; | 87 | struct buffer GCALIGNED buffer_local_symbols; |
| 88 | 88 | ||
| 89 | /* Return the symbol of the per-buffer variable at offset OFFSET in | 89 | /* Return the symbol of the per-buffer variable at offset OFFSET in |
| 90 | the buffer structure. */ | 90 | the buffer structure. */ |
diff --git a/src/dired.c b/src/dired.c index 28d1cffb44c..239b1acd1fb 100644 --- a/src/dired.c +++ b/src/dired.c | |||
| @@ -953,7 +953,14 @@ file_attributes (int fd, char const *name, | |||
| 953 | { | 953 | { |
| 954 | record_unwind_protect_int (close_file_unwind, namefd); | 954 | record_unwind_protect_int (close_file_unwind, namefd); |
| 955 | if (fstat (namefd, &s) != 0) | 955 | if (fstat (namefd, &s) != 0) |
| 956 | err = errno; | 956 | { |
| 957 | err = errno; | ||
| 958 | /* The Linux kernel before version 3.6 does not support | ||
| 959 | fstat on O_PATH file descriptors. Handle this error like | ||
| 960 | missing support for O_PATH. */ | ||
| 961 | if (err == EBADF) | ||
| 962 | err = EINVAL; | ||
| 963 | } | ||
| 957 | else | 964 | else |
| 958 | { | 965 | { |
| 959 | err = 0; | 966 | err = 0; |
diff --git a/src/lisp.h b/src/lisp.h index 43b3ec618f0..a71ba22618e 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -228,14 +228,12 @@ extern bool suppress_checking EXTERNALLY_VISIBLE; | |||
| 228 | 228 | ||
| 229 | USE_LSB_TAG not only requires the least 3 bits of pointers returned by | 229 | USE_LSB_TAG not only requires the least 3 bits of pointers returned by |
| 230 | malloc to be 0 but also needs to be able to impose a mult-of-8 alignment | 230 | malloc to be 0 but also needs to be able to impose a mult-of-8 alignment |
| 231 | on the few static Lisp_Objects used: lispsym, all the defsubr, and | 231 | on the few static Lisp_Objects used, all of which are aligned via |
| 232 | the two special buffers buffer_defaults and buffer_local_symbols. */ | 232 | the GCALIGN macro defined below. */ |
| 233 | 233 | ||
| 234 | enum Lisp_Bits | 234 | enum Lisp_Bits |
| 235 | { | 235 | { |
| 236 | /* 2**GCTYPEBITS. This must be a macro that expands to a literal | 236 | GCALIGNMENT = 1 << GCTYPEBITS, |
| 237 | integer constant, for MSVC. */ | ||
| 238 | #define GCALIGNMENT 8 | ||
| 239 | 237 | ||
| 240 | /* Number of bits in a Lisp_Object value, not counting the tag. */ | 238 | /* Number of bits in a Lisp_Object value, not counting the tag. */ |
| 241 | VALBITS = EMACS_INT_WIDTH - GCTYPEBITS, | 239 | VALBITS = EMACS_INT_WIDTH - GCTYPEBITS, |
| @@ -247,10 +245,6 @@ enum Lisp_Bits | |||
| 247 | FIXNUM_BITS = VALBITS + 1 | 245 | FIXNUM_BITS = VALBITS + 1 |
| 248 | }; | 246 | }; |
| 249 | 247 | ||
| 250 | #if GCALIGNMENT != 1 << GCTYPEBITS | ||
| 251 | # error "GCALIGNMENT and GCTYPEBITS are inconsistent" | ||
| 252 | #endif | ||
| 253 | |||
| 254 | /* The maximum value that can be stored in a EMACS_INT, assuming all | 248 | /* The maximum value that can be stored in a EMACS_INT, assuming all |
| 255 | bits other than the type bits contribute to a nonnegative signed value. | 249 | bits other than the type bits contribute to a nonnegative signed value. |
| 256 | This can be used in #if, e.g., '#if USE_LSB_TAG' below expands to an | 250 | This can be used in #if, e.g., '#if USE_LSB_TAG' below expands to an |
| @@ -277,18 +271,16 @@ DEFINE_GDB_SYMBOL_END (VALMASK) | |||
| 277 | error !; | 271 | error !; |
| 278 | #endif | 272 | #endif |
| 279 | 273 | ||
| 274 | /* Declare an object to have an address that is a multiple of | ||
| 275 | GCALIGNMENT. This is a no-op if the object's natural alignment is | ||
| 276 | already a multiple of GCALIGNMENT. alignas is not suitable here, | ||
| 277 | as it fails if the object's natural alignment exceeds GCALIGNMENT. */ | ||
| 280 | #ifdef HAVE_STRUCT_ATTRIBUTE_ALIGNED | 278 | #ifdef HAVE_STRUCT_ATTRIBUTE_ALIGNED |
| 281 | # define GCALIGNED __attribute__ ((aligned (GCALIGNMENT))) | 279 | # define GCALIGNED __attribute__ ((aligned (GCALIGNMENT))) |
| 282 | #else | 280 | #else |
| 283 | # define GCALIGNED /* empty */ | 281 | # define GCALIGNED /* empty */ |
| 284 | #endif | 282 | #endif |
| 285 | 283 | ||
| 286 | /* A common multiple of the positive integers A and B. Ideally this | ||
| 287 | would be the least common multiple, but there's no way to do that | ||
| 288 | as a constant expression in C, so do the best that we can easily do. */ | ||
| 289 | #define COMMON_MULTIPLE(a, b) \ | ||
| 290 | ((a) % (b) == 0 ? (a) : (b) % (a) == 0 ? (b) : (a) * (b)) | ||
| 291 | |||
| 292 | /* Some operations are so commonly executed that they are implemented | 284 | /* Some operations are so commonly executed that they are implemented |
| 293 | as macros, not functions, because otherwise runtime performance would | 285 | as macros, not functions, because otherwise runtime performance would |
| 294 | suffer too much when compiling with GCC without optimization. | 286 | suffer too much when compiling with GCC without optimization. |
| @@ -2946,7 +2938,7 @@ CHECK_NUMBER_CDR (Lisp_Object x) | |||
| 2946 | #ifdef _MSC_VER | 2938 | #ifdef _MSC_VER |
| 2947 | #define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ | 2939 | #define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ |
| 2948 | Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ | 2940 | Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ |
| 2949 | static struct Lisp_Subr alignas (GCALIGNMENT) sname = \ | 2941 | static struct Lisp_Subr GCALIGNED sname = \ |
| 2950 | { { (PVEC_SUBR << PSEUDOVECTOR_AREA_BITS) \ | 2942 | { { (PVEC_SUBR << PSEUDOVECTOR_AREA_BITS) \ |
| 2951 | | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)) }, \ | 2943 | | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)) }, \ |
| 2952 | { (Lisp_Object (__cdecl *)(void))fnname }, \ | 2944 | { (Lisp_Object (__cdecl *)(void))fnname }, \ |
| @@ -2954,7 +2946,7 @@ CHECK_NUMBER_CDR (Lisp_Object x) | |||
| 2954 | Lisp_Object fnname | 2946 | Lisp_Object fnname |
| 2955 | #else /* not _MSC_VER */ | 2947 | #else /* not _MSC_VER */ |
| 2956 | #define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ | 2948 | #define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ |
| 2957 | static struct Lisp_Subr alignas (GCALIGNMENT) sname = \ | 2949 | static struct Lisp_Subr GCALIGNED sname = \ |
| 2958 | { { PVEC_SUBR << PSEUDOVECTOR_AREA_BITS }, \ | 2950 | { { PVEC_SUBR << PSEUDOVECTOR_AREA_BITS }, \ |
| 2959 | { .a ## maxargs = fnname }, \ | 2951 | { .a ## maxargs = fnname }, \ |
| 2960 | minargs, maxargs, lname, intspec, 0}; \ | 2952 | minargs, maxargs, lname, intspec, 0}; \ |
diff --git a/src/nsterm.m b/src/nsterm.m index a382e5f7130..5c29f039e51 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -8912,10 +8912,20 @@ not_in_argv (NSString *arg) | |||
| 8912 | } | 8912 | } |
| 8913 | last_mouse_offset = kloc; | 8913 | last_mouse_offset = kloc; |
| 8914 | 8914 | ||
| 8915 | if (part != NSScrollerKnob) | 8915 | /* if knob, tell emacs a location offset by knob pos |
| 8916 | /* this is a slot click on GNUstep: go straight there */ | 8916 | (to indicate top of handle) */ |
| 8917 | if (part == NSScrollerKnob) | ||
| 8918 | pos = (loc - last_mouse_offset); | ||
| 8919 | else | ||
| 8920 | /* else this is a slot click on GNUstep: go straight there */ | ||
| 8917 | pos = loc; | 8921 | pos = loc; |
| 8918 | 8922 | ||
| 8923 | /* If there are buttons in the scroller area, we need to | ||
| 8924 | recalculate pos as emacs expects the scroller slot to take up | ||
| 8925 | the entire available length. */ | ||
| 8926 | if (length != pixel_length) | ||
| 8927 | pos = pos * pixel_length / length; | ||
| 8928 | |||
| 8919 | /* send a fake mouse-up to super to preempt modal -trackKnob: mode */ | 8929 | /* send a fake mouse-up to super to preempt modal -trackKnob: mode */ |
| 8920 | fake_event = [NSEvent mouseEventWithType: NSEventTypeLeftMouseUp | 8930 | fake_event = [NSEvent mouseEventWithType: NSEventTypeLeftMouseUp |
| 8921 | location: [e locationInWindow] | 8931 | location: [e locationInWindow] |
| @@ -8980,6 +8990,13 @@ not_in_argv (NSString *arg) | |||
| 8980 | } | 8990 | } |
| 8981 | 8991 | ||
| 8982 | pos = (loc - last_mouse_offset); | 8992 | pos = (loc - last_mouse_offset); |
| 8993 | |||
| 8994 | /* If there are buttons in the scroller area, we need to | ||
| 8995 | recalculate pos as emacs expects the scroller slot to take up | ||
| 8996 | the entire available length. */ | ||
| 8997 | if (length != pixel_length) | ||
| 8998 | pos = pos * pixel_length / length; | ||
| 8999 | |||
| 8983 | [self sendScrollEventAtLoc: pos fromEvent: e]; | 9000 | [self sendScrollEventAtLoc: pos fromEvent: e]; |
| 8984 | } | 9001 | } |
| 8985 | 9002 | ||
diff --git a/src/thread.c b/src/thread.c index 7a670ba410b..03f5b31855e 100644 --- a/src/thread.c +++ b/src/thread.c | |||
| @@ -26,9 +26,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 26 | #include "coding.h" | 26 | #include "coding.h" |
| 27 | #include "syssignal.h" | 27 | #include "syssignal.h" |
| 28 | 28 | ||
| 29 | #define THREAD_ALIGNMENT COMMON_MULTIPLE (alignof (max_align_t), GCALIGNMENT) | 29 | static struct thread_state GCALIGNED main_thread; |
| 30 | |||
| 31 | static struct thread_state alignas (THREAD_ALIGNMENT) main_thread; | ||
| 32 | 30 | ||
| 33 | struct thread_state *current_thread = &main_thread; | 31 | struct thread_state *current_thread = &main_thread; |
| 34 | 32 | ||