From 104a9b7e3edbd88cdda0698c5c77a2ad6dafcc16 Mon Sep 17 00:00:00 2001 From: Alexander Kabaev Date: Tue, 29 Apr 2003 13:36:06 +0000 Subject: [PATCH] Deprecate machine/limits.h in favor of new sys/limits.h. Change all in-tree consumers to include Discussed on: standards@ Partially submitted by: Craig Rodrigues --- include/limits.h | 2 +- sys/alpha/include/limits.h | 68 ++--------------------------- sys/amd64/include/limits.h | 68 ++--------------------------- sys/amd64/isa/clock.c | 2 +- sys/arm/include/limits.h | 67 ++--------------------------- sys/cam/cam_ccb.h | 2 +- sys/cam/scsi/scsi_sa.c | 2 +- sys/compat/linux/linux_ipc.c | 3 +- sys/compat/linux/linux_misc.c | 3 +- sys/compat/linux/linux_socket.c | 3 +- sys/dev/atkbdc/atkbd.c | 3 +- sys/dev/atkbdc/psm.c | 2 +- sys/dev/eisa/eisaconf.c | 2 +- sys/dev/kbd/atkbd.c | 3 +- sys/dev/mca/mca_bus.c | 2 +- sys/dev/raidframe/rf_types.h | 2 +- sys/dev/ray/if_ray.c | 3 +- sys/dev/sio/sio.c | 2 +- sys/dev/sound/midi/midi.h | 2 +- sys/dev/syscons/scmouse.c | 2 +- sys/dev/usb/ukbd.c | 2 +- sys/fs/pseudofs/pseudofs_fileno.c | 3 +- sys/fs/smbfs/smbfs_vnops.c | 3 +- sys/geom/geom_dev.c | 2 +- sys/i386/include/limits.h | 67 ++--------------------------- sys/i386/isa/clock.c | 2 +- sys/ia64/include/limits.h | 71 ++++--------------------------- sys/isa/atrtc.c | 2 +- sys/isa/psm.c | 2 +- sys/kern/kern_clock.c | 2 +- sys/kern/kern_descrip.c | 3 +- sys/kern/kern_lockf.c | 3 +- sys/kern/subr_scanf.c | 2 +- sys/kern/sys_generic.c | 3 +- sys/kern/uipc_socket.c | 2 +- sys/kern/vfs_aio.c | 3 +- sys/kern/vfs_default.c | 3 +- sys/kern/vfs_extattr.c | 2 +- sys/kern/vfs_syscalls.c | 2 +- sys/kern/vfs_vnops.c | 3 +- sys/libkern/quad.h | 2 +- sys/libkern/strtol.c | 2 +- sys/libkern/strtoq.c | 2 +- sys/libkern/strtoul.c | 2 +- sys/libkern/strtouq.c | 2 +- sys/netgraph/ng_base.c | 2 +- sys/netgraph/ng_ppp.c | 3 +- sys/netinet/in_pcb.c | 3 +- sys/nfsclient/nfs_lock.c | 3 +- sys/nfsclient/nfs_vfsops.c | 3 +- sys/pc98/cbus/clock.c | 2 +- sys/pc98/cbus/pckbd.c | 2 +- sys/pc98/cbus/pcrtc.c | 2 +- sys/pc98/cbus/sio.c | 2 +- sys/pc98/pc98/clock.c | 2 +- sys/pc98/pc98/pc98kbd.c | 2 +- sys/pc98/pc98/sio.c | 2 +- sys/powerpc/include/limits.h | 70 ++---------------------------- sys/sparc64/include/limits.h | 68 ++--------------------------- sys/sys/param.h | 2 +- sys/ufs/ffs/ffs_rawread.c | 2 +- sys/ufs/ffs/ffs_vnops.c | 3 +- sys/vm/vm_glue.c | 3 +- 63 files changed, 88 insertions(+), 523 deletions(-) diff --git a/include/limits.h b/include/limits.h index ca5edb21a5aa..3f770cc3408e 100644 --- a/include/limits.h +++ b/include/limits.h @@ -125,7 +125,7 @@ #define MB_LEN_MAX 6 /* 31-bit UTF-8 */ -#include +#include #if __POSIX_VISIBLE #include diff --git a/sys/alpha/include/limits.h b/sys/alpha/include/limits.h index d45e08aee5f2..cbbcf5926796 100644 --- a/sys/alpha/include/limits.h +++ b/sys/alpha/include/limits.h @@ -38,70 +38,10 @@ #ifndef _MACHINE_LIMITS_H_ #define _MACHINE_LIMITS_H_ -#define CHAR_BIT 8 /* number of bits in a char */ - -/* - * According to ANSI (section 2.2.4.2), the values below must be usable by - * #if preprocessing directives. Additionally, the expression must have the - * same type as would an expression that is an object of the corresponding - * type converted according to the integral promotions. The subtraction for - * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an - * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). - * These numbers are for the default configuration of gcc. They work for - * some other compilers as well, but this should not be depended on. - */ -#define SCHAR_MAX 0x7f /* max value for a signed char */ -#define SCHAR_MIN (-0x7f-1) /* min value for a signed char */ - -#define UCHAR_MAX 0xffU /* max value for an unsigned char */ -#define CHAR_MAX 0x7f /* max value for a char */ -#define CHAR_MIN (-0x7f-1) /* min value for a char */ - -#define USHRT_MAX 0xffffU /* max value for an unsigned short */ -#define SHRT_MAX 0x7fff /* max value for a short */ -#define SHRT_MIN (-0x7fff-1) /* min value for a short */ - -#define UINT_MAX 0xffffffffU /* max value for an unsigned int */ -#define INT_MAX 0x7fffffff /* max value for an int */ -#define INT_MIN (-0x7fffffff-1) /* min value for an int */ - -#define ULONG_MAX 0xffffffffffffffffUL /* max for an unsigned long */ -#define LONG_MAX 0x7fffffffffffffffL /* max for a long */ -#define LONG_MIN (-0x7fffffffffffffffL-1) /* min for a long */ - -/* Long longs and longs are the same size on the alpha. */ - /* max for an unsigned long long */ -#define ULLONG_MAX 0xffffffffffffffffULL -#define LLONG_MAX 0x7fffffffffffffffLL /* max for a long long */ -#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min for a long long */ - -#if !defined(_ANSI_SOURCE) -#define SSIZE_MAX LONG_MAX /* max value for a ssize_t */ - -#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) -#define SIZE_T_MAX ULONG_MAX /* max value for a size_t */ - -#define OFF_MAX LONG_MAX /* max value for a off_t */ -#define OFF_MIN LONG_MIN /* min value for a off_t */ - -/* Quads and longs are the same on the alpha. Ensure they stay in sync. */ -#define UQUAD_MAX (ULONG_MAX) /* max value for a uquad_t */ -#define QUAD_MAX (LONG_MAX) /* max value for a quad_t */ -#define QUAD_MIN (LONG_MIN) /* min value for a quad_t */ -#endif /* !_POSIX_SOURCE && !_XOPEN_SOURCE */ -#endif /* !_ANSI_SOURCE */ - -#if (!defined(_ANSI_SOURCE)&&!defined(_POSIX_SOURCE)) || defined(_XOPEN_SOURCE) -#define LONG_BIT 64 -#define WORD_BIT 32 - -#define DBL_DIG 15 -#define DBL_MAX 1.7976931348623157E+308 -#define DBL_MIN 2.2250738585072014E-308 - -#define FLT_DIG 6 -#define FLT_MAX 3.40282347E+38F -#define FLT_MIN 1.17549435E-38F +#if __GNUC__ +#warning "machine/limits.h is deprecated. Include sys/limits.h instead." #endif +#include + #endif /* !_MACHINE_LIMITS_H_ */ diff --git a/sys/amd64/include/limits.h b/sys/amd64/include/limits.h index e740acf1f349..8a36831908f2 100644 --- a/sys/amd64/include/limits.h +++ b/sys/amd64/include/limits.h @@ -39,70 +39,10 @@ #ifndef _MACHINE_LIMITS_H_ #define _MACHINE_LIMITS_H_ -#define CHAR_BIT 8 /* number of bits in a char */ - -/* - * According to ANSI (section 2.2.4.2), the values below must be usable by - * #if preprocessing directives. Additionally, the expression must have the - * same type as would an expression that is an object of the corresponding - * type converted according to the integral promotions. The subtraction for - * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an - * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). - * These numbers are for the default configuration of gcc. They work for - * some other compilers as well, but this should not be depended on. - */ -#define SCHAR_MAX 0x7f /* max value for a signed char */ -#define SCHAR_MIN (-0x7f-1) /* min value for a signed char */ - -#define UCHAR_MAX 0xffU /* max value for an unsigned char */ -#define CHAR_MAX 0x7f /* max value for a char */ -#define CHAR_MIN (-0x7f-1) /* min value for a char */ - -#define USHRT_MAX 0xffffU /* max value for an unsigned short */ -#define SHRT_MAX 0x7fff /* max value for a short */ -#define SHRT_MIN (-0x7fff-1) /* min value for a short */ - -#define UINT_MAX 0xffffffffU /* max value for an unsigned int */ -#define INT_MAX 0x7fffffff /* max value for an int */ -#define INT_MIN (-0x7fffffff-1) /* min value for an int */ - -#define ULONG_MAX 0xffffffffffffffffUL /* max for an unsigned long */ -#define LONG_MAX 0x7fffffffffffffffL /* max for a long */ -#define LONG_MIN (-0x7fffffffffffffffL-1) /* min for a long */ - -/* Long longs and longs are the same size on the alpha. */ - /* max for an unsigned long long */ -#define ULLONG_MAX 0xffffffffffffffffULL -#define LLONG_MAX 0x7fffffffffffffffLL /* max for a long long */ -#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min for a long long */ - -#if !defined(_ANSI_SOURCE) -#define SSIZE_MAX LONG_MAX /* max value for a ssize_t */ - -#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) -#define SIZE_T_MAX ULONG_MAX /* max value for a size_t */ - -#define OFF_MAX LONG_MAX /* max value for an off_t */ -#define OFF_MIN LONG_MIN /* min value for an off_t */ - -/* Quads and longs are the same on the alpha. Ensure they stay in sync. */ -#define UQUAD_MAX (ULONG_MAX) /* max value for a uquad_t */ -#define QUAD_MAX (LONG_MAX) /* max value for a quad_t */ -#define QUAD_MIN (LONG_MIN) /* min value for a quad_t */ -#endif /* !_POSIX_SOURCE && !_XOPEN_SOURCE */ -#endif /* !_ANSI_SOURCE */ - -#if (!defined(_ANSI_SOURCE)&&!defined(_POSIX_SOURCE)) || defined(_XOPEN_SOURCE) -#define LONG_BIT 64 -#define WORD_BIT 32 - -#define DBL_DIG 15 -#define DBL_MAX 1.7976931348623157E+308 -#define DBL_MIN 2.2250738585072014E-308 - -#define FLT_DIG 6 -#define FLT_MAX 3.40282347E+38F -#define FLT_MIN 1.17549435E-38F +#if __GNUC__ +#warning "machine/limits.h is deprecated. Include sys/limits.h instead." #endif +#include + #endif /* !_MACHINE_LIMITS_H_ */ diff --git a/sys/amd64/isa/clock.c b/sys/amd64/isa/clock.c index df1b2e9d9b94..9e6c489637e3 100644 --- a/sys/amd64/isa/clock.c +++ b/sys/amd64/isa/clock.c @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -68,7 +69,6 @@ #include #include #include -#include #include #include #ifdef APIC_IO diff --git a/sys/arm/include/limits.h b/sys/arm/include/limits.h index b5e3bd1e68c7..58dac20c167c 100644 --- a/sys/arm/include/limits.h +++ b/sys/arm/include/limits.h @@ -34,72 +34,13 @@ * $FreeBSD$ */ -#ifndef _MACHINE_LIMITS_H_ +#ifndef _MACHINE_LIMITS_H_ #define _MACHINE_LIMITS_H_ -#define CHAR_BIT 8 /* number of bits in a char */ - -/* - * According to ANSI (section 2.2.4.2), the values below must be usable by - * #if preprocessing directives. Additionally, the expression must have the - * same type as would an expression that is an object of the corresponding - * type converted according to the integral promotions. The subtraction for - * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an - * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). - * These numbers are for the default configuration of gcc. They work for - * some other compilers as well, but this should not be depended on. - */ -#define SCHAR_MAX 0x7f /* max value for a signed char */ -#define SCHAR_MIN (-0x7f - 1) /* min value for a signed char */ - -#define UCHAR_MAX 0xff /* max value for an unsigned char */ - -#ifdef __CHAR_UNSIGNED__ -#define CHAR_MAX UCHAR_MAX /* max value for a char */ -#define CHAR_MIN 0 /* min value for a char */ -#else -#define CHAR_MAX SCHAR_MAX /* max value for a char */ -#define CHAR_MIN SCHAR_MIN /* min value for a char */ +#if __GNUC__ +#warning "machine/limits.h is deprecated. Include sys/limits.h instead." #endif -#define USHRT_MAX 0xffff /* max value for an unsigned short */ -#define SHRT_MAX 0x7fff /* max value for a short */ -#define SHRT_MIN (-0x7fff - 1) /* min value for a short */ - -#define UINT_MAX 0xffffffffU /* max value for an unsigned int */ -#define INT_MAX 0x7fffffff /* max value for an int */ -#define INT_MIN (-0x7fffffff - 1) /* min value for an int */ - -/* Bad hack for gcc configured to give 64-bit longs. */ -#ifdef _LARGE_LONG -#define ULONG_MAX 0xffffffffffffffffUL -#define LONG_MAX 0x7fffffffffffffffL -#define LONG_MIN (-0x7fffffffffffffffL - 1) -#else -#define ULONG_MAX 0xffffffffUL /* max value for an unsigned long */ -#define LONG_MAX 0x7fffffffL /* max value for a long */ -#define LONG_MIN (-0x7fffffffL - 1) /* min value for a long */ -#endif - - /* max value for an unsigned long long */ -#define ULLONG_MAX 0xffffffffffffffffULL -#define LLONG_MAX 0x7fffffffffffffffLL /* max value for a long long */ -#define LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */ - -#if !defined(_ANSI_SOURCE) -#define SSIZE_MAX INT_MAX /* max value for a ssize_t */ - -#if !defined(_POSIX_SOURCE) -#define SIZE_T_MAX UINT_MAX /* max value for a size_t */ - -#define OFF_MAX LLONG_MAX /* max value for a off_t */ -#define OFF_MIN LLONG_MIN /* min value for a off_t */ - -/* Quads and long longs are the same size. Ensure they stay in sync. */ -#define UQUAD_MAX ULLONG_MAX /* max value for a uquad_t */ -#define QUAD_MAX LLONG_MAX /* max value for a quad_t */ -#define QUAD_MIN LLONG_MIN /* min value for a quad_t */ -#endif /* !_POSIX_SOURCE */ -#endif /* !_ANSI_SOURCE */ +#include #endif /* !_MACHINE_LIMITS_H_ */ diff --git a/sys/cam/cam_ccb.h b/sys/cam/cam_ccb.h index 431fbb3b3cf4..706bbf93e230 100644 --- a/sys/cam/cam_ccb.h +++ b/sys/cam/cam_ccb.h @@ -35,7 +35,7 @@ #include #include #ifdef CAM_NEW_TRAN_CODE -#include +#include #endif /* CAM_NEW_TRAN_CODE */ #ifndef _KERNEL #include diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c index e81b110c5b73..a7e40b6f2264 100644 --- a/sys/cam/scsi/scsi_sa.c +++ b/sys/cam/scsi/scsi_sa.c @@ -38,13 +38,13 @@ #include #include #include +#include #include #include #ifdef _KERNEL #include #endif #include -#include #ifndef _KERNEL #include diff --git a/sys/compat/linux/linux_ipc.c b/sys/compat/linux/linux_ipc.c index 64a496c4294a..92fa13d40c24 100644 --- a/sys/compat/linux/linux_ipc.c +++ b/sys/compat/linux/linux_ipc.c @@ -32,12 +32,11 @@ #include #include #include +#include #include #include #include -#include - #include #include #include diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 28ab2b32135e..ab0abec51ab8 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -65,8 +66,6 @@ #include #include -#include - #include #include diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index e9dcb4b336cd..a521048b4df2 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -62,8 +63,6 @@ #include #include -#include - static int do_sa_get(struct sockaddr **, const struct osockaddr *, int *, struct malloc_type *); static int linux_to_bsd_domain(int); diff --git a/sys/dev/atkbdc/atkbd.c b/sys/dev/atkbdc/atkbd.c index e4414c59fd7f..46cd64276177 100644 --- a/sys/dev/atkbdc/atkbd.c +++ b/sys/dev/atkbdc/atkbd.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -167,8 +168,6 @@ atkbd_timeout(void *arg) /* LOW-LEVEL */ -#include - #define ATKBD_DEFAULT 0 typedef struct atkbd_state { diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index 968491d346e4..afb66ba7af02 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -77,7 +77,7 @@ #include #include -#include +#include #include #include diff --git a/sys/dev/eisa/eisaconf.c b/sys/dev/eisa/eisaconf.c index 2b306eb04ca8..0f8f8f2ce3fd 100644 --- a/sys/dev/eisa/eisaconf.c +++ b/sys/dev/eisa/eisaconf.c @@ -36,12 +36,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include diff --git a/sys/dev/kbd/atkbd.c b/sys/dev/kbd/atkbd.c index e4414c59fd7f..46cd64276177 100644 --- a/sys/dev/kbd/atkbd.c +++ b/sys/dev/kbd/atkbd.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -167,8 +168,6 @@ atkbd_timeout(void *arg) /* LOW-LEVEL */ -#include - #define ATKBD_DEFAULT 0 typedef struct atkbd_state { diff --git a/sys/dev/mca/mca_bus.c b/sys/dev/mca/mca_bus.c index 2550dc14e139..13bdc0841e5a 100644 --- a/sys/dev/mca/mca_bus.c +++ b/sys/dev/mca/mca_bus.c @@ -38,10 +38,10 @@ #include #include #include +#include #include #include -#include #include #include #include diff --git a/sys/dev/raidframe/rf_types.h b/sys/dev/raidframe/rf_types.h index 3f388fc01168..25630eff3bf5 100644 --- a/sys/dev/raidframe/rf_types.h +++ b/sys/dev/raidframe/rf_types.h @@ -64,8 +64,8 @@ */ #include +#include #include -#include #if BYTE_ORDER == BIG_ENDIAN #define RF_IS_BIG_ENDIAN 1 diff --git a/sys/dev/ray/if_ray.c b/sys/dev/ray/if_ray.c index daf897058906..3ca2b5fed059 100644 --- a/sys/dev/ray/if_ray.c +++ b/sys/dev/ray/if_ray.c @@ -243,6 +243,7 @@ #include #include +#include #include #include @@ -263,8 +264,6 @@ #include #include -#include - #include #include "card_if.h" diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 2a3d8acdb3ef..c448716e06ba 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include @@ -73,7 +74,6 @@ #include -#include #include #include diff --git a/sys/dev/sound/midi/midi.h b/sys/dev/sound/midi/midi.h index 086765423a8f..9ba9c952366f 100644 --- a/sys/dev/sound/midi/midi.h +++ b/sys/dev/sound/midi/midi.h @@ -62,7 +62,7 @@ #include #include #include /* for DELAY */ -#include +#include #include #include #include diff --git a/sys/dev/syscons/scmouse.c b/sys/dev/syscons/scmouse.c index 0c4ba2cdb457..2b3a77b16235 100644 --- a/sys/dev/syscons/scmouse.c +++ b/sys/dev/syscons/scmouse.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -41,7 +42,6 @@ #include #include #include -#include #include diff --git a/sys/dev/usb/ukbd.c b/sys/dev/usb/ukbd.c index 775a04d27ac9..a16d799e0c44 100644 --- a/sys/dev/usb/ukbd.c +++ b/sys/dev/usb/ukbd.c @@ -51,6 +51,7 @@ #include #include #include +#include #if __FreeBSD_version >= 500014 #include #else @@ -235,7 +236,6 @@ ukbd_intr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status) DRIVER_MODULE(ukbd, uhub, ukbd_driver, ukbd_devclass, ukbd_driver_load, 0); -#include #define UKBD_DEFAULT 0 diff --git a/sys/fs/pseudofs/pseudofs_fileno.c b/sys/fs/pseudofs/pseudofs_fileno.c index 4341e236fa9a..24848b338287 100644 --- a/sys/fs/pseudofs/pseudofs_fileno.c +++ b/sys/fs/pseudofs/pseudofs_fileno.c @@ -31,13 +31,12 @@ #include #include #include +#include #include #include #include #include -#include - #include #include diff --git a/sys/fs/smbfs/smbfs_vnops.c b/sys/fs/smbfs/smbfs_vnops.c index 19b099aa8922..20bd9c633d72 100644 --- a/sys/fs/smbfs/smbfs_vnops.c +++ b/sys/fs/smbfs/smbfs_vnops.c @@ -42,10 +42,9 @@ #include #include #include +#include #include -#include - #include #include diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c index cb4e377d8107..b090d753b56e 100644 --- a/sys/geom/geom_dev.c +++ b/sys/geom/geom_dev.c @@ -47,9 +47,9 @@ #include #include #include +#include #include #include -#include static d_open_t g_dev_open; static d_close_t g_dev_close; diff --git a/sys/i386/include/limits.h b/sys/i386/include/limits.h index 13ea13973348..58dac20c167c 100644 --- a/sys/i386/include/limits.h +++ b/sys/i386/include/limits.h @@ -34,72 +34,13 @@ * $FreeBSD$ */ -#ifndef _MACHINE_LIMITS_H_ +#ifndef _MACHINE_LIMITS_H_ #define _MACHINE_LIMITS_H_ -#define CHAR_BIT 8 /* number of bits in a char */ - -/* - * According to ANSI (section 2.2.4.2), the values below must be usable by - * #if preprocessing directives. Additionally, the expression must have the - * same type as would an expression that is an object of the corresponding - * type converted according to the integral promotions. The subtraction for - * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an - * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). - * These numbers are for the default configuration of gcc. They work for - * some other compilers as well, but this should not be depended on. - */ -#define SCHAR_MAX 0x7f /* max value for a signed char */ -#define SCHAR_MIN (-0x7f - 1) /* min value for a signed char */ - -#define UCHAR_MAX 0xff /* max value for an unsigned char */ - -#ifdef __CHAR_UNSIGNED__ -#define CHAR_MAX UCHAR_MAX /* max value for a char */ -#define CHAR_MIN 0 /* min value for a char */ -#else -#define CHAR_MAX SCHAR_MAX /* max value for a char */ -#define CHAR_MIN SCHAR_MIN /* min value for a char */ +#if __GNUC__ +#warning "machine/limits.h is deprecated. Include sys/limits.h instead." #endif -#define USHRT_MAX 0xffff /* max value for an unsigned short */ -#define SHRT_MAX 0x7fff /* max value for a short */ -#define SHRT_MIN (-0x7fff - 1) /* min value for a short */ - -#define UINT_MAX 0xffffffffU /* max value for an unsigned int */ -#define INT_MAX 0x7fffffff /* max value for an int */ -#define INT_MIN (-0x7fffffff - 1) /* min value for an int */ - -/* Bad hack for gcc configured to give 64-bit longs. */ -#ifdef _LARGE_LONG -#define ULONG_MAX 0xffffffffffffffffUL -#define LONG_MAX 0x7fffffffffffffffL -#define LONG_MIN (-0x7fffffffffffffffL - 1) -#else -#define ULONG_MAX 0xffffffffUL /* max value for an unsigned long */ -#define LONG_MAX 0x7fffffffL /* max value for a long */ -#define LONG_MIN (-0x7fffffffL - 1) /* min value for a long */ -#endif - - /* max value for an unsigned long long */ -#define ULLONG_MAX 0xffffffffffffffffULL -#define LLONG_MAX 0x7fffffffffffffffLL /* max value for a long long */ -#define LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */ - -#if !defined(_ANSI_SOURCE) -#define SSIZE_MAX INT_MAX /* max value for a ssize_t */ - -#if !defined(_POSIX_SOURCE) -#define SIZE_T_MAX UINT_MAX /* max value for a size_t */ - -#define OFF_MAX LLONG_MAX /* max value for an off_t */ -#define OFF_MIN LLONG_MIN /* min value for an off_t */ - -/* Quads and long longs are the same size. Ensure they stay in sync. */ -#define UQUAD_MAX ULLONG_MAX /* max value for a uquad_t */ -#define QUAD_MAX LLONG_MAX /* max value for a quad_t */ -#define QUAD_MIN LLONG_MIN /* min value for a quad_t */ -#endif /* !_POSIX_SOURCE */ -#endif /* !_ANSI_SOURCE */ +#include #endif /* !_MACHINE_LIMITS_H_ */ diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c index df1b2e9d9b94..9e6c489637e3 100644 --- a/sys/i386/isa/clock.c +++ b/sys/i386/isa/clock.c @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -68,7 +69,6 @@ #include #include #include -#include #include #include #ifdef APIC_IO diff --git a/sys/ia64/include/limits.h b/sys/ia64/include/limits.h index b694386cd1af..7dc0de73937d 100644 --- a/sys/ia64/include/limits.h +++ b/sys/ia64/include/limits.h @@ -36,68 +36,13 @@ * @(#)limits.h 8.3 (Berkeley) 1/4/94 */ -#define CHAR_BIT 8 /* number of bits in a char */ +#ifndef _MACHINE_LIMITS_H_ +#define _MACHINE_LIMITS_H_ -/* - * According to ANSI (section 2.2.4.2), the values below must be usable by - * #if preprocessing directives. Additionally, the expression must have the - * same type as would an expression that is an object of the corresponding - * type converted according to the integral promotions. The subtraction for - * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an - * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). - * These numbers are for the default configuration of gcc. They work for - * some other compilers as well, but this should not be depended on. - */ -#define SCHAR_MAX 0x7f /* max value for a signed char */ -#define SCHAR_MIN (-0x7f-1) /* min value for a signed char */ - -#define UCHAR_MAX 0xffU /* max value for an unsigned char */ -#define CHAR_MAX 0x7f /* max value for a char */ -#define CHAR_MIN (-0x7f-1) /* min value for a char */ - -#define USHRT_MAX 0xffffU /* max value for an unsigned short */ -#define SHRT_MAX 0x7fff /* max value for a short */ -#define SHRT_MIN (-0x7fff-1) /* min value for a short */ - -#define UINT_MAX 0xffffffffU /* max value for an unsigned int */ -#define INT_MAX 0x7fffffff /* max value for an int */ -#define INT_MIN (-0x7fffffff-1) /* min value for an int */ - -#define ULONG_MAX 0xffffffffffffffffUL /* max for an unsigned long */ -#define LONG_MAX 0x7fffffffffffffffL /* max for a long */ -#define LONG_MIN (-0x7fffffffffffffffL-1) /* min for a long */ - -/* Long longs and longs are the same size on the IA-64. */ - /* max for an unsigned long long */ -#define ULLONG_MAX 0xffffffffffffffffULL -#define LLONG_MAX 0x7fffffffffffffffLL /* max for a long long */ -#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min for a long long */ - -#if !defined(_ANSI_SOURCE) -#define SSIZE_MAX LONG_MAX /* max value for a ssize_t */ - -#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) -#define SIZE_T_MAX ULONG_MAX /* max value for a size_t */ - -#define OFF_MAX LONG_MAX /* max value for an off_t */ -#define OFF_MIN LONG_MIN /* min value for an off_t */ - -/* Quads and longs are the same. Ensure they stay in sync. */ -#define UQUAD_MAX (ULONG_MAX) /* max value for a uquad_t */ -#define QUAD_MAX (LONG_MAX) /* max value for a quad_t */ -#define QUAD_MIN (LONG_MIN) /* min value for a quad_t */ -#endif /* !_POSIX_SOURCE && !_XOPEN_SOURCE */ -#endif /* !_ANSI_SOURCE */ - -#if (!defined(_ANSI_SOURCE)&&!defined(_POSIX_SOURCE)) || defined(_XOPEN_SOURCE) -#define LONG_BIT 64 -#define WORD_BIT 32 - -#define DBL_DIG 15 -#define DBL_MAX 1.7976931348623157E+308 -#define DBL_MIN 2.2250738585072014E-308 - -#define FLT_DIG 6 -#define FLT_MAX 3.40282347E+38F -#define FLT_MIN 1.17549435E-38F +#if __GNUC__ +#warning "machine/limits.h is deprecated. Include sys/limits.h instead." #endif + +#include + +#endif /* !_MACHINE_LIMITS_H_ */ diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c index df1b2e9d9b94..9e6c489637e3 100644 --- a/sys/isa/atrtc.c +++ b/sys/isa/atrtc.c @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -68,7 +69,6 @@ #include #include #include -#include #include #include #ifdef APIC_IO diff --git a/sys/isa/psm.c b/sys/isa/psm.c index 968491d346e4..afb66ba7af02 100644 --- a/sys/isa/psm.c +++ b/sys/isa/psm.c @@ -77,7 +77,7 @@ #include #include -#include +#include #include #include diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index 3d04cf0eeab5..0482d53f34f9 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -60,10 +60,10 @@ #include #include #include +#include #include #include -#include #ifdef GPROF #include diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 0d0297457047..6975d0ec3179 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -67,8 +68,6 @@ #include #include -#include - #include #include #include diff --git a/sys/kern/kern_lockf.c b/sys/kern/kern_lockf.c index 7a7379b393d7..ca2ba302fe07 100644 --- a/sys/kern/kern_lockf.c +++ b/sys/kern/kern_lockf.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -52,8 +53,6 @@ #include #include -#include - /* * This variable controls the maximum number of processes that will * be checked in doing deadlock detection. diff --git a/sys/kern/subr_scanf.c b/sys/kern/subr_scanf.c index f204f1906c24..675f14565260 100644 --- a/sys/kern/subr_scanf.c +++ b/sys/kern/subr_scanf.c @@ -42,7 +42,7 @@ #include #include #include -#include +#include /* * Note that stdarg.h and the ANSI style va_start macro is used for both diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index c26cf47dcee1..98506f39a3d3 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -69,8 +70,6 @@ #include #include -#include - static MALLOC_DEFINE(M_IOCTLOPS, "ioctlops", "ioctl data buffer"); static MALLOC_DEFINE(M_SELECT, "select", "select() buffer"); MALLOC_DEFINE(M_IOV, "iov", "large iov's"); diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 7c13722f8a7a..f50f59f502ac 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -63,7 +64,6 @@ #include -#include #ifdef INET static int do_setopt_accept_filter(struct socket *so, struct sockopt *sopt); diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index ddfda949c2fa..f9a3fbe26235 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -56,8 +57,6 @@ #include #include -#include - #include "opt_vfs_aio.h" /* diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 556c37e621ab..7e3f295cc37a 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -53,8 +54,6 @@ #include #include -#include - #include #include #include diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index 21b2046c9bfb..5d41208b8dd7 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -70,7 +71,6 @@ #include #include -#include #include #include diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 21b2046c9bfb..5d41208b8dd7 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -70,7 +71,6 @@ #include #include -#include #include #include diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index a01733fe8fcd..589a372fbea4 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -61,8 +62,6 @@ #include #include -#include - static fo_rdwr_t vn_read; static fo_rdwr_t vn_write; static fo_ioctl_t vn_ioctl; diff --git a/sys/libkern/quad.h b/sys/libkern/quad.h index a2566e2f94d1..0e48e1232db8 100644 --- a/sys/libkern/quad.h +++ b/sys/libkern/quad.h @@ -59,8 +59,8 @@ #include #include +#include #include -#include /* * Depending on the desired operation, we view a `long long' (aka quad_t) in diff --git a/sys/libkern/strtol.c b/sys/libkern/strtol.c index f645cb5dfd82..9fb5e367fb68 100644 --- a/sys/libkern/strtol.c +++ b/sys/libkern/strtol.c @@ -41,7 +41,7 @@ #include #include #include -#include +#include /* * Convert a string to a long integer. diff --git a/sys/libkern/strtoq.c b/sys/libkern/strtoq.c index a1bb4ffc7511..fa070815509c 100644 --- a/sys/libkern/strtoq.c +++ b/sys/libkern/strtoq.c @@ -39,7 +39,7 @@ #include #include #include -#include +#include /* * Convert a string to a quad integer. diff --git a/sys/libkern/strtoul.c b/sys/libkern/strtoul.c index b5973ef8a686..c9ca8e4040fe 100644 --- a/sys/libkern/strtoul.c +++ b/sys/libkern/strtoul.c @@ -41,7 +41,7 @@ #include #include #include -#include +#include /* * Convert a string to an unsigned long integer. diff --git a/sys/libkern/strtouq.c b/sys/libkern/strtouq.c index 7b6ca1a9087c..f80f2b48a460 100644 --- a/sys/libkern/strtouq.c +++ b/sys/libkern/strtouq.c @@ -39,7 +39,7 @@ #include #include #include -#include +#include /* * Convert a string to an unsigned quad integer. diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index 786eecd56e8e..8135c6e821f2 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -56,7 +57,6 @@ #include #include #include -#include #include diff --git a/sys/netgraph/ng_ppp.c b/sys/netgraph/ng_ppp.c index 6dfa4a4ac74b..a11335fa37cc 100644 --- a/sys/netgraph/ng_ppp.c +++ b/sys/netgraph/ng_ppp.c @@ -47,14 +47,13 @@ #include #include #include +#include #include #include #include #include #include -#include - #include #include #include diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 316977c3a08f..4f46ca6d8fbc 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -39,6 +39,7 @@ #include #include +#include #include #include #include @@ -50,8 +51,6 @@ #include #include -#include - #include #include diff --git a/sys/nfsclient/nfs_lock.c b/sys/nfsclient/nfs_lock.c index 550a133ddb6a..ac0f3817b34b 100644 --- a/sys/nfsclient/nfs_lock.c +++ b/sys/nfsclient/nfs_lock.c @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include /* for hz */ +#include #include #include #include /* for hz */ /* Must come after sys/malloc.h */ @@ -48,8 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index acef9ea6fd43..8764b2b0677e 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -74,8 +75,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - MALLOC_DEFINE(M_NFSREQ, "NFS req", "NFS request header"); MALLOC_DEFINE(M_NFSBIGFH, "NFSV3 bigfh", "NFS version 3 file handle"); MALLOC_DEFINE(M_NFSDIROFF, "NFSV3 diroff", "NFS directory offset data"); diff --git a/sys/pc98/cbus/clock.c b/sys/pc98/cbus/clock.c index 29cee686b138..bc03ea6a0b6b 100644 --- a/sys/pc98/cbus/clock.c +++ b/sys/pc98/cbus/clock.c @@ -59,6 +59,7 @@ #include #include #include +#include #include #include #include @@ -72,7 +73,6 @@ #include #include #include -#include #include #include #ifdef APIC_IO diff --git a/sys/pc98/cbus/pckbd.c b/sys/pc98/cbus/pckbd.c index 60e01a423473..37fe6d258400 100644 --- a/sys/pc98/cbus/pckbd.c +++ b/sys/pc98/cbus/pckbd.c @@ -263,7 +263,7 @@ pckbd_timeout(void *arg) /* LOW-LEVEL */ -#include +#include #define PC98KBD_DEFAULT 0 diff --git a/sys/pc98/cbus/pcrtc.c b/sys/pc98/cbus/pcrtc.c index 29cee686b138..bc03ea6a0b6b 100644 --- a/sys/pc98/cbus/pcrtc.c +++ b/sys/pc98/cbus/pcrtc.c @@ -59,6 +59,7 @@ #include #include #include +#include #include #include #include @@ -72,7 +73,6 @@ #include #include #include -#include #include #include #ifdef APIC_IO diff --git a/sys/pc98/cbus/sio.c b/sys/pc98/cbus/sio.c index a9213eec67c3..b571fefa4d46 100644 --- a/sys/pc98/cbus/sio.c +++ b/sys/pc98/cbus/sio.c @@ -119,6 +119,7 @@ #include #include #include +#include #include #include #include @@ -135,7 +136,6 @@ #include -#include #include #include diff --git a/sys/pc98/pc98/clock.c b/sys/pc98/pc98/clock.c index 29cee686b138..bc03ea6a0b6b 100644 --- a/sys/pc98/pc98/clock.c +++ b/sys/pc98/pc98/clock.c @@ -59,6 +59,7 @@ #include #include #include +#include #include #include #include @@ -72,7 +73,6 @@ #include #include #include -#include #include #include #ifdef APIC_IO diff --git a/sys/pc98/pc98/pc98kbd.c b/sys/pc98/pc98/pc98kbd.c index 60e01a423473..37fe6d258400 100644 --- a/sys/pc98/pc98/pc98kbd.c +++ b/sys/pc98/pc98/pc98kbd.c @@ -263,7 +263,7 @@ pckbd_timeout(void *arg) /* LOW-LEVEL */ -#include +#include #define PC98KBD_DEFAULT 0 diff --git a/sys/pc98/pc98/sio.c b/sys/pc98/pc98/sio.c index a9213eec67c3..b571fefa4d46 100644 --- a/sys/pc98/pc98/sio.c +++ b/sys/pc98/pc98/sio.c @@ -119,6 +119,7 @@ #include #include #include +#include #include #include #include @@ -135,7 +136,6 @@ #include -#include #include #include diff --git a/sys/powerpc/include/limits.h b/sys/powerpc/include/limits.h index 1b06efdacdc8..58dac20c167c 100644 --- a/sys/powerpc/include/limits.h +++ b/sys/powerpc/include/limits.h @@ -34,75 +34,13 @@ * $FreeBSD$ */ -#ifndef _MACHINE_LIMITS_H_ +#ifndef _MACHINE_LIMITS_H_ #define _MACHINE_LIMITS_H_ -#define CHAR_BIT 8 /* number of bits in a char */ - -/* - * According to ANSI (section 2.2.4.2), the values below must be usable by - * #if preprocessing directives. Additionally, the expression must have the - * same type as would an expression that is an object of the corresponding - * type converted according to the integral promotions. The subtraction for - * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an - * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). - * These numbers are for the default configuration of gcc. They work for - * some other compilers as well, but this should not be depended on. - */ -#define SCHAR_MAX 0x7f /* max value for a signed char */ -#define SCHAR_MIN (-0x7f - 1) /* min value for a signed char */ - -#define UCHAR_MAX 0xff /* max value for an unsigned char */ - -#ifdef __CHAR_UNSIGNED__ -#define CHAR_MAX UCHAR_MAX /* max value for a char */ -#define CHAR_MIN 0 /* min value for a char */ -#else -#define CHAR_MAX SCHAR_MAX /* max value for a char */ -#define CHAR_MIN SCHAR_MIN /* min value for a char */ +#if __GNUC__ +#warning "machine/limits.h is deprecated. Include sys/limits.h instead." #endif -#define USHRT_MAX 0xffff /* max value for an unsigned short */ -#define SHRT_MAX 0x7fff /* max value for a short */ -#define SHRT_MIN (-0x7fff - 1) /* min value for a short */ - -#define UINT_MAX 0xffffffffU /* max value for an unsigned int */ -#define INT_MAX 0x7fffffff /* max value for an int */ -#define INT_MIN (-0x7fffffff - 1) /* min value for an int */ - -/* Bad hack for gcc configured to give 64-bit longs. */ -#ifdef _LARGE_LONG -#define ULONG_MAX 0xffffffffffffffffUL -#define LONG_MAX 0x7fffffffffffffffL -#define LONG_MIN (-0x7fffffffffffffffL - 1) -#else -#define ULONG_MAX 0xffffffffUL /* max value for an unsigned long */ -#define LONG_MAX 0x7fffffffL /* max value for a long */ -#define LONG_MIN (-0x7fffffffL - 1) /* min value for a long */ -#endif - - /* max value for an unsigned long long */ -#define ULLONG_MAX 0xffffffffffffffffULL -#define LLONG_MAX 0x7fffffffffffffffLL /* max value for a long long */ -#define LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */ - -#if !defined(_ANSI_SOURCE) -#define SSIZE_MAX INT_MAX /* max value for a ssize_t */ - -#if !defined(_POSIX_SOURCE) -#define SIZE_T_MAX UINT_MAX /* max value for a size_t */ - -#define OFF_MAX LLONG_MAX /* max value for an off_t */ -#define OFF_MIN LLONG_MIN /* min value for an off_t */ - -/* Quads and long longs are the same size. Ensure they stay in sync. */ -#define UQUAD_MAX ULLONG_MAX /* max value for a uquad_t */ -#define QUAD_MAX LLONG_MAX /* max value for a quad_t */ -#define QUAD_MIN LLONG_MIN /* min value for a quad_t */ - -#define LONG_BIT 32 - -#endif /* !_POSIX_SOURCE */ -#endif /* !_ANSI_SOURCE */ +#include #endif /* !_MACHINE_LIMITS_H_ */ diff --git a/sys/sparc64/include/limits.h b/sys/sparc64/include/limits.h index be8cf0db5fe0..60ebf8f74468 100644 --- a/sys/sparc64/include/limits.h +++ b/sys/sparc64/include/limits.h @@ -30,70 +30,10 @@ #ifndef _MACHINE_LIMITS_H_ #define _MACHINE_LIMITS_H_ -#define CHAR_BIT 8 /* number of bits in a char */ - -/* - * According to ANSI (section 2.2.4.2), the values below must be usable by - * #if preprocessing directives. Additionally, the expression must have the - * same type as would an expression that is an object of the corresponding - * type converted according to the integral promotions. The subtraction for - * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an - * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). - * These numbers are for the default configuration of gcc. They work for - * some other compilers as well, but this should not be depended on. - */ -#define SCHAR_MAX 0x7f /* max value for a signed char */ -#define SCHAR_MIN (-0x7f-1) /* min value for a signed char */ - -#define UCHAR_MAX 0xffU /* max value for an unsigned char */ -#define CHAR_MAX 0x7f /* max value for a char */ -#define CHAR_MIN (-0x7f-1) /* min value for a char */ - -#define USHRT_MAX 0xffffU /* max value for an unsigned short */ -#define SHRT_MAX 0x7fff /* max value for a short */ -#define SHRT_MIN (-0x7fff-1) /* min value for a short */ - -#define UINT_MAX 0xffffffffU /* max value for an unsigned int */ -#define INT_MAX 0x7fffffff /* max value for an int */ -#define INT_MIN (-0x7fffffff-1) /* min value for an int */ - -#define ULONG_MAX 0xffffffffffffffffUL /* max for an unsigned long */ -#define LONG_MAX 0x7fffffffffffffffL /* max for a long */ -#define LONG_MIN (-0x7fffffffffffffffL-1) /* min for a long */ - -/* Long longs and longs are the same size on the alpha. */ - /* max for an unsigned long long */ -#define ULLONG_MAX 0xffffffffffffffffULL -#define LLONG_MAX 0x7fffffffffffffffLL /* max for a long long */ -#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min for a long long */ - -#if !defined(_ANSI_SOURCE) -#define SSIZE_MAX LONG_MAX /* max value for a ssize_t */ - -#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) -#define SIZE_T_MAX ULONG_MAX /* max value for a size_t */ - -#define OFF_MAX LONG_MAX /* max value for an off_t */ -#define OFF_MIN LONG_MIN /* min value for an off_t */ - -/* Quads and longs are the same on the alpha. Ensure they stay in sync. */ -#define UQUAD_MAX (ULONG_MAX) /* max value for a uquad_t */ -#define QUAD_MAX (LONG_MAX) /* max value for a quad_t */ -#define QUAD_MIN (LONG_MIN) /* min value for a quad_t */ -#endif /* !_POSIX_SOURCE && !_XOPEN_SOURCE */ -#endif /* !_ANSI_SOURCE */ - -#if (!defined(_ANSI_SOURCE)&&!defined(_POSIX_SOURCE)) || defined(_XOPEN_SOURCE) -#define LONG_BIT 64 -#define WORD_BIT 32 - -#define DBL_DIG 15 -#define DBL_MAX 1.7976931348623157E+308 -#define DBL_MIN 2.2250738585072014E-308 - -#define FLT_DIG 6 -#define FLT_MAX 3.40282347E+38F -#define FLT_MIN 1.17549435E-38F +#if __GNUC__ +#warning "machine/limits.h is deprecated. Include sys/limits.h instead." #endif +#include + #endif /* !_MACHINE_LIMITS_H_ */ diff --git a/sys/sys/param.h b/sys/sys/param.h index 78464bd536fc..dffea105392e 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -104,7 +104,7 @@ /* Machine type dependent parameters. */ #include #ifndef _KERNEL -#include +#include #endif #ifndef _NO_NAMESPACE_POLLUTION diff --git a/sys/ufs/ffs/ffs_rawread.c b/sys/ufs/ffs/ffs_rawread.c index 3b8912928116..7e87293f3095 100644 --- a/sys/ufs/ffs/ffs_rawread.c +++ b/sys/ufs/ffs/ffs_rawread.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -44,7 +45,6 @@ #include #include -#include #include #include #include diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 8742a5b26d2f..eda8b0b09491 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -59,8 +60,6 @@ #include #include -#include - #include #include #include diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index 765f23c64660..cd00c3345c26 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -66,6 +66,7 @@ #include #include +#include #include #include #include @@ -79,8 +80,6 @@ #include #include -#include - #include #include #include