Mercurial > emacs
comparison src/window.c @ 9974:5cda62e4222a
(Fcurrent_window_configuration): Use allocate_vectorlike and VECSIZE.
(SAVE_WINDOW_DATA_SIZE): Macro deleted.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Wed, 16 Nov 1994 06:17:13 +0000 |
parents | 76910d506a80 |
children | 62e8ccc5b3b9 |
comparison
equal
deleted
inserted
replaced
9973:1d5a908f201e | 9974:5cda62e4222a |
---|---|
2749 Lisp_Object min_width, min_height; | 2749 Lisp_Object min_width, min_height; |
2750 /* A vector, interpreted as a struct saved_window */ | 2750 /* A vector, interpreted as a struct saved_window */ |
2751 Lisp_Object saved_windows; | 2751 Lisp_Object saved_windows; |
2752 }; | 2752 }; |
2753 | 2753 |
2754 /* Arg to Fmake_vector */ | |
2755 #define SAVE_WINDOW_DATA_SIZE \ | |
2756 ((sizeof (struct save_window_data) \ | |
2757 - (sizeof (struct Lisp_Vector) \ | |
2758 /* Don't count the contents member of the struct Lisp_Vector */ \ | |
2759 - sizeof (Lisp_Object))) \ | |
2760 / sizeof (Lisp_Object)) | |
2761 | |
2762 /* This is saved as a Lisp_Vector */ | 2754 /* This is saved as a Lisp_Vector */ |
2763 struct saved_window | 2755 struct saved_window |
2764 { | 2756 { |
2765 /* these first two must agree with struct Lisp_Vector in lisp.h */ | 2757 /* these first two must agree with struct Lisp_Vector in lisp.h */ |
2766 int size_from_Lisp_Vector_struct; | 2758 int size_from_Lisp_Vector_struct; |
3136 Lisp_Object frame; | 3128 Lisp_Object frame; |
3137 { | 3129 { |
3138 register Lisp_Object tem; | 3130 register Lisp_Object tem; |
3139 register int n_windows; | 3131 register int n_windows; |
3140 register struct save_window_data *data; | 3132 register struct save_window_data *data; |
3133 register struct Lisp_Vector *vec; | |
3141 register int i; | 3134 register int i; |
3142 FRAME_PTR f; | 3135 FRAME_PTR f; |
3143 | 3136 |
3144 if (NILP (frame)) | 3137 if (NILP (frame)) |
3145 f = selected_frame; | 3138 f = selected_frame; |
3148 CHECK_LIVE_FRAME (frame, 0); | 3141 CHECK_LIVE_FRAME (frame, 0); |
3149 f = XFRAME (frame); | 3142 f = XFRAME (frame); |
3150 } | 3143 } |
3151 | 3144 |
3152 n_windows = count_windows (XWINDOW (FRAME_ROOT_WINDOW (f))); | 3145 n_windows = count_windows (XWINDOW (FRAME_ROOT_WINDOW (f))); |
3153 data = ((struct save_window_data *) | 3146 vec = allocate_vectorlike (VECSIZE (struct save_window_data)); |
3154 XVECTOR (Fmake_vector (make_number (SAVE_WINDOW_DATA_SIZE), Qnil))); | 3147 for (i = 0; i < VECSIZE (struct save_window_data); i++) |
3148 vec->contents[i] = Qnil; | |
3149 vec->size = VECSIZE (struct save_window_data); | |
3150 data = (struct save_window_data *)vec; | |
3151 | |
3155 XSETFASTINT (data->frame_width, FRAME_WIDTH (f)); | 3152 XSETFASTINT (data->frame_width, FRAME_WIDTH (f)); |
3156 XSETFASTINT (data->frame_height, FRAME_HEIGHT (f)); | 3153 XSETFASTINT (data->frame_height, FRAME_HEIGHT (f)); |
3157 XSETFASTINT (data->frame_menu_bar_lines, FRAME_MENU_BAR_LINES (f)); | 3154 XSETFASTINT (data->frame_menu_bar_lines, FRAME_MENU_BAR_LINES (f)); |
3158 #ifdef MULTI_FRAME | 3155 #ifdef MULTI_FRAME |
3159 XSETFRAME (data->selected_frame, selected_frame); | 3156 XSETFRAME (data->selected_frame, selected_frame); |