Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys expose the definitions of MIN() and MAX() in sys/param.h...



details:   https://anonhg.NetBSD.org/src/rev/9d069cc43a81
branches:  trunk
changeset: 503390:9d069cc43a81
user:      chs <chs%NetBSD.org@localhost>
date:      Mon Feb 05 10:42:40 2001 +0000

description:
expose the definitions of MIN() and MAX() in sys/param.h to the kernel
and use those in favor of a dozen copies scattered around the source tree.

diffstat:

 sys/arch/pc532/fpu/ieee_handler.c      |   6 +-----
 sys/compat/linux/common/linux_socket.c |   6 +-----
 sys/dev/ic/aic7xxx.c                   |   4 +---
 sys/dev/ic/aic7xxxvar.h                |  10 +---------
 sys/lkm/netinet/if_ipl/mln_ipl.c       |   7 +------
 sys/net/zlib.c                         |   8 ++------
 sys/netinet/fil.c                      |   7 ++-----
 sys/netinet/ip_compat.h                |   6 +-----
 sys/netinet/ip_log.c                   |   7 +------
 sys/netinet/ip_nat.c                   |   7 ++-----
 sys/netinet/ip_proxy.c                 |   8 ++------
 sys/netinet/ip_state.c                 |   8 ++------
 sys/netinet6/nd6.c                     |   3 +--
 sys/sys/param.h                        |   4 +---
 14 files changed, 19 insertions(+), 72 deletions(-)

diffs (truncated from 324 to 300 lines):

diff -r 4bde43999f58 -r 9d069cc43a81 sys/arch/pc532/fpu/ieee_handler.c
--- a/sys/arch/pc532/fpu/ieee_handler.c Mon Feb 05 06:56:45 2001 +0000
+++ b/sys/arch/pc532/fpu/ieee_handler.c Mon Feb 05 10:42:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ieee_handler.c,v 1.10 1998/09/12 19:14:58 matthias Exp $       */
+/*     $NetBSD: ieee_handler.c,v 1.11 2001/02/05 10:42:40 chs Exp $    */
 
 /* 
  * IEEE floating point support for NS32081 and NS32381 fpus.
@@ -364,10 +364,6 @@
 
 #define FETCH_CHUNK 8          /* Size of chunks to copyin */
 
-#define MAX(x,y) ((x) > (y)? (x): (y))
-#define MIN(x,y) ((x) < (y)? (x): (y))
-
-
 /* Fetch data from user space so as to validate buffer up to addr.
  * We do some read ahead (to minimise the number of copyins) but
  * we never read ahead past a page boundary incase that would not
diff -r 4bde43999f58 -r 9d069cc43a81 sys/compat/linux/common/linux_socket.c
--- a/sys/compat/linux/common/linux_socket.c    Mon Feb 05 06:56:45 2001 +0000
+++ b/sys/compat/linux/common/linux_socket.c    Mon Feb 05 10:42:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_socket.c,v 1.27 2000/12/29 20:07:53 fvdl Exp $   */
+/*     $NetBSD: linux_socket.c,v 1.28 2001/02/05 10:42:41 chs Exp $    */
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -76,10 +76,6 @@
 
 #include <compat/linux/linux_syscallargs.h>
 
