diff options
| author | Karl Heuer | 1994-11-16 05:16:42 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-11-16 05:16:42 +0000 |
| commit | cffec418d6dc9e0de14d57d722208a11e6f0ac17 (patch) | |
| tree | 365f433a5c2d7ae39d2d938be1921b1e22cf2202 /src | |
| parent | 23d6bb9cd84ed2bfa80b15707cdb771faae165b2 (diff) | |
| download | emacs-cffec418d6dc9e0de14d57d722208a11e6f0ac17.tar.gz emacs-cffec418d6dc9e0de14d57d722208a11e6f0ac17.zip | |
(make_dummy_parent, make_window): Use allocate_vectorlike and VECSIZE.
Diffstat (limited to 'src')
| -rw-r--r-- | src/window.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/src/window.c b/src/window.c index 822dcea7199..0ede40c2402 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -119,18 +119,16 @@ DEFUN ("window-live-p", Fwindow_live_p, Swindow_live_p, 1, 1, 0, | |||
| 119 | Lisp_Object | 119 | Lisp_Object |
| 120 | make_window () | 120 | make_window () |
| 121 | { | 121 | { |
| 122 | register Lisp_Object val; | 122 | Lisp_Object val; |
| 123 | register struct window *p; | 123 | register struct window *p; |
| 124 | 124 | register struct Lisp_Vector *vec; | |
| 125 | /* Add sizeof (Lisp_Object) here because sizeof (struct Lisp_Vector) | 125 | int i; |
| 126 | includes the first element. */ | 126 | |
| 127 | val = Fmake_vector ( | 127 | vec = allocate_vectorlike ((EMACS_INT) VECSIZE (struct window)); |
| 128 | make_number ((sizeof (struct window) - sizeof (struct Lisp_Vector) | 128 | for (i = 0; i < VECSIZE (struct window); i++) |
| 129 | + sizeof (Lisp_Object)) | 129 | vec->contents[i] = Qnil; |
| 130 | / sizeof (Lisp_Object)), | 130 | vec->size = VECSIZE (struct window); |
| 131 | Qnil); | 131 | p = (struct window *)vec; |
| 132 | XSETTYPE (val, Lisp_Window); | ||
| 133 | p = XWINDOW (val); | ||
| 134 | XSETFASTINT (p->sequence_number, ++sequence_number); | 132 | XSETFASTINT (p->sequence_number, ++sequence_number); |
| 135 | XSETFASTINT (p->left, 0); | 133 | XSETFASTINT (p->left, 0); |
| 136 | XSETFASTINT (p->top, 0); | 134 | XSETFASTINT (p->top, 0); |
| @@ -145,6 +143,7 @@ make_window () | |||
| 145 | p->frame = Qnil; | 143 | p->frame = Qnil; |
| 146 | p->display_table = Qnil; | 144 | p->display_table = Qnil; |
| 147 | p->dedicated = Qnil; | 145 | p->dedicated = Qnil; |
| 146 | XSETWINDOW (val, p); | ||
| 148 | return val; | 147 | return val; |
| 149 | } | 148 | } |
| 150 | 149 | ||
| @@ -2042,16 +2041,19 @@ static | |||
| 2042 | make_dummy_parent (window) | 2041 | make_dummy_parent (window) |
| 2043 | Lisp_Object window; | 2042 | Lisp_Object window; |
| 2044 | { | 2043 | { |
| 2045 | register Lisp_Object old, new; | 2044 | Lisp_Object new; |
| 2046 | register struct window *o, *p; | 2045 | register struct window *o, *p; |
| 2046 | register struct Lisp_Vector *vec; | ||
| 2047 | int i; | ||
| 2047 | 2048 | ||
| 2048 | old = window; | 2049 | o = XWINDOW (window); |
| 2049 | XSETTYPE (old, Lisp_Vector); | 2050 | vec = allocate_vectorlike ((EMACS_INT)VECSIZE (struct window)); |
| 2050 | new = Fcopy_sequence (old); | 2051 | for (i = 0; i < VECSIZE (struct window); ++i) |
| 2051 | XSETTYPE (new, Lisp_Window); | 2052 | vec->contents[i] = ((struct Lisp_Vector *)o)->contents[i]; |
| 2053 | vec->size = VECSIZE (struct window); | ||
| 2054 | p = (struct window *)vec; | ||
| 2055 | XSETWINDOW (new, p); | ||
| 2052 | 2056 | ||
| 2053 | o = XWINDOW (old); | ||
| 2054 | p = XWINDOW (new); | ||
| 2055 | XSETFASTINT (p->sequence_number, ++sequence_number); | 2057 | XSETFASTINT (p->sequence_number, ++sequence_number); |
| 2056 | 2058 | ||
| 2057 | /* Put new into window structure in place of window */ | 2059 | /* Put new into window structure in place of window */ |