aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorHelmut Eller2024-06-24 10:06:54 +0200
committerHelmut Eller2026-02-12 18:51:51 +0100
commit40f696757c2afe15a583945992955429b00de563 (patch)
treeb0e8f64210fde58d1351734993edb6c79c8d43f7 /src/buffer.c
parent9008e6a9d7f041875c2fe9f58d5b5b44e84f649f (diff)
downloademacs-40f696757c2afe15a583945992955429b00de563.tar.gz
emacs-40f696757c2afe15a583945992955429b00de563.zip
Move the Lisp_Fwd.bufoffset field back to the union
* src/lisp.h (struct Lisp_Fwd): With the predicate enum, we can now pack the offset and the predicate into a one-word struct. (XBUFFER_OFFSET): Use the new field name. * src/buffer.c (DEFVAR_PER_BUFFER): Create the one-word struct. * src/data.c (store_symval_forwarding): Use the new field name.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/buffer.c b/src/buffer.c
index afc2f0f4d89..b1a835b7ac5 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -4980,14 +4980,17 @@ init_buffer (void)
4980 that nil is allowed too). DOC is a dummy where you write the doc 4980 that nil is allowed too). DOC is a dummy where you write the doc
4981 string as a comment. */ 4981 string as a comment. */
4982 4982
4983#define DEFVAR_PER_BUFFER(lname, vname, predicate, doc) \ 4983#define DEFVAR_PER_BUFFER(lname, vname, predicate_, doc) \
4984 do { \ 4984 do { \
4985 static const struct Lisp_Fwd bo_fwd \ 4985 static const struct Lisp_Fwd bo_fwd = { \
4986 = { .type = Lisp_Fwd_Buffer_Obj, \ 4986 .type = Lisp_Fwd_Buffer_Obj, \
4987 .bufoffset = offsetof (struct buffer, vname##_), \ 4987 .u.buf = { \
4988 .u.bufpredicate = FWDPRED_##predicate }; \ 4988 .offset = offsetof (struct buffer, vname##_), \
4989 .predicate = FWDPRED_##predicate_ \
4990 } \
4991 }; \
4989 static_assert (offsetof (struct buffer, vname##_) \ 4992 static_assert (offsetof (struct buffer, vname##_) \
4990 < (1 << 8 * sizeof bo_fwd.bufoffset)); \ 4993 < (1 << 8 * sizeof bo_fwd.u.buf.offset)); \
4991 defvar_per_buffer (&bo_fwd, lname); \ 4994 defvar_per_buffer (&bo_fwd, lname); \
4992 } while (0) 4995 } while (0)
4993 4996