diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2010-06-29 05:55:38 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2010-06-29 05:55:38 +0000 |
commit | bdf53553f3a1a1ec4fe32b4eb661f54b326d4dc4 (patch) | |
tree | 5401ab51a7ab707e2c9f8ec50403e82576e9e4a0 /usr.bin | |
parent | a8513a0222af62280ad0380a2efdcbe0c97fd2f9 (diff) |
Replace "nice" strcmp() wrapper macro with strcmp.
ok jsing
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tip/remote.c | 4 | ||||
-rw-r--r-- | usr.bin/tip/tip.c | 14 | ||||
-rw-r--r-- | usr.bin/tip/tip.h | 4 | ||||
-rw-r--r-- | usr.bin/tip/value.c | 9 |
4 files changed, 15 insertions, 16 deletions
diff --git a/usr.bin/tip/remote.c b/usr.bin/tip/remote.c index 2592221b525..e57c9c68787 100644 --- a/usr.bin/tip/remote.c +++ b/usr.bin/tip/remote.c @@ -1,4 +1,4 @@ -/* $OpenBSD: remote.c,v 1.18 2009/10/27 23:59:44 deraadt Exp $ */ +/* $OpenBSD: remote.c,v 1.19 2010/06/29 05:55:37 nicm Exp $ */ /* $NetBSD: remote.c,v 1.5 1997/04/20 00:02:45 mellon Exp $ */ /* @@ -139,7 +139,7 @@ getremcap(char *host) * from the description file */ if (!HW) - HW = (CU == NULL) || (DU && equal(DV, CU)); + HW = (CU == NULL) || (DU && strcmp(DV, CU) == 0); HO = host; /* * see if uppercase mode should be turned on initially diff --git a/usr.bin/tip/tip.c b/usr.bin/tip/tip.c index c45aea0f1fe..a96783271c1 100644 --- a/usr.bin/tip/tip.c +++ b/usr.bin/tip/tip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tip.c,v 1.38 2009/12/12 18:26:23 nicm Exp $ */ +/* $OpenBSD: tip.c,v 1.39 2010/06/29 05:55:37 nicm Exp $ */ /* $NetBSD: tip.c,v 1.13 1997/04/20 00:03:05 mellon Exp $ */ /* @@ -59,7 +59,7 @@ main(int argc, char *argv[]) /* XXX preserve previous braindamaged behavior */ setboolean(value(DC), TRUE); - if (equal(__progname, "cu")) { + if (strcmp(__progname, "cu") == 0) { cumode = 1; cumain(argc, argv); goto cucommon; @@ -538,7 +538,7 @@ setparity(char *defparity) if (value(PARITY) == NULL) value(PARITY) = defparity; parity = value(PARITY); - if (equal(parity, "none")) { + if (strcmp(parity, "none") == 0) { bits8 = 1; return; } @@ -546,13 +546,13 @@ setparity(char *defparity) flip = 0; clr = 0377; set = 0; - if (equal(parity, "odd")) + if (strcmp(parity, "odd") == 0) flip = 0200; /* reverse bit 7 */ - else if (equal(parity, "zero")) + else if (strcmp(parity, "zero") == 0) clr = 0177; /* turn off bit 7 */ - else if (equal(parity, "one")) + else if (strcmp(parity, "one") == 0) set = 0200; /* turn on bit 7 */ - else if (!equal(parity, "even")) { + else if (strcmp(parity, "even") != 0) { (void) fprintf(stderr, "%s: unknown parity value\r\n", parity); (void) fflush(stderr); } diff --git a/usr.bin/tip/tip.h b/usr.bin/tip/tip.h index 055c2ce0d7a..1665c5695dd 100644 --- a/usr.bin/tip/tip.h +++ b/usr.bin/tip/tip.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tip.h,v 1.33 2009/12/12 18:14:00 nicm Exp $ */ +/* $OpenBSD: tip.h,v 1.34 2010/06/29 05:55:37 nicm Exp $ */ /* $NetBSD: tip.h,v 1.7 1997/04/20 00:02:46 mellon Exp $ */ /* @@ -137,8 +137,6 @@ typedef } acu_t; -#define equal(a, b) (strcmp(a,b)==0)/* A nice function to string compare */ - /* * variable manipulation stuff -- * if we defined the value entry in value_t, then we couldn't diff --git a/usr.bin/tip/value.c b/usr.bin/tip/value.c index 646116ca127..f27849e7718 100644 --- a/usr.bin/tip/value.c +++ b/usr.bin/tip/value.c @@ -1,4 +1,4 @@ -/* $OpenBSD: value.c,v 1.18 2009/10/27 23:59:45 deraadt Exp $ */ +/* $OpenBSD: value.c,v 1.19 2010/06/29 05:55:37 nicm Exp $ */ /* $NetBSD: value.c,v 1.6 1997/02/11 09:24:09 mrg Exp $ */ /* @@ -100,7 +100,7 @@ vassign(value_t *p, char *v) switch (p->v_type&TMASK) { case STRING: - if (p->v_value && equal(p->v_value, v)) + if (p->v_value && strcmp(p->v_value, v) == 0) return; if (!(p->v_type&(ENVIRON|INIT))) free(p->v_value); @@ -134,7 +134,7 @@ vlex(char *s) value_t *p; char *cp; - if (equal(s, "all")) { + if (strcmp(s, "all") == 0) { for (p = vtable; p->v_name; p++) if (vaccess(p->v_access, READ)) vprint(p); @@ -257,7 +257,8 @@ vlookup(char *s) value_t *p; for (p = vtable; p->v_name; p++) - if (equal(p->v_name, s) || (p->v_abrev && equal(p->v_abrev, s))) + if (strcmp(p->v_name, s) == 0 || + (p->v_abrev && strcmp(p->v_abrev, s) == 0)) return (p); return (NULL); } |