aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2013-08-15 07:41:16 +0200
committerJoakim Verona2013-08-15 07:41:16 +0200
commit31800c9173af4d2c445bb52b2c338a3f0bde5b12 (patch)
tree18ba130472110da57d198d680933c78dd2a8cb62
parent0b15597dcec4aaa6c4f35138da2471f6dd4fb003 (diff)
parent9c25330708e49ddaeb71f16a65cdc1b51be2a27d (diff)
downloademacs-31800c9173af4d2c445bb52b2c338a3f0bde5b12.tar.gz
emacs-31800c9173af4d2c445bb52b2c338a3f0bde5b12.zip
merge from trunk
-rw-r--r--src/ChangeLog9
-rw-r--r--src/image.c14
-rw-r--r--src/term.c15
-rw-r--r--src/xterm.c23
4 files changed, 20 insertions, 41 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 43e9bca061b..0d3982618b7 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
12013-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2
3 * term.c (get_named_tty, create_tty_output, tty_free_frame_resources)
4 (tty_free_frame_resources, delete_tty): Prefer eassert to emacs_abort.
5 * image.c (make_image_cache): For struct image_cache, prefer xmalloc
6 to xzalloc and so avoid redundant call to memset.
7 * xterm.c (x_term_init): Avoid unnecessary initializations of dpyinfo
8 members because it is allocated with xzalloc and so already zeroed.
9
12013-08-14 Ken Brown <kbrown@cornell.edu> 102013-08-14 Ken Brown <kbrown@cornell.edu>
2 11
3 * gmalloc.c (memalign) [CYGWIN]: Rename to emacs_memalign 12 * gmalloc.c (memalign) [CYGWIN]: Rename to emacs_memalign
diff --git a/src/image.c b/src/image.c
index f71ba211d44..8d969a6f9c6 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1360,14 +1360,12 @@ static void cache_image (struct frame *f, struct image *img);
1360struct image_cache * 1360struct image_cache *
1361make_image_cache (void) 1361make_image_cache (void)
1362{ 1362{
1363 struct image_cache *c = xzalloc (sizeof *c); 1363 struct image_cache *c = xmalloc (sizeof *c);
1364 int size; 1364
1365 1365 c->size = 50;
1366 size = 50; 1366 c->used = c->refcount = 0;
1367 c->images = xmalloc (size * sizeof *c->images); 1367 c->images = xmalloc (c->size * sizeof *c->images);
1368 c->size = size; 1368 c->buckets = xzalloc (IMAGE_CACHE_BUCKETS_SIZE * sizeof *c->buckets);
1369 size = IMAGE_CACHE_BUCKETS_SIZE * sizeof *c->buckets;
1370 c->buckets = xzalloc (size);
1371 return c; 1369 return c;
1372} 1370}
1373 1371
diff --git a/src/term.c b/src/term.c
index fb69aefbe7a..2966466aed2 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2233,8 +2233,7 @@ get_named_tty (const char *name)
2233{ 2233{
2234 struct terminal *t; 2234 struct terminal *t;
2235 2235
2236 if (!name) 2236 eassert (name);
2237 emacs_abort ();
2238 2237
2239 for (t = terminal_list; t; t = t->next_terminal) 2238 for (t = terminal_list; t; t = t->next_terminal)
2240 { 2239 {
@@ -2786,8 +2785,7 @@ create_tty_output (struct frame *f)
2786{ 2785{
2787 struct tty_output *t = xzalloc (sizeof *t); 2786 struct tty_output *t = xzalloc (sizeof *t);
2788 2787
2789 if (! FRAME_TERMCAP_P (f)) 2788 eassert (FRAME_TERMCAP_P (f));
2790 emacs_abort ();
2791 2789
2792 t->display_info = FRAME_TERMINAL (f)->display_info.tty; 2790 t->display_info = FRAME_TERMINAL (f)->display_info.tty;
2793 2791
@@ -2799,8 +2797,7 @@ create_tty_output (struct frame *f)
2799static void 2797static void
2800tty_free_frame_resources (struct frame *f) 2798tty_free_frame_resources (struct frame *f)
2801{ 2799{
2802 if (! FRAME_TERMCAP_P (f)) 2800 eassert (FRAME_TERMCAP_P (f));
2803 emacs_abort ();
2804 2801
2805 if (FRAME_FACE_CACHE (f)) 2802 if (FRAME_FACE_CACHE (f))
2806 free_frame_faces (f); 2803 free_frame_faces (f);
@@ -2815,8 +2812,7 @@ tty_free_frame_resources (struct frame *f)
2815static void 2812static void
2816tty_free_frame_resources (struct frame *f) 2813tty_free_frame_resources (struct frame *f)
2817{ 2814{
2818 if (! FRAME_TERMCAP_P (f) && ! FRAME_MSDOS_P (f)) 2815 eassert (FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f));
2819 emacs_abort ();
2820 2816
2821 if (FRAME_FACE_CACHE (f)) 2817 if (FRAME_FACE_CACHE (f))
2822 free_frame_faces (f); 2818 free_frame_faces (f);
@@ -3443,8 +3439,7 @@ delete_tty (struct terminal *terminal)
3443 if (!terminal->name) 3439 if (!terminal->name)
3444 return; 3440 return;
3445 3441
3446 if (terminal->type != output_termcap) 3442 eassert (terminal->type == output_termcap);
3447 emacs_abort ();
3448 3443
3449 tty = terminal->display_info.tty; 3444 tty = terminal->display_info.tty;
3450 3445
diff --git a/src/xterm.c b/src/xterm.c
index 703fc3cc566..f75d92109d6 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10098,33 +10098,15 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
10098 select_visual (dpyinfo); 10098 select_visual (dpyinfo);
10099 dpyinfo->cmap = DefaultColormapOfScreen (dpyinfo->screen); 10099 dpyinfo->cmap = DefaultColormapOfScreen (dpyinfo->screen);
10100 dpyinfo->root_window = RootWindowOfScreen (dpyinfo->screen); 10100 dpyinfo->root_window = RootWindowOfScreen (dpyinfo->screen);
10101 dpyinfo->client_leader_window = 0;
10102 dpyinfo->grabbed = 0;
10103 dpyinfo->reference_count = 0;
10104 dpyinfo->icon_bitmap_id = -1; 10101 dpyinfo->icon_bitmap_id = -1;
10105 dpyinfo->n_fonts = 0;
10106 dpyinfo->bitmaps = 0;
10107 dpyinfo->bitmaps_size = 0;
10108 dpyinfo->bitmaps_last = 0;
10109 dpyinfo->scratch_cursor_gc = 0;
10110 hlinfo->mouse_face_mouse_frame = 0;
10111 hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; 10102 hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
10112 hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; 10103 hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
10113 hlinfo->mouse_face_face_id = DEFAULT_FACE_ID; 10104 hlinfo->mouse_face_face_id = DEFAULT_FACE_ID;
10114 hlinfo->mouse_face_window = Qnil; 10105 hlinfo->mouse_face_window = Qnil;
10115 hlinfo->mouse_face_overlay = Qnil; 10106 hlinfo->mouse_face_overlay = Qnil;
10116 hlinfo->mouse_face_mouse_x = hlinfo->mouse_face_mouse_y = 0;
10117 hlinfo->mouse_face_defer = 0;
10118 hlinfo->mouse_face_hidden = 0;
10119 dpyinfo->x_focus_frame = 0;
10120 dpyinfo->x_focus_event_frame = 0;
10121 dpyinfo->x_highlight_frame = 0;
10122 dpyinfo->wm_type = X_WMTYPE_UNKNOWN; 10107 dpyinfo->wm_type = X_WMTYPE_UNKNOWN;
10123 10108
10124 /* See if we can construct pixel values from RGB values. */ 10109 /* See if we can construct pixel values from RGB values. */
10125 dpyinfo->red_bits = dpyinfo->blue_bits = dpyinfo->green_bits = 0;
10126 dpyinfo->red_offset = dpyinfo->blue_offset = dpyinfo->green_offset = 0;
10127
10128 if (dpyinfo->visual->class == TrueColor) 10110 if (dpyinfo->visual->class == TrueColor)
10129 { 10111 {
10130 get_bits_and_offset (dpyinfo->visual->red_mask, 10112 get_bits_and_offset (dpyinfo->visual->red_mask,
@@ -10285,14 +10267,9 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
10285 } 10267 }
10286 10268
10287 dpyinfo->x_dnd_atoms_size = 8; 10269 dpyinfo->x_dnd_atoms_size = 8;
10288 dpyinfo->x_dnd_atoms_length = 0;
10289 dpyinfo->x_dnd_atoms = xmalloc (sizeof *dpyinfo->x_dnd_atoms 10270 dpyinfo->x_dnd_atoms = xmalloc (sizeof *dpyinfo->x_dnd_atoms
10290 * dpyinfo->x_dnd_atoms_size); 10271 * dpyinfo->x_dnd_atoms_size);
10291 10272
10292 dpyinfo->net_supported_atoms = NULL;
10293 dpyinfo->nr_net_supported_atoms = 0;
10294 dpyinfo->net_supported_window = 0;
10295
10296 connection = ConnectionNumber (dpyinfo->display); 10273 connection = ConnectionNumber (dpyinfo->display);
10297 dpyinfo->connection = connection; 10274 dpyinfo->connection = connection;
10298 dpyinfo->gray 10275 dpyinfo->gray