diff options
| author | Dmitry Antipov | 2012-06-26 18:41:01 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-06-26 18:41:01 +0400 |
| commit | 62efea5e881407a178c5c291575facc17dca8a3f (patch) | |
| tree | 03224f091836b782bea0e86c76d9135d9a5f86bf /src/window.c | |
| parent | 995a55159dc4b4831e45fe9827a99cadad1bcbd3 (diff) | |
| download | emacs-62efea5e881407a178c5c291575facc17dca8a3f.tar.gz emacs-62efea5e881407a178c5c291575facc17dca8a3f.zip | |
* alloc.c (allocate_window): Zero out non-Lisp part of newly
allocated window.
(allocate_process): Likewise for new process.
(allocate_terminal): Changed to use offsetof.
(allocate_frame): Likewise.
* frame.c (make_frame): Omit redundant initialization.
* window.c (make_parent_window): Use memset.
(make_window): Omit redundant initialization.
* process.c (make_process): Omit redundant initialization.
* terminal.c (create_terminal): Likewise.
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 44 |
1 files changed, 9 insertions, 35 deletions
diff --git a/src/window.c b/src/window.c index 9420d733bc1..05749c12bb9 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -3242,13 +3242,12 @@ make_parent_window (Lisp_Object window, int horflag) | |||
| 3242 | { | 3242 | { |
| 3243 | Lisp_Object parent; | 3243 | Lisp_Object parent; |
| 3244 | register struct window *o, *p; | 3244 | register struct window *o, *p; |
| 3245 | int i; | ||
| 3246 | 3245 | ||
| 3247 | o = XWINDOW (window); | 3246 | o = XWINDOW (window); |
| 3248 | p = allocate_window (); | 3247 | p = allocate_window (); |
| 3249 | for (i = 0; i < VECSIZE (struct window); ++i) | 3248 | memcpy ((char *) p + sizeof (struct vectorlike_header), |
| 3250 | ((struct Lisp_Vector *) p)->contents[i] | 3249 | (char *) o + sizeof (struct vectorlike_header), |
| 3251 | = ((struct Lisp_Vector *) o)->contents[i]; | 3250 | sizeof (Lisp_Object) * VECSIZE (struct window)); |
| 3252 | XSETWINDOW (parent, p); | 3251 | XSETWINDOW (parent, p); |
| 3253 | 3252 | ||
| 3254 | ++sequence_number; | 3253 | ++sequence_number; |
| @@ -3277,10 +3276,8 @@ make_window (void) | |||
| 3277 | register struct window *w; | 3276 | register struct window *w; |
| 3278 | 3277 | ||
| 3279 | w = allocate_window (); | 3278 | w = allocate_window (); |
| 3280 | /* Initialize all Lisp data. */ | 3279 | /* Initialize Lisp data. Note that allocate_window initializes all |
| 3281 | w->frame = Qnil; | 3280 | Lisp data to nil, so do it only for slots which should not be nil. */ |
| 3282 | w->mini = 0; | ||
| 3283 | w->next = w->prev = w->hchild = w->vchild = w->parent = Qnil; | ||
| 3284 | XSETFASTINT (w->left_col, 0); | 3281 | XSETFASTINT (w->left_col, 0); |
| 3285 | XSETFASTINT (w->top_line, 0); | 3282 | XSETFASTINT (w->top_line, 0); |
| 3286 | XSETFASTINT (w->total_lines, 0); | 3283 | XSETFASTINT (w->total_lines, 0); |
| @@ -3289,47 +3286,24 @@ make_window (void) | |||
| 3289 | w->normal_cols = make_float (1.0); | 3286 | w->normal_cols = make_float (1.0); |
| 3290 | XSETFASTINT (w->new_total, 0); | 3287 | XSETFASTINT (w->new_total, 0); |
| 3291 | XSETFASTINT (w->new_normal, 0); | 3288 | XSETFASTINT (w->new_normal, 0); |
| 3292 | w->buffer = Qnil; | ||
| 3293 | w->start = Fmake_marker (); | 3289 | w->start = Fmake_marker (); |
| 3294 | w->pointm = Fmake_marker (); | 3290 | w->pointm = Fmake_marker (); |
| 3295 | w->force_start = w->optional_new_start = 0; | ||
| 3296 | XSETFASTINT (w->hscroll, 0); | 3291 | XSETFASTINT (w->hscroll, 0); |
| 3297 | XSETFASTINT (w->min_hscroll, 0); | 3292 | XSETFASTINT (w->min_hscroll, 0); |
| 3298 | XSETFASTINT (w->use_time, 0); | 3293 | XSETFASTINT (w->use_time, 0); |
| 3299 | ++sequence_number; | 3294 | ++sequence_number; |
| 3300 | XSETFASTINT (w->sequence_number, sequence_number); | 3295 | XSETFASTINT (w->sequence_number, sequence_number); |
| 3301 | w->temslot = w->last_modified = w->last_overlay_modified = Qnil; | ||
| 3302 | XSETFASTINT (w->last_point, 0); | 3296 | XSETFASTINT (w->last_point, 0); |
| 3303 | w->last_had_star = 0; | ||
| 3304 | w->vertical_scroll_bar = Qnil; | ||
| 3305 | w->left_margin_cols = w->right_margin_cols = Qnil; | ||
| 3306 | w->left_fringe_width = w->right_fringe_width = Qnil; | ||
| 3307 | w->fringes_outside_margins = Qnil; | ||
| 3308 | w->scroll_bar_width = Qnil; | ||
| 3309 | w->vertical_scroll_bar_type = Qt; | 3297 | w->vertical_scroll_bar_type = Qt; |
| 3310 | XSETFASTINT (w->window_end_pos, 0); | 3298 | XSETFASTINT (w->window_end_pos, 0); |
| 3311 | XSETFASTINT (w->window_end_vpos, 0); | 3299 | XSETFASTINT (w->window_end_vpos, 0); |
| 3312 | w->window_end_valid = w->display_table = Qnil; | 3300 | |
| 3313 | w->update_mode_line = w->start_at_line_beg = 0; | 3301 | /* Initialize non-Lisp data. Note that allocate_window zeroes out all |
| 3314 | w->dedicated = Qnil; | 3302 | non-Lisp data, so do it only for slots which should not be zero. */ |
| 3315 | w->base_line_number = w->base_line_pos = w->region_showing = Qnil; | ||
| 3316 | w->column_number_displayed = w->redisplay_end_trigger = Qnil; | ||
| 3317 | w->combination_limit = w->window_parameters = Qnil; | ||
| 3318 | w->prev_buffers = w->next_buffers = Qnil; | ||
| 3319 | /* Initialize non-Lisp data. */ | ||
| 3320 | w->desired_matrix = w->current_matrix = 0; | ||
| 3321 | w->nrows_scale_factor = w->ncols_scale_factor = 1; | 3303 | w->nrows_scale_factor = w->ncols_scale_factor = 1; |
| 3322 | memset (&w->cursor, 0, sizeof (w->cursor)); | ||
| 3323 | memset (&w->last_cursor, 0, sizeof (w->last_cursor)); | ||
| 3324 | memset (&w->phys_cursor, 0, sizeof (w->phys_cursor)); | ||
| 3325 | w->phys_cursor_type = -1; | 3304 | w->phys_cursor_type = -1; |
| 3326 | w->phys_cursor_width = -1; | 3305 | w->phys_cursor_width = -1; |
| 3327 | w->phys_cursor_on_p = 0; | 3306 | |
| 3328 | w->last_cursor_off_p = w->cursor_off_p = 0; | ||
| 3329 | w->must_be_updated_p = 0; | ||
| 3330 | w->pseudo_window_p = 0; | ||
| 3331 | w->frozen_window_start_p = 0; | ||
| 3332 | w->vscroll = 0; | ||
| 3333 | /* Reset window_list. */ | 3307 | /* Reset window_list. */ |
| 3334 | Vwindow_list = Qnil; | 3308 | Vwindow_list = Qnil; |
| 3335 | /* Return window. */ | 3309 | /* Return window. */ |