diff options
| author | Dmitry Antipov | 2015-01-20 13:24:09 +0300 |
|---|---|---|
| committer | Dmitry Antipov | 2015-01-20 13:24:09 +0300 |
| commit | f9775f21fcddd3d3715cb3249090d99322488a45 (patch) | |
| tree | b8efeeec110b5db69aefd44aee4cc94656e66b64 /src | |
| parent | d13fc2913d7c106f3c78e16fa2961678b8f9c472 (diff) | |
| download | emacs-f9775f21fcddd3d3715cb3249090d99322488a45.tar.gz emacs-f9775f21fcddd3d3715cb3249090d99322488a45.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/nsfont.m | 2 | ||||
| -rw-r--r-- | src/nsterm.m | 2 | ||||
| -rw-r--r-- | src/w32fns.c | 2 | ||||
| -rw-r--r-- | src/xfns.c | 6 |
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 @@ | |||
| 1 | 2015-01-20 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | Prefer xlispstrdup to avoid dumb calls to strlen. | ||
| 4 | * nsfont.m (ns_get_family): | ||
| 5 | * nsterm.m (ns_term_init): | ||
| 6 | * w32fns.c (w32_window): | ||
| 7 | * xfns.c (x_window, Fx_select_font): Use xlispstrdup. | ||
| 8 | |||
| 1 | 2015-01-20 Paul Eggert <eggert@cs.ucla.edu> | 9 | 2015-01-20 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 10 | ||
| 3 | Correct an old fix for GTK font selection | 11 | 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) | |||
| 93 | return nil; | 93 | return nil; |
| 94 | else | 94 | else |
| 95 | { | 95 | { |
| 96 | char *tmp = xstrdup (SSDATA (SYMBOL_NAME (tem))); | 96 | char *tmp = xlispstrdup (SYMBOL_NAME (tem)); |
| 97 | NSString *family; | 97 | NSString *family; |
| 98 | ns_unescape_name (tmp); | 98 | ns_unescape_name (tmp); |
| 99 | family = [NSString stringWithUTF8String: tmp]; | 99 | 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) | |||
| 4313 | 4313 | ||
| 4314 | dpyinfo->name_list_element = Fcons (display_name, Qnil); | 4314 | dpyinfo->name_list_element = Fcons (display_name, Qnil); |
| 4315 | 4315 | ||
| 4316 | terminal->name = xstrdup (SSDATA (display_name)); | 4316 | terminal->name = xlispstrdup (display_name); |
| 4317 | 4317 | ||
| 4318 | unblock_input (); | 4318 | unblock_input (); |
| 4319 | 4319 | ||
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) | |||
| 4208 | for the window manager, so GC relocation won't bother it. | 4208 | for the window manager, so GC relocation won't bother it. |
| 4209 | 4209 | ||
| 4210 | Elsewhere we specify the window name for the window manager. */ | 4210 | Elsewhere we specify the window name for the window manager. */ |
| 4211 | f->namebuf = xstrdup (SSDATA (Vx_resource_name)); | 4211 | f->namebuf = xlispstrdup (Vx_resource_name); |
| 4212 | 4212 | ||
| 4213 | my_create_window (f); | 4213 | my_create_window (f); |
| 4214 | 4214 | ||
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) | |||
| 2238 | for the window manager, so GC relocation won't bother it. | 2238 | for the window manager, so GC relocation won't bother it. |
| 2239 | 2239 | ||
| 2240 | Elsewhere we specify the window name for the window manager. */ | 2240 | Elsewhere we specify the window name for the window manager. */ |
| 2241 | f->namebuf = xstrdup (SSDATA (Vx_resource_name)); | 2241 | f->namebuf = xlispstrdup (Vx_resource_name); |
| 2242 | 2242 | ||
| 2243 | ac = 0; | 2243 | ac = 0; |
| 2244 | XtSetArg (al[ac], XtNallowShellResize, 1); ac++; | 2244 | XtSetArg (al[ac], XtNallowShellResize, 1); ac++; |
| @@ -5995,12 +5995,12 @@ nil, it defaults to the selected frame. */) | |||
| 5995 | XSETFONT (font, FRAME_FONT (f)); | 5995 | XSETFONT (font, FRAME_FONT (f)); |
| 5996 | font_param = Ffont_get (font, intern (":name")); | 5996 | font_param = Ffont_get (font, intern (":name")); |
| 5997 | if (STRINGP (font_param)) | 5997 | if (STRINGP (font_param)) |
| 5998 | default_name = xstrdup (SSDATA (font_param)); | 5998 | default_name = xlispstrdup (font_param); |
| 5999 | else | 5999 | else |
| 6000 | { | 6000 | { |
| 6001 | font_param = Fframe_parameter (frame, Qfont_param); | 6001 | font_param = Fframe_parameter (frame, Qfont_param); |
| 6002 | if (STRINGP (font_param)) | 6002 | if (STRINGP (font_param)) |
| 6003 | default_name = xstrdup (SSDATA (font_param)); | 6003 | default_name = xlispstrdup (font_param); |
| 6004 | } | 6004 | } |
| 6005 | 6005 | ||
| 6006 | font = xg_get_font (f, default_name); | 6006 | font = xg_get_font (f, default_name); |