summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ChangeLog8
-rw-r--r--src/nsfont.m2
-rw-r--r--src/nsterm.m2
-rw-r--r--src/w32fns.c2
-rw-r--r--src/xfns.c6
5 files changed, 14 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index b8528c27528..6257cc4277a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -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
diff --git a/src/nsfont.m b/src/nsfont.m
index f5e89d32bfc..683ab178836 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -93,7 +93,7 @@ ns_get_family (Lisp_Object font_spec)
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];
diff --git a/src/nsterm.m b/src/nsterm.m
index bf3192bf432..b07fa1c31b0 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -4313,7 +4313,7 @@ ns_term_init (Lisp_Object display_name)
dpyinfo->name_list_element = Fcons (display_name, Qnil);
- terminal->name = xstrdup (SSDATA (display_name));
+ terminal->name = xlispstrdup (display_name);
unblock_input ();
diff --git a/src/w32fns.c b/src/w32fns.c
index 2dd92ff8a3a..55e58294629 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -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);
diff --git a/src/xfns.c b/src/xfns.c
index 936c769a2de..a09e4a6df63 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -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);