Skip to content

Commit

Permalink
Replace btscpy with memcpy.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgiven committed Dec 8, 2024
1 parent a5c1726 commit c1c1d14
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 40 deletions.
3 changes: 0 additions & 3 deletions modules/src/em_opt/nopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ int OO_wrstats = 1; /* pattern statistics output */
#define printstate(s)
#endif /* DEBUG */

/**** WHICH IS FASTER? ****
#define BTSCPY(pp,qq,i,p,q,n) btscpy(p,q,(n)*sizeof(struct e_instr))
**************************/
#define BTSCPY(pp,qq,i,p,q,n) for(pp=(p),qq=(q),i=(n);i--;*pp++ = *qq++)

static void allocmem(void);
Expand Down
2 changes: 1 addition & 1 deletion modules/src/read_em/reade.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ static void line_line(void)
gettyp(ptyp(sp_cst2), &dummy);
EM_lineno = dummy.ema_cst;
gettyp(str_ptyp, &dummy);
btscpy(filebuf, dummy.ema_string, (int) dummy.ema_szoroff);
memcpy(filebuf, dummy.ema_string, (int) dummy.ema_szoroff);
EM_filename = filebuf;
}

Expand Down
1 change: 0 additions & 1 deletion modules/src/string/ack_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#define __ACK_STRING_INCLUDED__

char *long2str(long l, int b);
char *btscpy(char *b1, char *b2, int n);
char *bts2str(char *b, int n, char *s);

#endif /* __ACK_STRING_INCLUDED__ */
18 changes: 0 additions & 18 deletions modules/src/string/btscpy.c

This file was deleted.

2 changes: 1 addition & 1 deletion modules/src/string/build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ clibrary {
name = "lib",
srcs = {
"./bts2str.c",
"./btscpy.c","./long2str.c",
"./long2str.c",
},
hdrs = { "./ack_string.h", },
}
18 changes: 2 additions & 16 deletions modules/src/string/string.3
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
.TH STRING 3 "$Revision$"
.ad
.SH NAME
strindex, strrindex, strzero, str2bts,
long2str, str2long,
btscpy, btscat, btscmp, btszero, bts2str \- operations on and
conversions between strings and row of bytes
long2str,
bts2str \- operations on and conversions between strings and row of bytes
.SH SYNOPSIS
.nf
.B #include <ack_string.h>
.PP
.B char *long2str(long l, int b)
.PP
.B char *btscpy(char *b1, char *b2, int n)
.PP
.B char *bts2str(char *b, int n, char *s)
.fi
.SH DESCRIPTION
Expand Down Expand Up @@ -58,16 +54,6 @@ This base may be any of 2..16.
A negative base (in the range -16..-2) indicates that the long must be
seen as unsigned.
A pointer to the string is returned.
.PP
.I btscpy
copies
.I n
bytes from the string of bytes
.I b2
to
.I b1
and returns
.IR b1 .
.SH FILES
~em/modules/lib/libstring.a
.SH "SEE ALSO"
Expand Down

0 comments on commit c1c1d14

Please sign in to comment.