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.
This commit is contained in:
parent
d13fc2913d
commit
f9775f21fc
5 changed files with 14 additions and 6 deletions
|
@ -1,3 +1,11 @@
|
|||
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);
|
||||
|
|
Loading…
Add table
Reference in a new issue