nightmaremail

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 3f6f81b6a15af234493af55c05948b73ef966126
parent 11047ed0a85a6afa5d147e3c5080326cfe4a5fe0
Author: Rolf Eike Beer <eike@sf-mail.de>
Date:   Thu, 14 May 2020 17:47:27 +0200

get rid of str_copy() and use the default strcpy() instead

This changes the return type, but noone ever looked at it anyway.

Diffstat:
MMakefile | 8++------
MTARGETS | 1-
Mstr.h | 2+-
Dstr_cpy.c | 16----------------
4 files changed, 3 insertions(+), 24 deletions(-)

diff --git a/Makefile b/Makefile @@ -1771,10 +1771,10 @@ scan.h fmt.h ./compile splogger.c str.a: \ -makelib str_cpy.o str_chr.o \ +makelib str_chr.o \ str_rchr.o str_start.o byte_chr.o byte_rchr.o byte_copy.o \ byte_cr.o byte_zero.o - ./makelib str.a str_cpy.o \ + ./makelib str.a \ str_chr.o str_rchr.o str_start.o byte_chr.o byte_rchr.o \ byte_copy.o byte_cr.o byte_zero.o @@ -1782,10 +1782,6 @@ str_chr.o: \ compile str_chr.c str.h ./compile str_chr.c -str_cpy.o: \ -compile str_cpy.c str.h - ./compile str_cpy.c - str_rchr.o: \ compile str_rchr.c str.h ./compile str_rchr.c diff --git a/TARGETS b/TARGETS @@ -91,7 +91,6 @@ error.o error_str.o error_temp.o error.a -str_cpy.o str_chr.o str_rchr.o str_start.o diff --git a/str.h b/str.h @@ -3,7 +3,7 @@ #include <string.h> -extern unsigned int str_copy(); +#define str_copy(s,t) strcpy((s),(t)) #define str_diff(s,t) strcmp((s),(t)) #define str_diffn(s,t,len) strncmp((s),(t),(len)) #define str_len(s) strlen((s)) diff --git a/str_cpy.c b/str_cpy.c @@ -1,16 +0,0 @@ -#include "str.h" - -unsigned int str_copy(s,t) -register char *s; -register char *t; -{ - register int len; - - len = 0; - for (;;) { - if (!(*s = *t)) return len; ++s; ++t; ++len; - if (!(*s = *t)) return len; ++s; ++t; ++len; - if (!(*s = *t)) return len; ++s; ++t; ++len; - if (!(*s = *t)) return len; ++s; ++t; ++len; - } -}