diff options
author | Dmitry Antipov <[email protected]> | 2012-07-20 11:29:04 +0400 |
---|---|---|
committer | Dmitry Antipov <[email protected]> | 2012-07-20 11:29:04 +0400 |
commit | d7ea76b4f34c4e2c43bf0b1deeedde354ca540f7 (patch) | |
tree | ac3cb2ab6d00e89542afc9a5290191e549ce1d81 /src/lisp.h | |
parent | 765e61e391ee0937ff6b30510b6c4651064fe38e (diff) |
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/lisp.h')
-rw-r--r-- | src/lisp.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lisp.h b/src/lisp.h index 471b8277b8..2a59890014 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2609,6 +2609,15 @@ extern Lisp_Object make_string (const char *, ptrdiff_t); extern Lisp_Object make_formatted_string (char *, const char *, ...) ATTRIBUTE_FORMAT_PRINTF (2, 3); extern Lisp_Object make_unibyte_string (const char *, ptrdiff_t); + +/* Make unibyte string from C string when the length isn't known. */ + +static inline Lisp_Object +build_unibyte_string (const char *str) +{ + return make_unibyte_string (str, strlen (str)); +} + extern Lisp_Object make_multibyte_string (const char *, ptrdiff_t, ptrdiff_t); extern Lisp_Object make_event_array (int, Lisp_Object *); extern Lisp_Object make_uninit_string (EMACS_INT); |