Commit f9775f21 authored by Dmitry Antipov's avatar Dmitry Antipov
Browse files

Prefer xlispstrdup to avoid dumb calls to strlen

* nsfont.m (ns_get_family):
* nsterm.m (ns_term_init):
* w32fns.c (w32_window):
* xfns.c (x_window, Fx_select_font): Use xlispstrdup.
parent d13fc291
2015-01-20 Dmitry Antipov <dmantipov@yandex.ru>
Prefer xlispstrdup to avoid dumb calls to strlen.
* nsfont.m (ns_get_family):
* nsterm.m (ns_term_init):
* w32fns.c (w32_window):
* xfns.c (x_window, Fx_select_font): Use xlispstrdup.
2015-01-20 Paul Eggert <eggert@cs.ucla.edu>
 
Correct an old fix for GTK font selection
......
......@@ -93,7 +93,7 @@ static void ns_glyph_metrics (struct nsfont_info *font_info,
return nil;
else
{
char *tmp = xstrdup (SSDATA (SYMBOL_NAME (tem)));
char *tmp = xlispstrdup (SYMBOL_NAME (tem));
NSString *family;
ns_unescape_name (tmp);
family = [NSString stringWithUTF8String: tmp];
......
......@@ -4313,7 +4313,7 @@ Needs to be here because ns_initialize_display_info () uses AppKit classes.
dpyinfo->name_list_element = Fcons (display_name, Qnil);
terminal->name = xstrdup (SSDATA (display_name));
terminal->name = xlispstrdup (display_name);
unblock_input ();
......
......@@ -4208,7 +4208,7 @@ w32_window (struct frame *f, long window_prompting, int minibuffer_only)
for the window manager, so GC relocation won't bother it.
Elsewhere we specify the window name for the window manager. */
f->namebuf = xstrdup (SSDATA (Vx_resource_name));
f->namebuf = xlispstrdup (Vx_resource_name);
my_create_window (f);
......
......@@ -2238,7 +2238,7 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only)
for the window manager, so GC relocation won't bother it.
Elsewhere we specify the window name for the window manager. */
f->namebuf = xstrdup (SSDATA (Vx_resource_name));
f->namebuf = xlispstrdup (Vx_resource_name);
ac = 0;
XtSetArg (al[ac], XtNallowShellResize, 1); ac++;
......@@ -5995,12 +5995,12 @@ nil, it defaults to the selected frame. */)
XSETFONT (font, FRAME_FONT (f));
font_param = Ffont_get (font, intern (":name"));
if (STRINGP (font_param))
default_name = xstrdup (SSDATA (font_param));
default_name = xlispstrdup (font_param);
else
{
font_param = Fframe_parameter (frame, Qfont_param);
if (STRINGP (font_param))
default_name = xstrdup (SSDATA (font_param));
default_name = xlispstrdup (font_param);
}
font = xg_get_font (f, default_name);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment