From: naddy Date: Mon, 26 Oct 2015 16:31:09 +0000 (+0000) Subject: Remove the #define Strfoo() s_strfoo() redirection and move everything X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ba0a7c122c9a02767df433aeb34135c126763dae;p=openbsd Remove the #define Strfoo() s_strfoo() redirection and move everything directly to Strfoo(). Purely mechanical. ok deraadt@ --- diff --git a/bin/csh/csh.h b/bin/csh/csh.h index d111dced5b6..08ad8054ade 100644 --- a/bin/csh/csh.h +++ b/bin/csh/csh.h @@ -1,4 +1,4 @@ -/* $OpenBSD: csh.h,v 1.24 2015/10/26 16:27:04 naddy Exp $ */ +/* $OpenBSD: csh.h,v 1.25 2015/10/26 16:31:09 naddy Exp $ */ /* $NetBSD: csh.h,v 1.9 1995/03/21 09:02:40 cgd Exp $ */ /*- @@ -457,22 +457,6 @@ int lastev; /* Last event reference (default) */ Char HIST; /* history invocation character */ Char HISTSUB; /* auto-substitute character */ -/* - * strings.h: - */ -#define Strchr(a, b) s_strchr(a, b) -#define Strrchr(a, b) s_strrchr(a, b) -#define Strlcat(a, b, l) s_strlcat(a, b, l) -#define Strlcpy(a, b, l) s_strlcpy(a, b, l) -#define Strlen(a) s_strlen(a) -#define Strcmp(a, b) s_strcmp(a, b) -#define Strncmp(a, b, c) s_strncmp(a, b, c) - -#define Strspl(a, b) s_strspl(a, b) -#define Strsave(a) s_strsave(a) -#define Strend(a) s_strend(a) -#define Strstr(a, b) s_strstr(a, b) - /* * setname is a macro to save space (see sh.err.c) */ diff --git a/bin/csh/extern.h b/bin/csh/extern.h index 384711d5d9f..0c76ef724a6 100644 --- a/bin/csh/extern.h +++ b/bin/csh/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.22 2015/10/26 15:01:15 naddy Exp $ */ +/* $OpenBSD: extern.h,v 1.23 2015/10/26 16:31:09 naddy Exp $ */ /* $NetBSD: extern.h,v 1.8 1996/10/31 23:50:54 christos Exp $ */ /*- @@ -294,17 +294,17 @@ void * Calloc(size_t, size_t); /* * str.c: */ -size_t s_strlcpy(Char *, const Char *, size_t); -size_t s_strlcat(Char *, const Char *, size_t); -Char *s_strchr(Char *, int); -Char *s_strrchr(Char *, int); -Char *s_strspl(Char *, Char *); -size_t s_strlen(Char *); -int s_strcmp(Char *, Char *); -int s_strncmp(Char *, Char *, size_t); -Char *s_strsave(Char *); -Char *s_strend(Char *); -Char *s_strstr(Char *, Char *); +size_t Strlcpy(Char *, const Char *, size_t); +size_t Strlcat(Char *, const Char *, size_t); +Char *Strchr(Char *, int); +Char *Strrchr(Char *, int); +Char *Strspl(Char *, Char *); +size_t Strlen(Char *); +int Strcmp(Char *, Char *); +int Strncmp(Char *, Char *, size_t); +Char *Strsave(Char *); +Char *Strend(Char *); +Char *Strstr(Char *, Char *); Char *str2short(char *); Char **blk2short(char **); char *short2str(Char *); diff --git a/bin/csh/str.c b/bin/csh/str.c index 85c41c32c46..edf45e31188 100644 --- a/bin/csh/str.c +++ b/bin/csh/str.c @@ -1,4 +1,4 @@ -/* $OpenBSD: str.c,v 1.18 2015/10/26 16:27:04 naddy Exp $ */ +/* $OpenBSD: str.c,v 1.19 2015/10/26 16:31:09 naddy Exp $ */ /* $NetBSD: str.c,v 1.6 1995/03/21 09:03:24 cgd Exp $ */ /*- @@ -142,7 +142,7 @@ short2str(Char *src) } size_t -s_strlcpy(Char *dst, const Char *src, size_t siz) +Strlcpy(Char *dst, const Char *src, size_t siz) { Char *d = dst; const Char *s = src; @@ -168,7 +168,7 @@ s_strlcpy(Char *dst, const Char *src, size_t siz) } size_t -s_strlcat(Char *dst, const Char *src, size_t siz) +Strlcat(Char *dst, const Char *src, size_t siz) { Char *d = dst; const Char *s = src; @@ -182,7 +182,7 @@ s_strlcat(Char *dst, const Char *src, size_t siz) n = siz - dlen; if (n == 0) - return(dlen + s_strlen((Char *)s)); + return(dlen + Strlen((Char *)s)); while (*s != '\0') { if (n != 1) { *d++ = *s; @@ -196,7 +196,7 @@ s_strlcat(Char *dst, const Char *src, size_t siz) } Char * -s_strchr(Char *str, int ch) +Strchr(Char *str, int ch) { do if (*str == ch) @@ -207,7 +207,7 @@ s_strchr(Char *str, int ch) } Char * -s_strrchr(Char *str, int ch) +Strrchr(Char *str, int ch) { Char *rstr; @@ -221,7 +221,7 @@ s_strrchr(Char *str, int ch) } size_t -s_strlen(Char *str) +Strlen(Char *str) { size_t n; @@ -231,7 +231,7 @@ s_strlen(Char *str) } int -s_strcmp(Char *str1, Char *str2) +Strcmp(Char *str1, Char *str2) { for (; *str1 && *str1 == *str2; str1++, str2++) continue; @@ -251,7 +251,7 @@ s_strcmp(Char *str1, Char *str2) } int -s_strncmp(Char *str1, Char *str2, size_t n) +Strncmp(Char *str1, Char *str2, size_t n) { if (n == 0) return (0); @@ -278,7 +278,7 @@ s_strncmp(Char *str1, Char *str2, size_t n) } Char * -s_strsave(Char *s) +Strsave(Char *s) { Char *n; Char *p; @@ -294,7 +294,7 @@ s_strsave(Char *s) } Char * -s_strspl(Char *cp, Char *dp) +Strspl(Char *cp, Char *dp) { Char *ep; Char *p, *q; @@ -316,7 +316,7 @@ s_strspl(Char *cp, Char *dp) } Char * -s_strend(Char *cp) +Strend(Char *cp) { if (!cp) return (cp); @@ -326,7 +326,7 @@ s_strend(Char *cp) } Char * -s_strstr(Char *s, Char *t) +Strstr(Char *s, Char *t) { do { Char *ss = s;