-#ifndef MIN
-#define        MIN(a,b) (((a)<(b))?(a):(b))
-#endif
-
 /*
  * The calls in this file are entered either via the linux_socketcall()
  * interface or, on the Alpha, as individual syscalls.  The
diff -r 4bde43999f58 -r 9d069cc43a81 sys/dev/ic/aic7xxx.c
--- a/sys/dev/ic/aic7xxx.c      Mon Feb 05 06:56:45 2001 +0000
+++ b/sys/dev/ic/aic7xxx.c      Mon Feb 05 10:42:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aic7xxx.c,v 1.64 2001/01/22 14:30:43 jdolecek Exp $    */
+/*     $NetBSD: aic7xxx.c,v 1.65 2001/02/05 10:42:41 chs Exp $ */
 
 /*
  * Generic driver for the aic7xxx based adaptec SCSI controllers
@@ -114,8 +114,6 @@
 #include <dev/microcode/aic7xxx/aic7xxx_reg.h>
 #include <dev/microcode/aic7xxx/aic7xxx_seq.h>
 
-#define MAX(a,b) (((a) > (b)) ? (a) : (b))
-#define MIN(a,b) (((a) < (b)) ? (a) : (b))
 #define ALL_CHANNELS '\0'
 #define ALL_TARGETS_MASK 0xFFFF
 #define INITIATOR_WILDCARD     (~0)
diff -r 4bde43999f58 -r 9d069cc43a81 sys/dev/ic/aic7xxxvar.h
--- a/sys/dev/ic/aic7xxxvar.h   Mon Feb 05 06:56:45 2001 +0000
+++ b/sys/dev/ic/aic7xxxvar.h   Mon Feb 05 10:42:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aic7xxxvar.h,v 1.25 2001/01/18 20:28:17 jdolecek Exp $ */
+/*     $NetBSD: aic7xxxvar.h,v 1.26 2001/02/05 10:42:42 chs Exp $      */
 
 /*
  * Interface to the generic driver for the aic7xxx based adaptec
@@ -38,14 +38,6 @@
 #ifndef _AIC7XXX_H_
 #define _AIC7XXX_H_
 
-#ifndef MAX
-#define MAX(a,b) (((a) > (b)) ? (a) : (b))
-#endif
-
-#ifndef MIN
-#define MIN(a,b) (((a) < (b)) ? (a) : (b))
-#endif
-
 #ifndef FALSE
 #define FALSE 0
 #endif
diff -r 4bde43999f58 -r 9d069cc43a81 sys/lkm/netinet/if_ipl/mln_ipl.c
--- a/sys/lkm/netinet/if_ipl/mln_ipl.c  Mon Feb 05 06:56:45 2001 +0000
+++ b/sys/lkm/netinet/if_ipl/mln_ipl.c  Mon Feb 05 10:42:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mln_ipl.c,v 1.23 2000/05/03 11:12:04 veego Exp $       */
+/*     $NetBSD: mln_ipl.c,v 1.24 2001/02/05 10:42:42 chs Exp $ */
 
 /*
  * Copyright (C) 1993-2000 by Darren Reed.
@@ -58,11 +58,6 @@
 #define        VOP_LEASE       LEASE_CHECK
 #endif
 
-#ifndef        MIN
-#define        MIN(a,b)        (((a)<(b))?(a):(b))
-#endif
-
-
 #if NetBSD >= 199706
 int    if_ipl_lkmentry __P((struct lkm_table *, int, int));
 #else
diff -r 4bde43999f58 -r 9d069cc43a81 sys/net/zlib.c
--- a/sys/net/zlib.c    Mon Feb 05 06:56:45 2001 +0000
+++ b/sys/net/zlib.c    Mon Feb 05 10:42:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zlib.c,v 1.12 2001/01/18 20:28:20 jdolecek Exp $       */
+/*     $NetBSD: zlib.c,v 1.13 2001/02/05 10:42:43 chs Exp $    */
 /*
  * This file is derived from various .h and .c files from the zlib-1.0.4
  * distribution by Jean-loup Gailly and Mark Adler, with some additions
@@ -11,7 +11,7 @@
  * - added inflateIncomp and deflateOutputPending
  * - allow strm->next_out to be NULL, meaning discard the output
  *
- * $Id: zlib.c,v 1.12 2001/01/18 20:28:20 jdolecek Exp $
+ * $Id: zlib.c,v 1.13 2001/02/05 10:42:43 chs Exp $
  */
 
 /* 
@@ -2055,10 +2055,6 @@
 }
 #endif /* DEBUG_ZLIB */
 
-
-#define MAX(a,b) (a >= b ? a : b)
-/* the arguments must not have side effects */
-
 /* ===========================================================================
  * Initialize the various 'constant' tables. In a multi-threaded environment,
  * this function may be called by two threads concurrently, but this is
diff -r 4bde43999f58 -r 9d069cc43a81 sys/netinet/fil.c
--- a/sys/netinet/fil.c Mon Feb 05 06:56:45 2001 +0000
+++ b/sys/netinet/fil.c Mon Feb 05 10:42:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fil.c,v 1.44 2001/01/18 20:28:22 jdolecek Exp $        */
+/*     $NetBSD: fil.c,v 1.45 2001/02/05 10:42:43 chs Exp $     */
 
 /*
  * Copyright (C) 1993-2000 by Darren Reed.
@@ -9,7 +9,7 @@
  */
 #if !defined(lint)
 #if defined(__NetBSD__)
