Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Be consistent with limit constants:



details:   https://anonhg.NetBSD.org/src/rev/497b9d6a94f1
branches:  trunk
changeset: 509446:497b9d6a94f1
user:      simonb <simonb%NetBSD.org@localhost>
date:      Fri May 04 15:12:32 2001 +0000

description:
Be consistent with limit constants:
 - use "U" suffix for unsigned constants
 - use "L" suffix for long constants
 - use "UL" suffix for unsigned long constants
 - use hexadecimal instead of decimal

Fixes build problems with vi (now that warnings/errors are enabled) on
mips, powerpc and arm platforms.

diffstat:

 sys/arch/arm/include/limits.h     |  12 ++++++------
 sys/arch/m68k/include/limits.h    |   6 +++---
 sys/arch/mips/include/limits.h    |  30 +++++++++++++++---------------
 sys/arch/powerpc/include/limits.h |  14 +++++++-------
 4 files changed, 31 insertions(+), 31 deletions(-)

diffs (140 lines):

diff -r 35f7eb3edfc4 -r 497b9d6a94f1 sys/arch/arm/include/limits.h
--- a/sys/arch/arm/include/limits.h     Fri May 04 14:45:08 2001 +0000
+++ b/sys/arch/arm/include/limits.h     Fri May 04 15:12:32 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: limits.h,v 1.1 2001/01/10 19:02:06 bjh21 Exp $ */
+/*     $NetBSD: limits.h,v 1.2 2001/05/04 15:12:32 simonb Exp $        */
 
 /*
  * Copyright (c) 1988 The Regents of the University of California.
@@ -48,17 +48,17 @@
 #define        CHAR_MAX        0xff            /* max value for a char */
 #define        CHAR_MIN        0               /* min value for a char */
 
-#define        USHRT_MAX       0xffff          /* max value for an unsigned short */
+#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        0xffffffff      /* max value for an unsigned int */
+#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       0xffffffff      /* max value for an unsigned long */
-#define        LONG_MAX        0x7fffffff      /* max value for a long */
-#define        LONG_MIN        (-0x7fffffff-1) /* min value for a long */
+#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 */
 
 #if !defined(_ANSI_SOURCE)
 #define        SSIZE_MAX       INT_MAX         /* max value for a ssize_t */
diff -r 35f7eb3edfc4 -r 497b9d6a94f1 sys/arch/m68k/include/limits.h
--- a/sys/arch/m68k/include/limits.h    Fri May 04 14:45:08 2001 +0000
+++ b/sys/arch/m68k/include/limits.h    Fri May 04 15:12:32 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: limits.h,v 1.13 2000/08/08 22:31:13 tshiozak Exp $     */
+/*     $NetBSD: limits.h,v 1.14 2001/05/04 15:12:32 simonb Exp $       */
 
 /*
  * Copyright (c) 1988 The Regents of the University of California.
@@ -44,11 +44,11 @@
 #define        SCHAR_MIN       (-0x7f-1)       /* max value for a signed char */
 #define        SCHAR_MAX       0x7f            /* min value for a signed char */
 
-#define        UCHAR_MAX       0xff            /* max value for an unsigned 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       0xffff          /* max value for an unsigned short */
+#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 */
 
diff -r 35f7eb3edfc4 -r 497b9d6a94f1 sys/arch/mips/include/limits.h
--- a/sys/arch/mips/include/limits.h    Fri May 04 14:45:08 2001 +0000
+++ b/sys/arch/mips/include/limits.h    Fri May 04 15:12:32 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: limits.h,v 1.14 2000/08/08 22:31:13 tshiozak Exp $     */
+/*     $NetBSD: limits.h,v 1.15 2001/05/04 15:12:32 simonb Exp $       */
 
 /*
  * Copyright (c) 1988, 1993
@@ -51,24 +51,24 @@
  * These numbers work for pcc as well.  The UINT_MAX and ULONG_MAX values
  * are written as hex so that GCC will be quiet about large integer constants.
  */
