diff options
| author | Dmitry Antipov | 2012-07-20 11:29:04 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-07-20 11:29:04 +0400 |
| commit | d7ea76b4f34c4e2c43bf0b1deeedde354ca540f7 (patch) | |
| tree | ac3cb2ab6d00e89542afc9a5290191e549ce1d81 /src/dosfns.c | |
| parent | 765e61e391ee0937ff6b30510b6c4651064fe38e (diff) | |
| download | emacs-d7ea76b4f34c4e2c43bf0b1deeedde354ca540f7.tar.gz emacs-d7ea76b4f34c4e2c43bf0b1deeedde354ca540f7.zip | |
Simple wrapper for make_unibyte_string, adjust font_open_by_name.
* src/lisp.h (build_unibyte_string): New function.
* src/dosfns.c, src/fileio.c, src/fns.c, src/ftfont.c, src/process.c:
* src/sysdep.c, src/w32fns.c, src/xfns.c: Use it.
* src/font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
of type Lisp_Object to avoid redundant calls to make_unibyte_string.
Adjust users accordingly.
* src/font.h (font_open_by_name): Adjust prototype.
* admin/coccinelle/unibyte_string.cocci: Semantic patch to convert from
make_unibyte_string to build_unibyte_string where appropriate.
Diffstat (limited to 'src/dosfns.c')
| -rw-r--r-- | src/dosfns.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dosfns.c b/src/dosfns.c index ee28801e841..6fd1b52e252 100644 --- a/src/dosfns.c +++ b/src/dosfns.c | |||
| @@ -562,7 +562,7 @@ system_process_attributes (Lisp_Object pid) | |||
| 562 | attrs = Fcons (Fcons (Qgroup, build_string (gr->gr_name)), attrs); | 562 | attrs = Fcons (Fcons (Qgroup, build_string (gr->gr_name)), attrs); |
| 563 | strcpy (cmd, basename (__crt0_argv[0])); | 563 | strcpy (cmd, basename (__crt0_argv[0])); |
| 564 | /* Command name is encoded in locale-coding-system; decode it. */ | 564 | /* Command name is encoded in locale-coding-system; decode it. */ |
| 565 | cmd_str = make_unibyte_string (cmd, strlen (cmd)); | 565 | cmd_str = build_unibyte_string (cmd); |
| 566 | decoded_cmd = code_convert_string_norecord (cmd_str, | 566 | decoded_cmd = code_convert_string_norecord (cmd_str, |
| 567 | Vlocale_coding_system, 0); | 567 | Vlocale_coding_system, 0); |
| 568 | attrs = Fcons (Fcons (Qcomm, decoded_cmd), attrs); | 568 | attrs = Fcons (Fcons (Qcomm, decoded_cmd), attrs); |
| @@ -630,7 +630,7 @@ system_process_attributes (Lisp_Object pid) | |||
| 630 | q[-1] = '\0'; | 630 | q[-1] = '\0'; |
| 631 | 631 | ||
| 632 | /* Command line is encoded in locale-coding-system; decode it. */ | 632 | /* Command line is encoded in locale-coding-system; decode it. */ |
| 633 | cmd_str = make_unibyte_string (cmdline, strlen (cmdline)); | 633 | cmd_str = build_unibyte_string (cmdline); |
| 634 | decoded_cmd = code_convert_string_norecord (cmd_str, | 634 | decoded_cmd = code_convert_string_norecord (cmd_str, |
| 635 | Vlocale_coding_system, 0); | 635 | Vlocale_coding_system, 0); |
| 636 | xfree (cmdline); | 636 | xfree (cmdline); |