-static const char rcsid[] = "$NetBSD: fil.c,v 1.44 2001/01/18 20:28:22 jdolecek Exp $";
+static const char rcsid[] = "$NetBSD: fil.c,v 1.45 2001/02/05 10:42:43 chs Exp $";
 #else
 static const char sccsid[] = "@(#)fil.c        1.36 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: fil.c,v 2.35.2.19 2000/07/27 13:08:18 darrenr Exp";
@@ -101,9 +101,6 @@
 #   include "opt_ipfilter.h"
 #  endif
 # endif
-#ifndef        MIN
-# define       MIN(a,b)        (((a)<(b))?(a):(b))
-#endif
 #include "netinet/ipl.h"
 
 #ifndef        _KERNEL
diff -r 4bde43999f58 -r 9d069cc43a81 sys/netinet/ip_compat.h
--- a/sys/netinet/ip_compat.h   Mon Feb 05 06:56:45 2001 +0000
+++ b/sys/netinet/ip_compat.h   Mon Feb 05 10:42:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_compat.h,v 1.20 2000/06/28 02:59:32 mrg Exp $       */
+/*     $NetBSD: ip_compat.h,v 1.21 2001/02/05 10:42:45 chs Exp $       */
 
 /*
  * Copyright (C) 1993-2000 by Darren Reed.
@@ -200,10 +200,6 @@
 #define        IP6EQ(a,b)      (bcmp((char *)&(a), (char *)&(b), sizeof(a)) == 0)
 #define        IP6NEQ(a,b)     (bcmp((char *)&(a), (char *)&(b), sizeof(a)) != 0)
 
-#ifndef        MAX
-#define        MAX(a,b)        (((a) > (b)) ? (a) : (b))
-#endif
-
 /*
  * Security Options for Intenet Protocol (IPSO) as defined in RFC 1108.
  *
diff -r 4bde43999f58 -r 9d069cc43a81 sys/netinet/ip_log.c
--- a/sys/netinet/ip_log.c      Mon Feb 05 06:56:45 2001 +0000
+++ b/sys/netinet/ip_log.c      Mon Feb 05 10:42:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_log.c,v 1.11 2000/08/09 21:00:42 veego Exp $        */
+/*     $NetBSD: ip_log.c,v 1.12 2001/02/05 10:42:44 chs Exp $  */
 
 /*
  * Copyright (C) 1997-2000 by Darren Reed.
@@ -120,11 +120,6 @@
 #  include <sys/malloc.h>
 # endif
 
-# ifndef MIN
-#  define      MIN(a,b)        (((a)<(b))?(a):(b))
-# endif
-
-
 # if SOLARIS || defined(__sgi)
 extern kmutex_t        ipl_mutex;
 #  if SOLARIS
diff -r 4bde43999f58 -r 9d069cc43a81 sys/netinet/ip_nat.c
--- a/sys/netinet/ip_nat.c      Mon Feb 05 06:56:45 2001 +0000
+++ b/sys/netinet/ip_nat.c      Mon Feb 05 10:42:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_nat.c,v 1.36 2000/08/12 08:08:54 veego Exp $        */
+/*     $NetBSD: ip_nat.c,v 1.37 2001/02/05 10:42:44 chs Exp $  */
 
 /*
  * Copyright (C) 1995-2000 by Darren Reed.
@@ -11,7 +11,7 @@
  */
 #if !defined(lint)
 #if defined(__NetBSD__)
-static const char rcsid[] = "$NetBSD: ip_nat.c,v 1.36 2000/08/12 08:08:54 veego Exp $";
+static const char rcsid[] = "$NetBSD: ip_nat.c,v 1.37 2001/02/05 10:42:44 chs Exp $";
 #else
 static const char sccsid[] = "@(#)ip_nat.c     1.11 6/5/96 (C) 1995 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_nat.c,v 2.37.2.20 2000/08/08 16:01:01 darrenr Exp";