-#define        SCHAR_MAX       127             /* min value for a signed char */
-#define        SCHAR_MIN       (-128)          /* max value for a signed char */
+#define        SCHAR_MAX       0x7f            /* min value for a signed char */
+#define        SCHAR_MIN       (-0x7f-1)       /* max value for a signed char */
 
-#define        UCHAR_MAX       255             /* max value for an unsigned char */
-#define        CHAR_MAX        127             /* max value for a char */
-#define        CHAR_MIN        (-128)          /* min value for a 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       65535           /* max value for an unsigned short */
-#define        SHRT_MAX        32767           /* max value for a short */
-#define        SHRT_MIN        (-32768)        /* min value for a short */
+#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        0xffffffff      /* max value for an unsigned int */
-#define        INT_MAX         2147483647      /* max value for an int */
-#define        INT_MIN         (-2147483647-1) /* min value for an int */
+#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       0xffffffff      /* max value for an unsigned long */
-#define        LONG_MAX        2147483647      /* max value for a long */
-#define        LONG_MIN        (-2147483647-1) /* min value for a long */
+#define        ULONG_MAX       0xffffffffUL    /* max value for an unsigned long */
+#define        LONG_MAX        0x7fffffffL     /* max value for a long */
+#define        LONG_MIN        (-0x7fffffff-1) /* min value for a long */
 
 #if !defined(_ANSI_SOURCE)
 #define        SSIZE_MAX       INT_MAX         /* max value for a ssize_t */
diff -r 35f7eb3edfc4 -r 497b9d6a94f1 sys/arch/powerpc/include/limits.h
--- a/sys/arch/powerpc/include/limits.h Fri May 04 14:45:08 2001 +0000
+++ b/sys/arch/powerpc/include/limits.h Fri May 04 15:12:32 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: limits.h,v 1.7 2000/08/08 22:31:14 tshiozak Exp $      */
+/*     $NetBSD: limits.h,v 1.8 2001/05/04 15:12:32 simonb Exp $        */
 
 /*-
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -38,21 +38,21 @@
 #define        MB_LEN_MAX      32              /* no multibyte characters      */
 #define        CHAR_MIN        0               /* min value in char            */
 #define        CHAR_MAX        0xff            /* max value in char            */
-#define        UCHAR_MAX       0xff            /* max value in unsigned char   */
+#define        UCHAR_MAX       0xffU           /* max value in unsigned char   */
 #define        SCHAR_MIN       (-0x7f-1)       /* min value for a signed char  */
 #define        SCHAR_MAX       0x7f            /* max value for a signed char  */
 
 #define        SHRT_MIN        (-0x7fff-1)     /* min value in short           */
 #define        SHRT_MAX        0x7fff          /* max value in short           */
-#define        USHRT_MAX       0xffff          /* max value in unsigned short  */
+#define        USHRT_MAX       0xffffU         /* max value in unsigned short  */
 
 #define        INT_MIN         (-0x7fffffff-1) /* min value in int             */
 #define        INT_MAX         0x7fffffff      /* max value in int             */
-#define        UINT_MAX        0xffffffff      /* max value in unsigned int    */
+#define        UINT_MAX        0xffffffffU     /* max value in unsigned int    */
 
-#define        LONG_MIN        (-0x7fffffff-1) /* min value in long            */
-#define        LONG_MAX        0x7fffffff      /* max value in long            */
-#define        ULONG_MAX       0xffffffff      /* max value in unsigned long   */
+#define        LONG_MIN        (-0x7fffffffL-1) /* min value in long           */
+#define        LONG_MAX        0x7fffffffL     /* max value in long            */
+#define        ULONG_MAX       0xffffffffUL    /* max value in unsigned long   */
 
 #if !defined(_ANSI_SOURCE)
 #define        SSIZE_MAX       INT_MAX         /* max value for a ssize_t */



Home | Main Index | Thread Index | Old Index