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/frame.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/frame.c')
| -rw-r--r-- | src/frame.c | 58 |
1 files changed, 8 insertions, 50 deletions
diff --git a/src/frame.c b/src/frame.c index fc52b07923d..b048327abfb 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -267,63 +267,23 @@ make_frame (int mini_p) | |||
| 267 | f = allocate_frame (); | 267 | f = allocate_frame (); |
| 268 | XSETFRAME (frame, f); | 268 | XSETFRAME (frame, f); |
| 269 | 269 | ||
| 270 | f->desired_matrix = 0; | 270 | /* Initialize Lisp data. Note that allocate_frame initializes all |
| 271 | f->current_matrix = 0; | 271 | Lisp data to nil, so do it only for slots which should not be nil. */ |
| 272 | f->desired_pool = 0; | 272 | f->tool_bar_position = Qtop; |
| 273 | f->current_pool = 0; | 273 | |
| 274 | f->glyphs_initialized_p = 0; | 274 | /* Initialize non-Lisp data. Note that allocate_frame zeroes out all |
| 275 | f->decode_mode_spec_buffer = 0; | 275 | non-Lisp data, so do it only for slots which should not be zero. |
| 276 | f->visible = 0; | 276 | To avoid subtle bugs and for the sake of readability, it's better to |
| 277 | f->async_visible = 0; | 277 | initialize enum members explicitly even if their values are zero. */ |
| 278 | f->output_data.nothing = 0; | ||
| 279 | f->iconified = 0; | ||
| 280 | f->async_iconified = 0; | ||
| 281 | f->wants_modeline = 1; | 278 | f->wants_modeline = 1; |
| 282 | f->auto_raise = 0; | ||
| 283 | f->auto_lower = 0; | ||
| 284 | f->no_split = 0; | ||
| 285 | f->garbaged = 1; | 279 | f->garbaged = 1; |
| 286 | f->has_minibuffer = mini_p; | 280 | f->has_minibuffer = mini_p; |
| 287 | f->focus_frame = Qnil; | ||
| 288 | f->explicit_name = 0; | ||
| 289 | f->can_have_scroll_bars = 0; | ||
| 290 | f->vertical_scroll_bar_type = vertical_scroll_bar_none; | 281 | f->vertical_scroll_bar_type = vertical_scroll_bar_none; |
| 291 | f->param_alist = Qnil; | ||
| 292 | f->scroll_bars = Qnil; | ||
| 293 | f->condemned_scroll_bars = Qnil; | ||
| 294 | f->face_alist = Qnil; | ||
| 295 | f->face_cache = NULL; | ||
| 296 | f->menu_bar_items = Qnil; | ||
| 297 | f->menu_bar_vector = Qnil; | ||
| 298 | f->menu_bar_items_used = 0; | ||
| 299 | f->buffer_predicate = Qnil; | ||
| 300 | f->buffer_list = Qnil; | ||
| 301 | f->buried_buffer_list = Qnil; | ||
| 302 | f->namebuf = 0; | ||
| 303 | f->title = Qnil; | ||
| 304 | f->menu_bar_window = Qnil; | ||
| 305 | f->tool_bar_window = Qnil; | ||
| 306 | f->tool_bar_items = Qnil; | ||
| 307 | f->tool_bar_position = Qtop; | ||
| 308 | f->desired_tool_bar_string = f->current_tool_bar_string = Qnil; | ||
| 309 | f->n_tool_bar_items = 0; | ||
| 310 | f->left_fringe_width = f->right_fringe_width = 0; | ||
| 311 | f->fringe_cols = 0; | ||
| 312 | f->menu_bar_lines = 0; | ||
| 313 | f->tool_bar_lines = 0; | ||
| 314 | f->scroll_bar_actual_width = 0; | ||
| 315 | f->border_width = 0; | ||
| 316 | f->internal_border_width = 0; | ||
| 317 | f->column_width = 1; /* !FRAME_WINDOW_P value */ | 282 | f->column_width = 1; /* !FRAME_WINDOW_P value */ |
| 318 | f->line_height = 1; /* !FRAME_WINDOW_P value */ | 283 | f->line_height = 1; /* !FRAME_WINDOW_P value */ |
| 319 | f->x_pixels_diff = f->y_pixels_diff = 0; | ||
| 320 | #ifdef HAVE_WINDOW_SYSTEM | 284 | #ifdef HAVE_WINDOW_SYSTEM |
| 321 | f->want_fullscreen = FULLSCREEN_NONE; | 285 | f->want_fullscreen = FULLSCREEN_NONE; |
| 322 | #endif | 286 | #endif |
| 323 | f->size_hint_flags = 0; | ||
| 324 | f->win_gravity = 0; | ||
| 325 | f->font_driver_list = NULL; | ||
| 326 | f->font_data_list = NULL; | ||
| 327 | 287 | ||
| 328 | root_window = make_window (); | 288 | root_window = make_window (); |
| 329 | if (mini_p) | 289 | if (mini_p) |
| @@ -399,8 +359,6 @@ make_frame (int mini_p) | |||
| 399 | ++window_select_count; | 359 | ++window_select_count; |
| 400 | XSETFASTINT (XWINDOW (f->selected_window)->use_time, window_select_count); | 360 | XSETFASTINT (XWINDOW (f->selected_window)->use_time, window_select_count); |
| 401 | 361 | ||
| 402 | f->default_face_done_p = 0; | ||
| 403 | |||
| 404 | return f; | 362 | return f; |
| 405 | } | 363 | } |
| 406 | 364 | ||