aboutsummaryrefslogtreecommitdiffstats
path: root/src/fileio.c
diff options
context:
space:
mode:
authorDmitry Antipov2012-07-20 11:29:04 +0400
committerDmitry Antipov2012-07-20 11:29:04 +0400
commitd7ea76b4f34c4e2c43bf0b1deeedde354ca540f7 (patch)
treeac3cb2ab6d00e89542afc9a5290191e549ce1d81 /src/fileio.c
parent765e61e391ee0937ff6b30510b6c4651064fe38e (diff)
downloademacs-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/fileio.c')
-rw-r--r--src/fileio.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 185dd650438..a13fe94e416 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -159,8 +159,7 @@ report_file_error (const char *string, Lisp_Object data)
159 159
160 synchronize_system_messages_locale (); 160 synchronize_system_messages_locale ();
161 str = strerror (errorno); 161 str = strerror (errorno);
162 errstring = code_convert_string_norecord (make_unibyte_string (str, 162 errstring = code_convert_string_norecord (build_unibyte_string (str),
163 strlen (str)),
164 Vlocale_coding_system, 0); 163 Vlocale_coding_system, 0);
165 164
166 while (1) 165 while (1)
@@ -1658,7 +1657,7 @@ those `/' is discarded. */)
1658 env variables twice should be acceptable. Note that 1657 env variables twice should be acceptable. Note that
1659 decoding may cause a garbage collect. */ 1658 decoding may cause a garbage collect. */
1660 Lisp_Object orig, decoded; 1659 Lisp_Object orig, decoded;
1661 orig = make_unibyte_string (o, strlen (o)); 1660 orig = build_unibyte_string (o);
1662 decoded = DECODE_FILE (orig); 1661 decoded = DECODE_FILE (orig);
1663 total += SBYTES (decoded); 1662 total += SBYTES (decoded);
1664 substituted = 1; 1663 substituted = 1;