nightmaremail

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

commit 7959e15d7b7326fef40d64f187af87612288b78e
parent f7ec63b8edb59a179aa98e670df9aaffcd8eaf34
Author: Rolf Eike Beer <eike@sf-mail.de>
Date:   Fri, 12 Jul 2019 18:39:52 +0200

get rid of str_diffn() and use the default strncmp() instead

Diffstat:
MMakefile | 8++------
MTARGETS | 1-
Mstr.h | 2+-
Dstr_diffn.c | 18------------------
4 files changed, 3 insertions(+), 26 deletions(-)

diff --git a/Makefile b/Makefile @@ -1775,10 +1775,10 @@ scan.h fmt.h ./compile splogger.c str.a: \ -makelib str_diffn.o str_cpy.o str_chr.o \ +makelib str_cpy.o str_chr.o \ str_rchr.o str_start.o byte_chr.o byte_rchr.o byte_diff.o byte_copy.o \ byte_cr.o byte_zero.o - ./makelib str.a str_diffn.o str_cpy.o \ + ./makelib str.a str_cpy.o \ str_chr.o str_rchr.o str_start.o byte_chr.o byte_rchr.o \ byte_diff.o byte_copy.o byte_cr.o byte_zero.o @@ -1790,10 +1790,6 @@ str_cpy.o: \ compile str_cpy.c str.h ./compile str_cpy.c -str_diffn.o: \ -compile str_diffn.c str.h - ./compile str_diffn.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_diffn.o str_cpy.o str_chr.o str_rchr.o diff --git a/str.h b/str.h @@ -5,7 +5,7 @@ extern unsigned int str_copy(); #define str_diff(s,t) strcmp((s),(t)) -extern int str_diffn(); +#define str_diffn(s,t,len) strncmp((s),(t),(len)) #define str_len(s) strlen((s)) extern unsigned int str_chr(); extern unsigned int str_rchr(); diff --git a/str_diffn.c b/str_diffn.c @@ -1,18 +0,0 @@ -#include "str.h" - -int str_diffn(s,t,len) -register char *s; -register char *t; -unsigned int len; -{ - register char x; - - for (;;) { - if (!len--) return 0; x = *s; if (x != *t) break; if (!x) break; ++s; ++t; - if (!len--) return 0; x = *s; if (x != *t) break; if (!x) break; ++s; ++t; - if (!len--) return 0; x = *s; if (x != *t) break; if (!x) break; ++s; ++t; - if (!len--) return 0; x = *s; if (x != *t) break; if (!x) break; ++s; ++t; - } - return ((int)(unsigned int)(unsigned char) x) - - ((int)(unsigned int)(unsigned char) *t); -}