From 3e1fc7fbd10bdf5fc2d4e0c6fdb21c583d445602 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Tue, 17 Jun 2014 17:41:14 +0400 Subject: [PATCH] * lisp.h (STRING_COPYIN): Remove; unused. * ccl.c (Fccl_execute_on_string): * font.c (fon_intern_prop): Use make_specified_string. --- src/ChangeLog | 3 +++ src/ccl.c | 7 ++----- src/font.c | 6 ++---- src/lisp.h | 6 ------ 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 82ab1e6254..177cfab160 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -3,10 +3,13 @@ * fileio.c (Fread_file_name): Do not pass redundant args and ... * callint.c (read_file_name): ... convert to static here. * lisp.h (Fread_file_name): Do not EXFUN it. + (STRING_COPYIN): Remove; unused. * composite.c (CHAR_COMPOSABLE_P): Replace unsafe macro with ... (char_composable_p): ... static function. All users changed. * eval.c (toplevel): Remove redundant #include directives. * xterm.c (x_initialize): Add static to match prototype. + * ccl.c (Fccl_execute_on_string): + * font.c (fon_intern_prop): Use make_specified_string. 2014-06-16 Paul Eggert diff --git a/src/ccl.c b/src/ccl.c index 187f602701..54093bf567 100644 --- a/src/ccl.c +++ b/src/ccl.c @@ -2160,11 +2160,8 @@ usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBY ASET (status, i, make_number (ccl.reg[i])); ASET (status, 8, make_number (ccl.ic)); - if (NILP (unibyte_p)) - val = make_multibyte_string ((char *) outbuf, produced_chars, - outp - outbuf); - else - val = make_unibyte_string ((char *) outbuf, produced_chars); + val = make_specified_string ((const char *) outbuf, produced_chars, + outp - outbuf, NILP (unibyte_p)); xfree (outbuf); return val; diff --git a/src/font.c b/src/font.c index 6113e1c3e7..9e472fb3e3 100644 --- a/src/font.c +++ b/src/font.c @@ -279,10 +279,8 @@ font_intern_prop (const char *str, ptrdiff_t len, bool force_symbol) if (SYMBOLP (tem)) return tem; - if (len == nchars || len != nbytes) - tem = make_unibyte_string (str, len); - else - tem = make_multibyte_string (str, nchars, len); + tem = make_specified_string (str, nchars, len, + len != nchars && len == nbytes); return Fintern (tem, obarray); } diff --git a/src/lisp.h b/src/lisp.h index e28a415152..72ae5a1afd 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1197,12 +1197,6 @@ STRING_SET_CHARS (Lisp_Object string, ptrdiff_t newsize) { XSTRING (string)->size = newsize; } -INLINE void -STRING_COPYIN (Lisp_Object string, ptrdiff_t index, char const *new, - ptrdiff_t count) -{ - memcpy (SDATA (string) + index, new, count); -} /* Header of vector-like objects. This documents the layout constraints on vectors and pseudovectors (objects of PVEC_xxx subtype). It also prevents -- 2.20.1