Skip to contentSkip to conversation

Use limits.h in Mini-OS for UINT_MAX, INT_MAX, and CHAR_BITS.

PATCH New John D. Ramsdell 1 participant 1 message Aug 2, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use limits.h in Mini-OS for UINT_MAX, INT_MAX, and CHAR_BITS.

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

Use limits.h in Mini-OS for UINT_MAX, INT_MAX, and CHAR_BITS.

extras/mini-os/include/types.h +1 -2
diff -ur oxen-unstable/extras/mini-os/include/types.h xen-unstable/extras/mini-os/include/types.h
@@ -67,6 +67,5 @@
 typedef s64 int64_t;
 
 
-#define INT_MAX         ((int)(~0U>>1))
-#define UINT_MAX            (~0U)
+#include <limits.h>
 #endif /* _TYPES_H_ */
extras/mini-os/lib/math.c +0 -1
diff -ur oxen-unstable/extras/mini-os/lib/math.c xen-unstable/extras/mini-os/lib/math.c
@@ -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)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel