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> 2015-01-20 Paul Eggert <eggert@cs.ucla.edu>
   
Correct an old fix for GTK font selection Correct an old fix for GTK font selection
......
...@@ -93,7 +93,7 @@ static void ns_glyph_metrics (struct nsfont_info *font_info, ...@@ -93,7 +93,7 @@ static void ns_glyph_metrics (struct nsfont_info *font_info,
return nil; return nil;
else else
{ {
char *tmp = xstrdup (SSDATA (SYMBOL_NAME (tem))); char *tmp = xlispstrdup (SYMBOL_NAME (tem));
NSString *family; NSString *family;
ns_unescape_name (tmp); ns_unescape_name (tmp);
family = [NSString stringWithUTF8String: tmp]; family = [NSString stringWithUTF8String: tmp];
......
...@@ -4313,7 +4313,7 @@ Needs to be here because ns_initialize_display_info () uses AppKit classes. ...@@ -4313,7 +4313,7 @@ Needs to be here because ns_initialize_display_info () uses AppKit classes.
dpyinfo->name_list_element = Fcons (display_name, Qnil); dpyinfo->name_list_element = Fcons (display_name, Qnil);
terminal->name = xstrdup (SSDATA (display_name)); terminal->name = xlispstrdup (display_name);
unblock_input (); unblock_input ();
......
...@@ -4208,7 +4208,7 @@ w32_window (struct frame *f, long window_prompting, int minibuffer_only) ...@@ -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. for the window manager, so GC relocation won't bother it.
Elsewhere we specify the window name for the window manager. */ 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); my_create_window (f);
......
...@@ -2238,7 +2238,7 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only) ...@@ -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. for the window manager, so GC relocation won't bother it.
Elsewhere we specify the window name for the window manager. */ 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; ac = 0;
XtSetArg (al[ac], XtNallowShellResize, 1); ac++; XtSetArg (al[ac], XtNallowShellResize, 1); ac++;
...@@ -5995,12 +5995,12 @@ nil, it defaults to the selected frame. */) ...@@ -5995,12 +5995,12 @@ nil, it defaults to the selected frame. */)
XSETFONT (font, FRAME_FONT (f)); XSETFONT (font, FRAME_FONT (f));
font_param = Ffont_get (font, intern (":name")); font_param = Ffont_get (font, intern (":name"));
if (STRINGP (font_param)) if (STRINGP (font_param))
default_name = xstrdup (SSDATA (font_param)); default_name = xlispstrdup (font_param);
else else
{ {
font_param = Fframe_parameter (frame, Qfont_param); font_param = Fframe_parameter (frame, Qfont_param);
if (STRINGP (font_param)) if (STRINGP (font_param))
default_name = xstrdup (SSDATA (font_param)); default_name = xlispstrdup (font_param);
} }
font = xg_get_font (f, default_name); 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