From: ramsdell@mitre.org (John D. Ramsdell) Subject: [PATCH] Use limits.h in Mini-OS for UINT_MAX, INT_MAX, and CHAR_BITS. Date: 02 Aug 2006 16:14:15 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Steven Smith , Grzegorz Milos Cc: ramsdell@mitre.org, xen-devel@lists.xensource.com, sos22@srcf.ucam.org List-Id: xen-devel@lists.xenproject.org --=-=-= In Mini-OS, including the ANSI Standard header file limits.h causes warnings about redefinitions of UINT_MAX, INT_MAX, and CHAR_BITS. This patch eliminates the warnings by obtaining the definitions from limits.h. John --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=limits.patch Content-Description: Use limits.h in Mini-OS for UINT_MAX, INT_MAX, and CHAR_BITS Use limits.h in Mini-OS for UINT_MAX, INT_MAX, and CHAR_BITS. Signed-off-by: "John D. Ramsdell" diff -ur oxen-unstable/extras/mini-os/include/types.h xen-unstable/extras/mini-os/include/types.h --- oxen-unstable/extras/mini-os/include/types.h 2006-08-01 01:08:35.000000000 -0400 +++ xen-unstable/extras/mini-os/include/types.h 2006-08-01 13:35:59.000000000 -0400 @@ -67,6 +67,5 @@ typedef s64 int64_t; -#define INT_MAX ((int)(~0U>>1)) -#define UINT_MAX (~0U) +#include #endif /* _TYPES_H_ */ diff -ur oxen-unstable/extras/mini-os/lib/math.c xen-unstable/extras/mini-os/lib/math.c --- oxen-unstable/extras/mini-os/lib/math.c 2006-08-01 01:08:35.000000000 -0400 +++ xen-unstable/extras/mini-os/lib/math.c 2006-08-01 13:39:55.000000000 -0400 @@ -81,7 +81,6 @@ * These are used for shifting, and also below for halfword extraction * and assembly. */ -#define CHAR_BIT 8 /* number of bits in a char */ #define QUAD_BITS (sizeof(s64) * CHAR_BIT) #define LONG_BITS (sizeof(long) * CHAR_BIT) #define HALF_BITS (sizeof(long) * CHAR_BIT / 2) --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-=-=--