diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2012-08-05 19:47:28 +0400 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2012-08-05 19:47:28 +0400 |
commit | 663e2b3f88f9be61399e06dfc0b76700f90c6ca6 (patch) | |
tree | 71e48dfc0079f80f2089b5bdebe991a200d594ed /src/buffer.c | |
parent | 777fe95e05ab77e77e4ecee45382ec64d381c776 (diff) | |
download | emacs-663e2b3f88f9be61399e06dfc0b76700f90c6ca6.tar.gz emacs-663e2b3f88f9be61399e06dfc0b76700f90c6ca6.tar.bz2 emacs-663e2b3f88f9be61399e06dfc0b76700f90c6ca6.zip |
Generalize common compile-time constants.
* lisp.h (header_size, bool_header_size, word_size): Now here.
(struct Lisp_Vector): Add comment.
(struct Lisp_Bool_Vector): Move up to define handy constants.
(VECSIZE, PSEUDOVECSIZE): Simplify.
(SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
* buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
* font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
* msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
* xfont.c, xmenu.c: Use word_size where appropriate.
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/buffer.c b/src/buffer.c index a8af8a84f7f..37e520f9f5f 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -99,7 +99,7 @@ static Lisp_Object Vbuffer_local_symbols; /* Maximum length of an overlay vector. */ #define OVERLAY_COUNT_MAX \ ((ptrdiff_t) min (MOST_POSITIVE_FIXNUM, \ - min (PTRDIFF_MAX, SIZE_MAX) / sizeof (Lisp_Object))) + min (PTRDIFF_MAX, SIZE_MAX) / word_size)) /* Flags indicating which built-in buffer-local variables are permanent locals. */ @@ -4267,7 +4267,7 @@ report_overlay_modification (Lisp_Object start, Lisp_Object end, int after, ptrdiff_t i; memcpy (copy, XVECTOR (last_overlay_modification_hooks)->contents, - size * sizeof (Lisp_Object)); + size * word_size); gcpro1.var = copy; gcpro1.nvars = size; @@ -4886,8 +4886,7 @@ init_buffer_once (void) sure that this is still correct. Otherwise, mark_vectorlike may not trace all Lisp_Objects in buffer_defaults and buffer_local_symbols. */ const int pvecsize - = (offsetof (struct buffer, own_text) - sizeof (struct vectorlike_header)) - / sizeof (Lisp_Object); + = (offsetof (struct buffer, own_text) - header_size) / word_size; memset (buffer_permanent_local_flags, 0, sizeof buffer_permanent_local_flags); @@ -4972,7 +4971,7 @@ init_buffer_once (void) The local flag bits are in the local_var_flags slot of the buffer. */ /* Nothing can work if this isn't true */ - { verify (sizeof (EMACS_INT) == sizeof (Lisp_Object)); } + { verify (sizeof (EMACS_INT) == word_size); } /* 0 means not a lisp var, -1 means always local, else mask */ memset (&buffer_local_flags, 0, sizeof buffer_local_flags); |