mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-06-14 12:31:25 +00:00
Make X_ERROR_MESSAGE_SIZE dependency more explicit
This avoids an alloca in x_set_mouse_color. * src/xfns.c (x_set_mouse_color): Use local array rather than alloca, since the string is small. * src/xterm.c (X_ERROR_MESSAGE_SIZE): Move defn from here ... * src/xterm.h: ... to here, and make it an enum not a macro.
This commit is contained in:
parent
2dbfed0532
commit
a8b9fad897
3 changed files with 5 additions and 6 deletions
|
|
@ -1398,10 +1398,9 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
|
|||
if (x_had_errors_p (dpy))
|
||||
{
|
||||
const char *bad_cursor_name = NULL;
|
||||
/* Bounded by X_ERROR_MESSAGE_SIZE in xterm.c. */
|
||||
size_t message_length = strlen (cursor_data.error_string);
|
||||
char *xmessage = alloca (1 + message_length);
|
||||
memcpy (xmessage, cursor_data.error_string, message_length);
|
||||
char xmessage[X_ERROR_MESSAGE_SIZE];
|
||||
eassert (strlen (cursor_data.error_string) < sizeof xmessage);
|
||||
strcpy (xmessage, cursor_data.error_string);
|
||||
|
||||
x_uncatch_errors_after_check ();
|
||||
|
||||
|
|
|
|||
|
|
@ -26321,8 +26321,6 @@ x_unwind_errors_to (int depth)
|
|||
x_uncatch_errors ();
|
||||
}
|
||||
|
||||
#define X_ERROR_MESSAGE_SIZE 200
|
||||
|
||||
/* An X error handler which stores the error message in the first
|
||||
applicable handler in the x_error_message stack. This is called
|
||||
from *x_error_handler if an x_catch_errors for DISPLAY is in
|
||||
|
|
|
|||
|
|
@ -129,6 +129,8 @@ typedef GtkWidget *xt_or_gtk_widget;
|
|||
#include "dispextern.h"
|
||||
#include "termhooks.h"
|
||||
|
||||
enum { X_ERROR_MESSAGE_SIZE = 200 };
|
||||
|
||||
INLINE_HEADER_BEGIN
|
||||
|
||||
/* Black and white pixel values for the screen which frame F is on. */
|
||||
|
|
|
|||
Loading…
Reference in a new issue