summaryrefslogtreecommitdiff
path: root/Build/source/texk/xdvik
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2013-07-01 13:44:15 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2013-07-01 13:44:15 +0000
commitbe7181525a93d0b7499364115803130a18c1939d (patch)
tree223cad58108f466ee075c7aed65a88691f03d1f0 /Build/source/texk/xdvik
parent3d887290087ac01c8dddf9422088e5e2a26798da (diff)
Eliminate use of BSD string functions (bcopy etc)
git-svn-id: svn://tug.org/texlive/trunk@31058 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/xdvik')
-rw-r--r--Build/source/texk/xdvik/ChangeLog6
-rw-r--r--Build/source/texk/xdvik/font-open.c8
-rw-r--r--Build/source/texk/xdvik/psdps.c12
-rw-r--r--Build/source/texk/xdvik/psgs.c2
-rw-r--r--Build/source/texk/xdvik/xdvi.h7
5 files changed, 17 insertions, 18 deletions
diff --git a/Build/source/texk/xdvik/ChangeLog b/Build/source/texk/xdvik/ChangeLog
index 33849b80a20..e652c0b35ce 100644
--- a/Build/source/texk/xdvik/ChangeLog
+++ b/Build/source/texk/xdvik/ChangeLog
@@ -1,3 +1,9 @@
+2013-07-01 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * font-open.c, psdps.c, xdvi.h: Replace bcopy(f, t, l) =>
+ memcpy(t, f, l).
+ * psgs.c: Replace rindex() => strrchr().
+
2013-06-28 Peter Breitenlohner <peb@mppmu.mpg.de>
* xlwradioP.h: May need to #include <X11/Xaw/XawInit.h>.
diff --git a/Build/source/texk/xdvik/font-open.c b/Build/source/texk/xdvik/font-open.c
index d0a3cef062f..61ef08d9c12 100644
--- a/Build/source/texk/xdvik/font-open.c
+++ b/Build/source/texk/xdvik/font-open.c
@@ -971,7 +971,7 @@ get_gs_token(struct gsfile *gsfp,
unsigned int len = gsfp->bufpos - p0;
if (pos + len >= ffline_len) expandline(pos + len);
- bcopy(p0, ffline + pos, len);
+ memmove(ffline + pos, p0, len);
pos += len;
if (!gs_fillbuf(gsfp))
break;
@@ -981,7 +981,7 @@ get_gs_token(struct gsfile *gsfp,
unsigned int len = gsfp->bufpos - p0;
if (pos + len >= ffline_len) expandline(pos + len);
- bcopy(p0, ffline + pos, len);
+ memmove(ffline + pos, p0, len);
pos += len;
break;
}
@@ -1001,7 +1001,7 @@ get_gs_token(struct gsfile *gsfp,
unsigned int len = gsfp->bufpos - p0;
if (pos + len >= ffline_len) expandline(pos + len);
- bcopy(p0, ffline + pos, len);
+ memmove(ffline + pos, p0, len);
pos += len;
if (!gs_fillbuf(gsfp)) {
TRACE_FT((stderr,
@@ -1041,7 +1041,7 @@ get_gs_token(struct gsfile *gsfp,
if (pos + len >= ffline_len)
expandline(pos + len);
- bcopy(p0, ffline + pos, len);
+ memmove(ffline + pos, p0, len);
pos += len;
gsfp->bufpos = p1 + 1;
break;
diff --git a/Build/source/texk/xdvik/psdps.c b/Build/source/texk/xdvik/psdps.c
index e77c88091bc..466eb59bce0 100644
--- a/Build/source/texk/xdvik/psdps.c
+++ b/Build/source/texk/xdvik/psdps.c
@@ -189,7 +189,7 @@ TextProc(DPSContext ctxt, char *buf, unsigned long count)
i = line + BUFLEN - linepos;
if (i > count)
i = count;
- (void)bcopy(buf, linepos, i);
+ memmove(linepos, buf, i);
linepos += i;
buf += i;
count -= i;
@@ -202,7 +202,7 @@ TextProc(DPSContext ctxt, char *buf, unsigned long count)
p = memchr(p0, '\n', linepos - p0);
if (p == NULL) {
if (p0 != line) {
- (void)bcopy(p0, line, linepos - p0);
+ memmove(line, p0, linepos - p0);
linepos -= p0 - line;
}
else if (linepos == line + BUFLEN) {
@@ -213,7 +213,7 @@ TextProc(DPSContext ctxt, char *buf, unsigned long count)
printf("DPS: %s\n", line);
line[LINELEN] = c;
linepos -= LINELEN;
- (void)bcopy(line + LINELEN, line, linepos - line);
+ memmove(line, line + LINELEN, linepos - line);
}
break;
}
@@ -224,7 +224,7 @@ TextProc(DPSContext ctxt, char *buf, unsigned long count)
if (globals.debug & DBG_PS)
printf("Got DPS ack; %d pending.\n", DPS_pending);
++p;
- (void)bcopy(p, p - 9, linepos - p);
+ memmove(p, p - 9, p, linepos - p);
linepos -= 9;
continue;
}
@@ -233,7 +233,7 @@ TextProc(DPSContext ctxt, char *buf, unsigned long count)
if (globals.debug & DBG_PS)
puts("Got DPS int.");
++p;
- (void)bcopy(p, p - 9, linepos - p);
+ memmove(p - 9, p, linepos - p);
linepos -= 9;
globals.ev.flags |= EV_ACK;
continue;
@@ -242,7 +242,7 @@ TextProc(DPSContext ctxt, char *buf, unsigned long count)
if (globals.debug & DBG_PS)
puts("Got DPS int 2.");
++p;
- (void)bcopy(p, p - 9, linepos - p);
+ memmove(p - 9, p, linepos - p);
linepos -= 9;
DPS_pending = 3;
diff --git a/Build/source/texk/xdvik/psgs.c b/Build/source/texk/xdvik/psgs.c
index 3881c0c2b07..a5d22776e2d 100644
--- a/Build/source/texk/xdvik/psgs.c
+++ b/Build/source/texk/xdvik/psgs.c
@@ -268,7 +268,7 @@ read_from_gs(int fd, void *data)
--p;
}
*line_end = '\0';
- p = rindex(linepos, '\n');
+ p = strrchr(linepos, '\n');
if (p != NULL) {
++p;
showto(p);
diff --git a/Build/source/texk/xdvik/xdvi.h b/Build/source/texk/xdvik/xdvi.h
index 2851f7e7d87..3112655a1e1 100644
--- a/Build/source/texk/xdvik/xdvi.h
+++ b/Build/source/texk/xdvik/xdvi.h
@@ -201,13 +201,6 @@ extern unsigned long time_start, time_end;
#include <string.h>
-#ifdef VMS
-# define index strchr
-# define rindex strrchr
-# define bzero(a, b) (void) memset ((void *) (a), 0, (size_t) (b))
-# define bcopy(a, b, c) (void) memmove ((void *) (b), (void *) (a), (size_t) (c))
-#endif
-
#include <stdio.h>
#include <setjmp.h>