aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2014-09-30 08:31:18 -0700
committerPaul Eggert2014-09-30 08:31:18 -0700
commitfe0a52e6e676e0eb4525bf473fb669490f7315a2 (patch)
tree63f99da843022b16f139f6dd3956e0a7bbca660b
parent699aeb00d4cf6278ba59e9b1e845df20fe3cd791 (diff)
downloademacs-fe0a52e6e676e0eb4525bf473fb669490f7315a2.tar.gz
emacs-fe0a52e6e676e0eb4525bf473fb669490f7315a2.zip
* xterm.c (x_term_init): Allocate temps on stack, not on heap.
-rw-r--r--src/ChangeLog2
-rw-r--r--src/xterm.c17
2 files changed, 9 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 761303a0471..47c43f66915 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,7 @@
12014-09-30 Paul Eggert <eggert@cs.ucla.edu> 12014-09-30 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * xterm.c (x_term_init): Allocate temps on stack, not on heap.
4
3 * frame.c (x_set_frame_parameters): Port --enable-gcc-warnings 5 * frame.c (x_set_frame_parameters): Port --enable-gcc-warnings
4 to Ubuntu 14.04.1 x86-64. 6 to Ubuntu 14.04.1 x86-64.
5 7
diff --git a/src/xterm.c b/src/xterm.c
index 8a0e28a2e1a..f9d95984415 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -11062,11 +11062,11 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
11062 }; 11062 };
11063 11063
11064 int i; 11064 int i;
11065 const int atom_count = ARRAYELTS (atom_refs); 11065 enum { atom_count = ARRAYELTS (atom_refs) };
11066 /* 1 for _XSETTINGS_SN */ 11066 /* 1 for _XSETTINGS_SN. */
11067 const int total_atom_count = 1 + atom_count; 11067 enum { total_atom_count = 1 + atom_count };
11068 Atom *atoms_return = xmalloc (total_atom_count * sizeof *atoms_return); 11068 Atom atoms_return[total_atom_count];
11069 char **atom_names = xmalloc (total_atom_count * sizeof *atom_names); 11069 char *atom_names[total_atom_count];
11070 static char const xsettings_fmt[] = "_XSETTINGS_S%d"; 11070 static char const xsettings_fmt[] = "_XSETTINGS_S%d";
11071 char xsettings_atom_name[sizeof xsettings_fmt - 2 11071 char xsettings_atom_name[sizeof xsettings_fmt - 2
11072 + INT_STRLEN_BOUND (int)]; 11072 + INT_STRLEN_BOUND (int)];
@@ -11074,7 +11074,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
11074 for (i = 0; i < atom_count; i++) 11074 for (i = 0; i < atom_count; i++)
11075 atom_names[i] = (char *) atom_refs[i].name; 11075 atom_names[i] = (char *) atom_refs[i].name;
11076 11076
11077 /* Build _XSETTINGS_SN atom name */ 11077 /* Build _XSETTINGS_SN atom name. */
11078 sprintf (xsettings_atom_name, xsettings_fmt, 11078 sprintf (xsettings_atom_name, xsettings_fmt,
11079 XScreenNumberOfScreen (dpyinfo->screen)); 11079 XScreenNumberOfScreen (dpyinfo->screen));
11080 atom_names[i] = xsettings_atom_name; 11080 atom_names[i] = xsettings_atom_name;
@@ -11085,11 +11085,8 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
11085 for (i = 0; i < atom_count; i++) 11085 for (i = 0; i < atom_count; i++)
11086 *(Atom *) ((char *) dpyinfo + atom_refs[i].offset) = atoms_return[i]; 11086 *(Atom *) ((char *) dpyinfo + atom_refs[i].offset) = atoms_return[i];
11087 11087
11088 /* Manual copy of last atom */ 11088 /* Manually copy last atom. */
11089 dpyinfo->Xatom_xsettings_sel = atoms_return[i]; 11089 dpyinfo->Xatom_xsettings_sel = atoms_return[i];
11090
11091 xfree (atom_names);
11092 xfree (atoms_return);
11093 } 11090 }
11094 11091
11095 dpyinfo->x_dnd_atoms_size = 8; 11092 dpyinfo->x_dnd_atoms_size = 8;