@@ -111,9 +111,6 @@
 #if (__FreeBSD_version >= 300000)
 # include <sys/malloc.h>
 #endif
-#ifndef        MIN
-# define       MIN(a,b)        (((a)<(b))?(a):(b))
-#endif
 #undef SOCKADDR_IN
 #define        SOCKADDR_IN     struct sockaddr_in
 
diff -r 4bde43999f58 -r 9d069cc43a81 sys/netinet/ip_proxy.c
--- a/sys/netinet/ip_proxy.c    Mon Feb 05 06:56:45 2001 +0000
+++ b/sys/netinet/ip_proxy.c    Mon Feb 05 10:42:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_proxy.c,v 1.22 2000/05/11 19:46:06 veego Exp $      */
+/*     $NetBSD: ip_proxy.c,v 1.23 2001/02/05 10:42:44 chs Exp $        */
 
 /*
  * Copyright (C) 1997-2000 by Darren Reed.
@@ -9,7 +9,7 @@
  */
 #if !defined(lint)
 #if defined(__NetBSD__)
-static const char rcsid[] = "$NetBSD: ip_proxy.c,v 1.22 2000/05/11 19:46:06 veego Exp $";
+static const char rcsid[] = "$NetBSD: ip_proxy.c,v 1.23 2001/02/05 10:42:44 chs Exp $";
 #else
 static const char rcsid[] = "@(#)Id: ip_proxy.c,v 2.9.2.1 2000/05/06 12:30:50 darrenr Exp";
 #endif
@@ -85,10 +85,6 @@
 #endif
 
 
-#ifndef MIN
-#define MIN(a,b)        (((a)<(b))?(a):(b))
-#endif
-
 static ap_session_t *appr_new_session __P((aproxy_t *, ip_t *,
                                           fr_info_t *, nat_t *));
 static int appr_fixseqack __P((fr_info_t *, ip_t *, ap_session_t *, int ));
diff -r 4bde43999f58 -r 9d069cc43a81 sys/netinet/ip_state.c
--- a/sys/netinet/ip_state.c    Mon Feb 05 06:56:45 2001 +0000
+++ b/sys/netinet/ip_state.c    Mon Feb 05 10:42:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_state.c,v 1.27 2000/08/09 21:00:44 veego Exp $      */
+/*     $NetBSD: ip_state.c,v 1.28 2001/02/05 10:42:44 chs Exp $        */
 
 /*
  * Copyright (C) 1995-2000 by Darren Reed.
@@ -9,7 +9,7 @@
  */
 #if !defined(lint)
 #if defined(__NetBSD__)
-static const char rcsid[] = "$NetBSD: ip_state.c,v 1.27 2000/08/09 21:00:44 veego Exp $";
+static const char rcsid[] = "$NetBSD: ip_state.c,v 1.28 2001/02/05 10:42:44 chs Exp $";
 #else
 static const char sccsid[] = "@(#)ip_state.c   1.8 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_state.c,v 2.30.2.17 2000/08/08 16:01:03 darrenr Exp";
@@ -103,10 +103,6 @@
 # endif
 #endif
 
-#ifndef        MIN
-# define       MIN(a,b)        (((a)<(b))?(a):(b))
-#endif
-
 #define        TCP_CLOSE       (TH_FIN|TH_RST)
 
 static ipstate_t **ips_table = NULL;
diff -r 4bde43999f58 -r 9d069cc43a81 sys/netinet6/nd6.c
--- a/sys/netinet6/nd6.c        Mon Feb 05 06:56:45 2001 +0000
+++ b/sys/netinet6/nd6.c        Mon Feb 05 10:42:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nd6.c,v 1.34 2001/01/17 04:05:45 itojun Exp $  */
+/*     $NetBSD: nd6.c,v 1.35 2001/02/05 10:42:45 chs Exp $     */
 /*     $KAME: nd6.c,v 1.75 2000/10/15 15:23:11 itojun Exp $    */
 
 /*
@@ -189,7 +189,6 @@
 nd6_setmtu(ifp)
        struct ifnet *ifp;
 {



Home | Main Index | Thread Index | Old Index