Move MIN() and MAX() macros to sys/params.h
This commit is contained in:
parent
60a71efca8
commit
de231a713e
26 changed files with 23 additions and 32 deletions
|
@ -7,6 +7,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
#define ptrace mdbtrace
|
||||
#include <sys/ptrace.h>
|
||||
#include "proto.h"
|
||||
|
|
|
@ -54,9 +54,6 @@
|
|||
} while (/* CONSTCOND */ 0)
|
||||
|
||||
|
||||
#ifndef MAX
|
||||
#define MAX(x,y) ((x) > (y) ? (x) : (y))
|
||||
#endif
|
||||
static void ps_letter(struct termp *, char);
|
||||
static void ps_begin(struct termp *);
|
||||
static void ps_end(struct termp *);
|
||||
|
|
|
@ -64,6 +64,9 @@ __RCSID("$NetBSD: show.c,v 1.30 2009/08/02 17:56:45 joerg Exp $");
|
|||
#if HAVE_ERR_H
|
||||
#include <err.h>
|
||||
#endif
|
||||
#if HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#include "defs.h"
|
||||
#include "lib.h"
|
||||
|
|
|
@ -91,10 +91,6 @@
|
|||
#define WRITING 1 /* copy data from user */
|
||||
#define HAVE_SCATTERED_IO 1 /* scattered I/O is now standard */
|
||||
|
||||
/* Macros. */
|
||||
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
|
||||
/* Memory is allocated in clicks. */
|
||||
#if (CHIP == INTEL)
|
||||
#define CLICK_SIZE 4096 /* unit in which memory is allocated */
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <limits.h>
|
||||
#include <stddef.h>
|
||||
#include <errno.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
#include <minix/partition.h>
|
||||
#include <minix/u64.h>
|
||||
|
|
|
@ -36,5 +36,6 @@
|
|||
#include <stddef.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
#endif
|
||||
|
|
|
@ -12,4 +12,8 @@ sys/param.h
|
|||
#define NGROUPS 8 /* max number of supplementary groups */
|
||||
#define MAXPATHLEN __MINIX_PATH_MAX
|
||||
|
||||
/* Macros for min/max. */
|
||||
#define MIN(a,b) ((/*CONSTCOND*/(a)<(b))?(a):(b))
|
||||
#define MAX(a,b) ((/*CONSTCOND*/(a)>(b))?(a):(b))
|
||||
|
||||
#endif /* __SYS_PARAM_H__ */
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include <minix/sysutil.h> /* MINIX utility library functions */
|
||||
#include <timers.h> /* watchdog timer management */
|
||||
#include <errno.h> /* return codes and error numbers */
|
||||
#include <sys/param.h>
|
||||
|
||||
/* Important kernel header files. */
|
||||
#include "config.h" /* configuration, MUST be first */
|
||||
|
|
|
@ -54,9 +54,6 @@ __RCSID("$NetBSD: bt_overflow.c,v 1.16 2008/09/11 12:58:00 joerg Exp $");
|
|||
#include <db.h>
|
||||
#include "btree.h"
|
||||
|
||||
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
|
||||
/*
|
||||
* Big key/data code.
|
||||
*
|
||||
|
|
|
@ -51,9 +51,6 @@ __RCSID("$NetBSD: bt_utils.c,v 1.13 2008/09/10 17:52:35 joerg Exp $");
|
|||
#include <db.h>
|
||||
#include "btree.h"
|
||||
|
||||
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
|
||||
/*
|
||||
* __bt_ret --
|
||||
* Build return key/data pair.
|
||||
|
|
|
@ -76,9 +76,6 @@ __RCSID("$NetBSD: hash.c,v 1.31 2009/02/12 06:35:54 lukem Exp $");
|
|||
#define _DIAGASSERT
|
||||
#endif
|
||||
|
||||
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
|
||||
static int alloc_segs(HTAB *, int);
|
||||
static int flush_meta(HTAB *);
|
||||
static int hash_access(HTAB *, ACTION, DBT *, DBT *);
|
||||
|
|
|
@ -76,9 +76,6 @@ __RCSID("$NetBSD: hash_bigkey.c,v 1.23 2009/02/12 06:33:13 lukem Exp $");
|
|||
#define _DIAGASSERT
|
||||
#endif
|
||||
|
||||
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
|
||||
static int collect_key(HTAB *, BUFHEAD *, int, DBT *, int);
|
||||
static int collect_data(HTAB *, BUFHEAD *, int, int);
|
||||
|
||||
|
|
|
@ -97,8 +97,6 @@ static BUFHEAD *newbuf(HTAB *, uint32_t, BUFHEAD *);
|
|||
#define _DIAGASSERT assert
|
||||
#endif
|
||||
|
||||
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
/*
|
||||
* We are looking for a buffer with address "addr". If prev_bp is NULL, then
|
||||
* address is a bucket index. If prev_bp is not NULL, then it points to the
|
||||
|
|
|
@ -39,10 +39,6 @@ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94";
|
|||
#endif /* LIBC_SCCS and not lint */
|
||||
#endif
|
||||
|
||||
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
|
||||
|
||||
#define _POSIX_SOURCE 1
|
||||
#define _MINIX 1
|
||||
|
||||
|
|
|
@ -4,14 +4,13 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/uio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define VECTORIO_READ 1
|
||||
#define VECTORIO_WRITE 2
|
||||
|
||||
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
|
||||
|
||||
static ssize_t vectorio_buffer(int fildes, const struct iovec *iov,
|
||||
int iovcnt, int readwrite, ssize_t totallen)
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#include <sys/param.h>
|
||||
#include "syslib.h"
|
||||
|
||||
/*===========================================================================*
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include <ansi.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
#include <regex.h>
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "super.h"
|
||||
#include <minix/vfsif.h>
|
||||
#include <assert.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
|
||||
FORWARD _PROTOTYPE( struct buf *rahead, (struct inode *rip, block_t baseblock,
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <minix/vfsif.h>
|
||||
#include <minix/syslib.h>
|
||||
#include <minix/sysutil.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
#if DEBUG
|
||||
#define dprintf(x) printf x
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
#include "proto.h"
|
||||
#include "super.h"
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
#include "const.h"
|
||||
#include "type.h"
|
||||
|
|
|
@ -49,6 +49,7 @@
|
|||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <assert.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
#include "proto.h"
|
||||
#include "const.h"
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include <assert.h>
|
||||
#include <env.h>
|
||||
#include <pagetable.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
#include "glo.h"
|
||||
#include "proto.h"
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include <assert.h>
|
||||
#include <stdint.h>
|
||||
#include <memory.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
#include "vm.h"
|
||||
#include "proto.h"
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <unistd.h>
|
||||
#include <memory.h>
|
||||
#include <assert.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
#include "proto.h"
|
||||
#include "glo.h"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* Tests for truncate(2) call family - by D.C. van Moolenbroek */
|
||||
#define _POSIX_SOURCE 1
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <assert.h>
|
||||
|
@ -12,10 +13,6 @@
|
|||
#define TESTSIZE 4096
|
||||
#define THRESHOLD 1048576
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(x,y) (((x)<(y))?(x):(y))
|
||||
#endif
|
||||
|
||||
#include "common.c"
|
||||
|
||||
_PROTOTYPE(int main, (int argc, char *argv[]));
|
||||
|
|
Loading…
Reference in a new issue