* lisp.h (STRING_COPYIN): Remove; unused.
authorDmitry Antipov <dmantipov@yandex.ru>
Tue, 17 Jun 2014 13:41:14 +0000 (17:41 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Tue, 17 Jun 2014 13:41:14 +0000 (17:41 +0400)
* ccl.c (Fccl_execute_on_string):
* font.c (fon_intern_prop): Use make_specified_string.

src/ChangeLog
src/ccl.c
src/font.c
src/lisp.h

index 82ab1e6..177cfab 100644 (file)
@@ -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  <eggert@cs.ucla.edu>
 
index 187f602..54093bf 100644 (file)
--- 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;
index 6113e1c..9e472fb 100644 (file)
@@ -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);
 }
 
index e28a415..72ae5a1 100644 (file)
@@ -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