diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-01-16 06:40:24 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-01-16 06:40:24 +0000 |
commit | 315054f4737a39489e0a14f3a92bff61f1592832 (patch) | |
tree | 62bf010653374ce09b6beb4dfa0414a91457233b /usr.bin/vi/common/seq.c | |
parent | 79e3d817585ca08a91e30ad14abe43e2ab70295f (diff) |
Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution. These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)
Diffstat (limited to 'usr.bin/vi/common/seq.c')
-rw-r--r-- | usr.bin/vi/common/seq.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/vi/common/seq.c b/usr.bin/vi/common/seq.c index 183b11fe517..9eb933fdc85 100644 --- a/usr.bin/vi/common/seq.c +++ b/usr.bin/vi/common/seq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: seq.c,v 1.9 2014/11/12 04:28:41 bentley Exp $ */ +/* $OpenBSD: seq.c,v 1.10 2015/01/16 06:40:14 deraadt Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -11,7 +11,6 @@ #include "config.h" -#include <sys/param.h> #include <sys/queue.h> #include <bitstring.h> @@ -24,6 +23,8 @@ #include "common.h" +#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b)) + /* * seq_set -- * Internal version to enter a sequence. @@ -195,7 +196,7 @@ seq_find(SCR *sp, SEQ **lastqp, EVENT *e_input, CHAR_T *c_input, size_t ilen, if (qp->input[0] < c_input[0] || qp->stype != stype || F_ISSET(qp, SEQ_FUNCMAP)) continue; - diff = memcmp(qp->input, c_input, MIN(qp->ilen, ilen)); + diff = memcmp(qp->input, c_input, MINIMUM(qp->ilen, ilen)); } else { if (qp->input[0] > e_input->e_c) break; @@ -203,7 +204,7 @@ seq_find(SCR *sp, SEQ **lastqp, EVENT *e_input, CHAR_T *c_input, size_t ilen, qp->stype != stype || F_ISSET(qp, SEQ_FUNCMAP)) continue; diff = - e_memcmp(qp->input, e_input, MIN(qp->ilen, ilen)); + e_memcmp(qp->input, e_input, MINIMUM(qp->ilen, ilen)); } if (diff > 0) break; |