diff options
| author | Dmitry Antipov | 2012-08-05 19:47:28 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 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.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; | |||
| 99 | /* Maximum length of an overlay vector. */ | 99 | /* Maximum length of an overlay vector. */ |
| 100 | #define OVERLAY_COUNT_MAX \ | 100 | #define OVERLAY_COUNT_MAX \ |
| 101 | ((ptrdiff_t) min (MOST_POSITIVE_FIXNUM, \ | 101 | ((ptrdiff_t) min (MOST_POSITIVE_FIXNUM, \ |
| 102 | min (PTRDIFF_MAX, SIZE_MAX) / sizeof (Lisp_Object))) | 102 | min (PTRDIFF_MAX, SIZE_MAX) / word_size)) |
| 103 | 103 | ||
| 104 | /* Flags indicating which built-in buffer-local variables | 104 | /* Flags indicating which built-in buffer-local variables |
| 105 | are permanent locals. */ | 105 | are permanent locals. */ |
| @@ -4267,7 +4267,7 @@ report_overlay_modification (Lisp_Object start, Lisp_Object end, int after, | |||
| 4267 | ptrdiff_t i; | 4267 | ptrdiff_t i; |
| 4268 | 4268 | ||
| 4269 | memcpy (copy, XVECTOR (last_overlay_modification_hooks)->contents, | 4269 | memcpy (copy, XVECTOR (last_overlay_modification_hooks)->contents, |
| 4270 | size * sizeof (Lisp_Object)); | 4270 | size * word_size); |
| 4271 | gcpro1.var = copy; | 4271 | gcpro1.var = copy; |
| 4272 | gcpro1.nvars = size; | 4272 | gcpro1.nvars = size; |
| 4273 | 4273 | ||
| @@ -4886,8 +4886,7 @@ init_buffer_once (void) | |||
| 4886 | sure that this is still correct. Otherwise, mark_vectorlike may not | 4886 | sure that this is still correct. Otherwise, mark_vectorlike may not |
| 4887 | trace all Lisp_Objects in buffer_defaults and buffer_local_symbols. */ | 4887 | trace all Lisp_Objects in buffer_defaults and buffer_local_symbols. */ |
| 4888 | const int pvecsize | 4888 | const int pvecsize |
| 4889 | = (offsetof (struct buffer, own_text) - sizeof (struct vectorlike_header)) | 4889 | = (offsetof (struct buffer, own_text) - header_size) / word_size; |
| 4890 | / sizeof (Lisp_Object); | ||
| 4891 | 4890 | ||
| 4892 | memset (buffer_permanent_local_flags, 0, sizeof buffer_permanent_local_flags); | 4891 | memset (buffer_permanent_local_flags, 0, sizeof buffer_permanent_local_flags); |
| 4893 | 4892 | ||
| @@ -4972,7 +4971,7 @@ init_buffer_once (void) | |||
| 4972 | The local flag bits are in the local_var_flags slot of the buffer. */ | 4971 | The local flag bits are in the local_var_flags slot of the buffer. */ |
| 4973 | 4972 | ||
| 4974 | /* Nothing can work if this isn't true */ | 4973 | /* Nothing can work if this isn't true */ |
| 4975 | { verify (sizeof (EMACS_INT) == sizeof (Lisp_Object)); } | 4974 | { verify (sizeof (EMACS_INT) == word_size); } |
| 4976 | 4975 | ||
| 4977 | /* 0 means not a lisp var, -1 means always local, else mask */ | 4976 | /* 0 means not a lisp var, -1 means always local, else mask */ |
| 4978 | memset (&buffer_local_flags, 0, sizeof buffer_local_flags); | 4977 | memset (&buffer_local_flags, 0, sizeof buffer_local_flags); |