[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r117928: * lisp.h (lispstpcpy): Rename from lispstrc
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] trunk r117928: * lisp.h (lispstpcpy): Rename from lispstrcpy, and act like stpcpy. |
Date: |
Tue, 23 Sep 2014 17:04:16 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 117928
revision-id: address@hidden
parent: address@hidden
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Tue 2014-09-23 10:03:48 -0700
message:
* lisp.h (lispstpcpy): Rename from lispstrcpy, and act like stpcpy.
All callers changed.
* xterm.c (x_term_init): Use new functionality to avoid two needs
to compute a string length.
modified:
src/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1438
src/callproc.c callproc.c-20091113204419-o5vbwnq5f7feedwu-248
src/dbusbind.c dbusbind.c-20091113204419-o5vbwnq5f7feedwu-7961
src/doc.c doc.c-20091113204419-o5vbwnq5f7feedwu-250
src/font.c font.c-20091113204419-o5vbwnq5f7feedwu-8540
src/frame.c frame.c-20091113204419-o5vbwnq5f7feedwu-243
src/lisp.h lisp.h-20091113204419-o5vbwnq5f7feedwu-253
src/process.c process.c-20091113204419-o5vbwnq5f7feedwu-462
src/w32fns.c w32fns.c-20091113204419-o5vbwnq5f7feedwu-945
src/w32proc.c w32proc.c-20091113204419-o5vbwnq5f7feedwu-814
src/xfns.c xfns.c-20091113204419-o5vbwnq5f7feedwu-274
src/xfont.c xfont.c-20091113204419-o5vbwnq5f7feedwu-8547
src/xsmfns.c xsmfns.c-20091113204419-o5vbwnq5f7feedwu-2385
src/xterm.c xterm.c-20091113204419-o5vbwnq5f7feedwu-244
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2014-09-23 16:07:23 +0000
+++ b/src/ChangeLog 2014-09-23 17:03:48 +0000
@@ -1,5 +1,10 @@
2014-09-23 Paul Eggert <address@hidden>
+ * lisp.h (lispstpcpy): Rename from lispstrcpy, and act like stpcpy.
+ All callers changed.
+ * xterm.c (x_term_init): Use new functionality to avoid two needs
+ to compute a string length.
+
* dispextern.h, xdisp.c (window_box_right_offset): Now static.
2014-09-23 Dmitry Antipov <address@hidden>
=== modified file 'src/callproc.c'
--- a/src/callproc.c 2014-09-23 15:49:00 +0000
+++ b/src/callproc.c 2014-09-23 17:03:48 +0000
@@ -1235,7 +1235,7 @@
#endif
temp = pwd_var + 4;
memcpy (pwd_var, "PWD=", 4);
- lispstrcpy (temp, current_dir);
+ lispstpcpy (temp, current_dir);
#ifndef DOS_NT
/* We can't signal an Elisp error here; we're in a vfork. Since
=== modified file 'src/dbusbind.c'
--- a/src/dbusbind.c 2014-09-23 15:49:00 +0000
+++ b/src/dbusbind.c 2014-09-23 17:03:48 +0000
@@ -761,7 +761,7 @@
&& STRINGP (CAR_SAFE (XD_NEXT_VALUE (object)))
&& NILP (CDR_SAFE (XD_NEXT_VALUE (object))))
{
- lispstrcpy (signature, CAR_SAFE (XD_NEXT_VALUE (object)));
+ lispstpcpy (signature, CAR_SAFE (XD_NEXT_VALUE (object)));
object = CDR_SAFE (XD_NEXT_VALUE (object));
}
=== modified file 'src/doc.c'
--- a/src/doc.c 2014-09-23 15:49:00 +0000
+++ b/src/doc.c 2014-09-23 17:03:48 +0000
@@ -121,7 +121,7 @@
if (minsize < 8)
minsize = 8;
name = SAFE_ALLOCA (minsize + SCHARS (file) + 8);
- lispstrcpy (name, docdir);
+ lispstpcpy (name, docdir);
strcat (name, SSDATA (file));
}
else
=== modified file 'src/font.c'
--- a/src/font.c 2014-09-23 15:49:00 +0000
+++ b/src/font.c 2014-09-23 17:03:48 +0000
@@ -4266,7 +4266,7 @@
{
if (NILP (fold_wildcards))
return font_name;
- lispstrcpy (name, font_name);
+ lispstpcpy (name, font_name);
namelen = SBYTES (font_name);
goto done;
}
=== modified file 'src/frame.c'
--- a/src/frame.c 2014-09-23 15:49:00 +0000
+++ b/src/frame.c 2014-09-23 17:03:48 +0000
@@ -4036,8 +4036,8 @@
/* Start with emacs.FRAMENAME for the name (the specific one)
and with `Emacs' for the class key (the general one). */
- lispstrcpy (name_key, Vx_resource_name);
- lispstrcpy (class_key, Vx_resource_class);
+ lispstpcpy (name_key, Vx_resource_name);
+ lispstpcpy (class_key, Vx_resource_class);
strcat (class_key, ".");
strcat (class_key, SSDATA (class));
=== modified file 'src/lisp.h'
--- a/src/lisp.h 2014-09-23 15:49:00 +0000
+++ b/src/lisp.h 2014-09-23 17:03:48 +0000
@@ -4463,12 +4463,15 @@
extern char *xlispstrdup (Lisp_Object) ATTRIBUTE_MALLOC;
extern void dupstring (char **, char const *);
-/* Like strcpy but uses known length of a Lisp string. */
+/* Make DEST a copy of STRING's data. Return a pointer to DEST's terminating
+ null byte. This is like stpcpy, except the source is a Lisp string. */
INLINE char *
-lispstrcpy (const char *dest, Lisp_Object string)
+lispstpcpy (char *dest, Lisp_Object string)
{
- return memcpy ((void *) dest, SSDATA (string), SBYTES (string) + 1);
+ ptrdiff_t len = SBYTES (string);
+ memcpy (dest, SDATA (string), len + 1);
+ return dest + len;
}
extern void xputenv (const char *);
=== modified file 'src/process.c'
--- a/src/process.c 2014-09-23 15:49:00 +0000
+++ b/src/process.c 2014-09-23 17:03:48 +0000
@@ -2989,7 +2989,7 @@
address_un.sun_family = AF_LOCAL;
if (sizeof address_un.sun_path <= SBYTES (service))
error ("Service name too long");
- lispstrcpy (address_un.sun_path, service);
+ lispstpcpy (address_un.sun_path, service);
ai.ai_addr = (struct sockaddr *) &address_un;
ai.ai_addrlen = sizeof address_un;
goto open_socket;
@@ -3680,7 +3680,7 @@
if (sizeof rq.ifr_name <= SBYTES (ifname))
error ("interface name too long");
- lispstrcpy (rq.ifr_name, ifname);
+ lispstpcpy (rq.ifr_name, ifname);
s = socket (AF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0);
if (s < 0)
=== modified file 'src/w32fns.c'
--- a/src/w32fns.c 2014-09-23 15:49:00 +0000
+++ b/src/w32fns.c 2014-09-23 17:03:48 +0000
@@ -5339,7 +5339,7 @@
{
char basename[ MAX_PATH ], *str;
- lispstrcpy (basename, Vinvocation_name);
+ lispstpcpy (basename, Vinvocation_name);
str = strrchr (basename, '.');
if (str) *str = 0;
Vinvocation_name = build_string (basename);
=== modified file 'src/w32proc.c'
--- a/src/w32proc.c 2014-09-23 15:49:00 +0000
+++ b/src/w32proc.c 2014-09-23 17:03:48 +0000
@@ -1647,7 +1647,7 @@
strcpy (cmdname, egetenv ("CMDPROXY"));
else
{
- lispstrcpy (cmdname, Vinvocation_directory);
+ lispstpcpy (cmdname, Vinvocation_directory);
strcat (cmdname, "cmdproxy.exe");
}
=== modified file 'src/xfns.c'
--- a/src/xfns.c 2014-09-23 15:49:00 +0000
+++ b/src/xfns.c 2014-09-23 17:03:48 +0000
@@ -4289,7 +4289,7 @@
int i, class = -1;
XVisualInfo vinfo;
- lispstrcpy (s, value);
+ lispstpcpy (s, value);
dash = strchr (s, '-');
if (dash)
{
=== modified file 'src/xfont.c'
--- a/src/xfont.c 2014-09-23 15:49:00 +0000
+++ b/src/xfont.c 2014-09-23 17:03:48 +0000
@@ -541,7 +541,7 @@
if (STRINGP (XCAR (alter))
&& ((r - name) + SBYTES (XCAR (alter))) < 256)
{
- lispstrcpy (r, XCAR (alter));
+ lispstpcpy (r, XCAR (alter));
list = xfont_list_pattern (display, name, registry, script);
if (! NILP (list))
break;
=== modified file 'src/xsmfns.c'
--- a/src/xsmfns.c 2014-09-23 15:49:00 +0000
+++ b/src/xsmfns.c 2014-09-23 17:03:48 +0000
@@ -418,7 +418,7 @@
emacs_program[0] = '\0';
if (! EQ (Vinvocation_directory, Qnil))
- lispstrcpy (emacs_program, Vinvocation_directory);
+ lispstpcpy (emacs_program, Vinvocation_directory);
strcat (emacs_program, SSDATA (Vinvocation_name));
/* The SM protocol says all callbacks are mandatory, so set up all
=== modified file 'src/xterm.c'
--- a/src/xterm.c 2014-09-23 15:49:00 +0000
+++ b/src/xterm.c 2014-09-23 17:03:48 +0000
@@ -10902,8 +10902,9 @@
dpyinfo->x_id = ++x_display_id;
dpyinfo->x_id_name = xmalloc (SBYTES (Vinvocation_name)
+ SBYTES (Vsystem_name) + 2);
- strcat (strcat (lispstrcpy (dpyinfo->x_id_name, Vinvocation_name), "@"),
- SSDATA (Vsystem_name));
+ char *nametail = lispstpcpy (dpyinfo->x_id_name, Vinvocation_name);
+ *nametail++ = '@';
+ lispstpcpy (nametail, Vsystem_name);
/* Figure out which modifier bits mean what. */
x_find_modifier_meanings (dpyinfo);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r117928: * lisp.h (lispstpcpy): Rename from lispstrcpy, and act like stpcpy.,
Paul Eggert <=