Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Add definitions of C99 integer format conversion ma...



details:   https://anonhg.NetBSD.org/src/rev/9145c598a928
branches:  trunk
changeset: 508623:9145c598a928
user:      kleink <kleink%NetBSD.org@localhost>
date:      Sun Apr 15 17:13:04 2001 +0000

description:
Add definitions of C99 integer format conversion macros.
XXX Fastest minimum-width integer types haven't been decided upon yet.

diffstat:

 sys/arch/alpha/include/Makefile        |    5 +-
 sys/arch/alpha/include/int_fmtio.h     |  175 +++++++++++++++++++++
 sys/arch/amiga/include/Makefile        |    5 +-
 sys/arch/amiga/include/int_fmtio.h     |    3 +
 sys/arch/amigappc/include/Makefile     |    5 +-
 sys/arch/amigappc/include/int_fmtio.h  |    3 +
 sys/arch/arc/include/Makefile          |    4 +-
 sys/arch/arc/include/int_fmtio.h       |    3 +
 sys/arch/arm/include/Makefile          |    6 +-
 sys/arch/arm/include/int_fmtio.h       |  175 +++++++++++++++++++++
 sys/arch/arm26/include/Makefile        |    6 +-
 sys/arch/arm26/include/int_fmtio.h     |    3 +
 sys/arch/arm32/include/Makefile        |    4 +-
 sys/arch/arm32/include/int_fmtio.h     |    3 +
 sys/arch/atari/include/Makefile        |    4 +-
 sys/arch/atari/include/int_fmtio.h     |    3 +
 sys/arch/bebox/include/Makefile        |    6 +-
 sys/arch/bebox/include/int_fmtio.h     |    3 +
 sys/arch/cobalt/include/Makefile       |    5 +-
 sys/arch/cobalt/include/int_fmtio.h    |    3 +
 sys/arch/dnard/include/int_fmtio.h     |    3 +
 sys/arch/dreamcast/include/Makefile    |    5 +-
 sys/arch/dreamcast/include/int_fmtio.h |    3 +
 sys/arch/evbsh3/include/Makefile       |    5 +-
 sys/arch/evbsh3/include/int_fmtio.h    |    3 +
 sys/arch/hp300/include/Makefile        |    5 +-
 sys/arch/hp300/include/int_fmtio.h     |    3 +
 sys/arch/hpcarm/include/Makefile       |    6 +-
 sys/arch/hpcarm/include/int_fmtio.h    |    3 +
 sys/arch/hpcmips/include/Makefile      |    5 +-
 sys/arch/hpcmips/include/int_fmtio.h   |    3 +
 sys/arch/hpcsh/include/Makefile        |    5 +-
 sys/arch/hpcsh/include/int_fmtio.h     |    3 +
 sys/arch/i386/include/Makefile         |    5 +-
 sys/arch/i386/include/int_fmtio.h      |  175 +++++++++++++++++++++
 sys/arch/luna68k/include/Makefile      |    5 +-
 sys/arch/luna68k/include/int_fmtio.h   |    3 +
 sys/arch/m68k/include/Makefile         |    4 +-
 sys/arch/m68k/include/int_fmtio.h      |  175 +++++++++++++++++++++
 sys/arch/mac68k/include/Makefile       |    6 +-
 sys/arch/mac68k/include/int_fmtio.h    |    3 +
 sys/arch/macppc/include/Makefile       |    6 +-
 sys/arch/macppc/include/int_fmtio.h    |    3 +
 sys/arch/mips/include/Makefile         |    4 +-
 sys/arch/mips/include/int_fmtio.h      |  175 +++++++++++++++++++++
 sys/arch/mipsco/include/Makefile       |    5 +-
 sys/arch/mipsco/include/int_fmtio.h    |    3 +
 sys/arch/mmeye/include/Makefile        |    5 +-
 sys/arch/mmeye/include/int_fmtio.h     |    3 +
 sys/arch/mvme68k/include/Makefile      |    5 +-
 sys/arch/mvme68k/include/int_fmtio.h   |    3 +
 sys/arch/news68k/include/Makefile      |    5 +-
 sys/arch/news68k/include/int_fmtio.h   |    3 +
 sys/arch/newsmips/include/Makefile     |    5 +-
 sys/arch/newsmips/include/int_fmtio.h  |    3 +
 sys/arch/next68k/include/Makefile      |    5 +-
 sys/arch/next68k/include/int_fmtio.h   |    3 +
 sys/arch/ofppc/include/Makefile        |    5 +-
 sys/arch/ofppc/include/int_fmtio.h     |    3 +
 sys/arch/pc532/include/Makefile        |    4 +-
 sys/arch/pc532/include/int_fmtio.h     |  175 +++++++++++++++++++++
 sys/arch/pmax/include/Makefile         |    5 +-
 sys/arch/pmax/include/int_fmtio.h      |    3 +
 sys/arch/powerpc/include/Makefile      |    5 +-
 sys/arch/powerpc/include/int_fmtio.h   |  175 +++++++++++++++++++++
 sys/arch/prep/include/Makefile         |    6 +-
 sys/arch/prep/include/int_fmtio.h      |    3 +
 sys/arch/sandpoint/include/Makefile    |    6 +-
 sys/arch/sandpoint/include/int_fmtio.h |    3 +
 sys/arch/sgimips/include/Makefile      |    5 +-
 sys/arch/sgimips/include/int_fmtio.h   |    3 +
 sys/arch/sh3/include/Makefile          |    4 +-
 sys/arch/sh3/include/int_fmtio.h       |  175 +++++++++++++++++++++
 sys/arch/sparc/include/Makefile        |    4 +-
 sys/arch/sparc/include/int_fmtio.h     |  274 +++++++++++++++++++++++++++++++++
 sys/arch/sparc64/include/Makefile      |    4 +-
 sys/arch/sparc64/include/int_fmtio.h   |  274 +++++++++++++++++++++++++++++++++
 sys/arch/sun2/include/int_fmtio.h      |    3 +
 sys/arch/sun3/include/Makefile         |    4 +-
 sys/arch/sun3/include/int_fmtio.h      |    3 +
 sys/arch/vax/include/Makefile          |    5 +-
 sys/arch/vax/include/int_fmtio.h       |  219 ++++++++++++++++++++++++++
 sys/arch/x68k/include/Makefile         |    6 +-
 sys/arch/x68k/include/int_fmtio.h      |    3 +
 84 files changed, 2376 insertions(+), 91 deletions(-)

diffs (truncated from 3213 to 300 lines):

diff -r 23d69d4316ed -r 9145c598a928 sys/arch/alpha/include/Makefile
--- a/sys/arch/alpha/include/Makefile   Sun Apr 15 15:33:08 2001 +0000
+++ b/sys/arch/alpha/include/Makefile   Sun Apr 15 17:13:04 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.16 2001/04/15 15:29:02 kleink Exp $
+#      $NetBSD: Makefile,v 1.17 2001/04/15 17:13:04 kleink Exp $
 
 KDIR=  /sys/arch/alpha/include
 INCSDIR= /usr/include/alpha
@@ -10,7 +10,8 @@
        ecoff_machdep.h elf_machdep.h endian.h endian_machdep.h \
        fbio.h float.h frame.h \
        ieee.h ieeefp.h \
-       int_const.h int_limits.h int_mwgwtypes.h int_types.h intr.h \
+       int_const.h int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h \
+       intr.h \
        kbio.h kcore.h \
        limits.h lock.h \
        math.h \
diff -r 23d69d4316ed -r 9145c598a928 sys/arch/alpha/include/int_fmtio.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/alpha/include/int_fmtio.h        Sun Apr 15 17:13:04 2001 +0000
@@ -0,0 +1,175 @@
+/*     $NetBSD: int_fmtio.h,v 1.1 2001/04/15 17:13:04 kleink Exp $     */
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Klaus Klein.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *        This product includes software developed by the NetBSD
+ *        Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _ALPHA_INT_FMTIO_H_
+#define _ALPHA_INT_FMTIO_H_
+
+/*
+ * 7.8.1 Macros for format specifiers
+ */
+
+/* fprintf macros for signed integers */
+
+#define        PRId8           "d"     /* int8_t               */
+#define        PRId16          "d"     /* int16_t              */
+#define        PRId32          "d"     /* int32_t              */
+#define        PRId64          "lld"   /* int64_t              */
+#define        PRIdLEAST8      "d"     /* int_least8_t         */
+#define        PRIdLEAST16     "d"     /* int_least16_t        */
+#define        PRIdLEAST32     "d"     /* int_least32_t        */
+#define        PRIdLEAST64     "ld"    /* int_least64_t        */
+#define        PRIdMAX         "ld"    /* intmax_t             */
+#define        PRIdPTR         "ld"    /* intptr_t             */
+
+#define        PRIi8           "i"     /* int8_t               */
+#define        PRIi16          "i"     /* int16_t              */
+#define        PRIi32          "i"     /* int32_t              */
+#define        PRIi64          "li"    /* int64_t              */
+#define        PRIiLEAST8      "i"     /* int_least8_t         */
+#define        PRIiLEAST16     "i"     /* int_least16_t        */
+#define        PRIiLEAST32     "i"     /* int_least32_t        */
+#define        PRIiLEAST64     "li"    /* int_least64_t        */
+#define        PRIiMAX         "li"    /* intmax_t             */
+#define        PRIiPTR         "li"    /* intptr_t             */
+
+/* fprintf macros for unsigned integers */
+
+#define        PRIo8           "o"     /* uint8_t              */
+#define        PRIo16          "o"     /* uint16_t             */
+#define        PRIo32          "o"     /* uint32_t             */
+#define        PRIo64          "lo"    /* uint64_t             */
+#define        PRIoLEAST8      "o"     /* uint_least8_t        */
+#define        PRIoLEAST16     "o"     /* uint_least16_t       */
+#define        PRIoLEAST32     "o"     /* uint_least32_t       */
+#define        PRIoLEAST64     "lo"    /* uint_least64_t       */
+#define        PRIoMAX         "lo"    /* uintmax_t            */
+#define        PRIoPTR         "lo"    /* uintptr_t            */
+
+#define        PRIu8           "u"     /* uint8_t              */
+#define        PRIu16          "u"     /* uint16_t             */
+#define        PRIu32          "u"     /* uint32_t             */
+#define        PRIu64          "lu"    /* uint64_t             */
+#define        PRIuLEAST8      "u"     /* uint_least8_t        */
+#define        PRIuLEAST16     "u"     /* uint_least16_t       */
+#define        PRIuLEAST32     "u"     /* uint_least32_t       */
+#define        PRIuLEAST64     "lu"    /* uint_least64_t       */
+#define        PRIuMAX         "lu"    /* uintmax_t            */
+#define        PRIuPTR         "lu"    /* uintptr_t            */
+
+#define        PRIx8           "x"     /* uint8_t              */
+#define        PRIx16          "x"     /* uint16_t             */
+#define        PRIx32          "x"     /* uint32_t             */
+#define        PRIx64          "lx"    /* uint64_t             */
+#define        PRIxLEAST8      "x"     /* uint_least8_t        */
+#define        PRIxLEAST16     "x"     /* uint_least16_t       */
+#define        PRIxLEAST32     "x"     /* uint_least32_t       */
+#define        PRIxLEAST64     "lx"    /* uint_least64_t       */
+#define        PRIxMAX         "lx"    /* uintmax_t            */
+#define        PRIxPTR         "lx"    /* uintptr_t            */
+
+#define        PRIX8           "X"     /* uint8_t              */
+#define        PRIX16          "X"     /* uint16_t             */
+#define        PRIX32          "X"     /* uint32_t             */
+#define        PRIX64          "lX"    /* uint64_t             */
+#define        PRIXLEAST8      "X"     /* uint_least8_t        */
+#define        PRIXLEAST16     "X"     /* uint_least16_t       */
+#define        PRIXLEAST32     "X"     /* uint_least32_t       */
+#define        PRIXLEAST64     "lX"    /* uint_least64_t       */
+#define        PRIXMAX         "lX"    /* uintmax_t            */
+#define        PRIXPTR         "lX"    /* uintptr_t            */
+
+/* fscanf macros for signed integers */
+
+#define        SCNd8           "hhd"   /* int8_t               */
+#define        SCNd16          "hd"    /* int16_t              */
+#define        SCNd32          "d"     /* int32_t              */
+#define        SCNd64          "ld"    /* int64_t              */
+#define        SCNdLEAST8      "hhd"   /* int_least8_t         */
+#define        SCNdLEAST16     "hd"    /* int_least16_t        */
+#define        SCNdLEAST32     "d"     /* int_least32_t        */
+#define        SCNdLEAST64     "ld"    /* int_least64_t        */
+#define        SCNdMAX         "ld"    /* intmax_t             */
+#define        SCNdPTR         "ld"    /* intptr_t             */
+
+#define        SCNi8           "hhi"   /* int8_t               */
+#define        SCNi16          "hi"    /* int16_t              */
+#define        SCNi32          "i"     /* int32_t              */
+#define        SCNi64          "li"    /* int64_t              */
+#define        SCNiLEAST8      "hhi"   /* int_least8_t         */
+#define        SCNiLEAST16     "hi"    /* int_least16_t        */
+#define        SCNiLEAST32     "i"     /* int_least32_t        */
+#define        SCNiLEAST64     "li"    /* int_least64_t        */
+#define        SCNiMAX         "li"    /* intmax_t             */
+#define        SCNiPTR         "li"    /* intptr_t             */
+
+/* fscanf macros for unsigned integers */
+
+#define        SCNo8           "hho"   /* uint8_t              */
+#define        SCNo16          "ho"    /* uint16_t             */
+#define        SCNo32          "o"     /* uint32_t             */
+#define        SCNo64          "lo"    /* uint64_t             */
+#define        SCNoLEAST8      "hho"   /* uint_least8_t        */
+#define        SCNoLEAST16     "ho"    /* uint_least16_t       */
+#define        SCNoLEAST32     "o"     /* uint_least32_t       */
+#define        SCNoLEAST64     "lo"    /* uint_least64_t       */
+#define        SCNoMAX         "lo"    /* uintmax_t            */
+#define        SCNoPTR         "lo"    /* uintptr_t            */
+
+#define        SCNu8           "hhu"   /* uint8_t              */
+#define        SCNu16          "hu"    /* uint16_t             */
+#define        SCNu32          "u"     /* uint32_t             */
+#define        SCNu64          "lu"    /* uint64_t             */
+#define        SCNuLEAST8      "hhu"   /* uint_least8_t        */
+#define        SCNuLEAST16     "hu"    /* uint_least16_t       */
+#define        SCNuLEAST32     "u"     /* uint_least32_t       */
+#define        SCNuLEAST64     "lu"    /* uint_least64_t       */
+#define        SCNuMAX         "lu"    /* uintmax_t            */
+#define        SCNuPTR         "lu"    /* uintptr_t            */
+
+#define        SCNx8           "hhx"   /* uint8_t              */
+#define        SCNx16          "hx"    /* uint16_t             */
+#define        SCNx32          "x"     /* uint32_t             */
+#define        SCNx64          "lx"    /* uint64_t             */
+#define        SCNxLEAST8      "hhx"   /* uint_least8_t        */
+#define        SCNxLEAST16     "hx"    /* uint_least16_t       */
+#define        SCNxLEAST32     "x"     /* uint_least32_t       */
+#define        SCNxLEAST64     "lx"    /* uint_least64_t       */
+#define        SCNxMAX         "lx"    /* uintmax_t            */
+#define        SCNxPTR         "lx"    /* uintptr_t            */
+
+#endif /* !_ALPHA_INT_FMTIO_H_ */
diff -r 23d69d4316ed -r 9145c598a928 sys/arch/amiga/include/Makefile
--- a/sys/arch/amiga/include/Makefile   Sun Apr 15 15:33:08 2001 +0000
+++ b/sys/arch/amiga/include/Makefile   Sun Apr 15 17:13:04 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.12 2001/04/15 15:29:03 kleink Exp $
+#      $NetBSD: Makefile,v 1.13 2001/04/15 17:13:05 kleink Exp $
 
 KDIR=  /sys/arch/amiga/include
 INCSDIR= /usr/include/amiga
@@ -10,7 +10,8 @@
        elf_machdep.h endian.h endian_machdep.h \
        fbio.h float.h frame.h \
        ieee.h ieeefp.h \
-       int_const.h int_limits.h int_mwgwtypes.h int_types.h intr.h \
+       int_const.h int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h \
+       intr.h \
        kcore.h \
        limits.h lock.h \
        math.h mtpr.h \
diff -r 23d69d4316ed -r 9145c598a928 sys/arch/amiga/include/int_fmtio.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/amiga/include/int_fmtio.h        Sun Apr 15 17:13:04 2001 +0000
@@ -0,0 +1,3 @@
+/*     $NetBSD: int_fmtio.h,v 1.1 2001/04/15 17:13:05 kleink Exp $     */
+
+#include <m68k/int_fmtio.h>
diff -r 23d69d4316ed -r 9145c598a928 sys/arch/amigappc/include/Makefile
--- a/sys/arch/amigappc/include/Makefile        Sun Apr 15 15:33:08 2001 +0000
+++ b/sys/arch/amigappc/include/Makefile        Sun Apr 15 17:13:04 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.7 2001/04/15 15:29:03 kleink Exp $
+#      $NetBSD: Makefile,v 1.8 2001/04/15 17:13:05 kleink Exp $
 
 KDIR=  /sys/arch/amigappc/include
 INCSDIR= /usr/include/amigappc
@@ -10,7 +10,8 @@
        elf_machdep.h endian.h \
        fbio.h float.h frame.h \
        ieee.h ieeefp.h \
-       int_const.h int_limits.h int_mwgwtypes.h int_types.h intr.h \
+       int_const.h int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h \
+       intr.h \
        kcore.h \
        limits.h \
        math.h mtpr.h \
diff -r 23d69d4316ed -r 9145c598a928 sys/arch/amigappc/include/int_fmtio.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/amigappc/include/int_fmtio.h     Sun Apr 15 17:13:04 2001 +0000
@@ -0,0 +1,3 @@
+/*     $NetBSD: int_fmtio.h,v 1.1 2001/04/15 17:13:05 kleink Exp $     */
+
+#include <powerpc/int_fmtio.h>
diff -r 23d69d4316ed -r 9145c598a928 sys/arch/arc/include/Makefile
--- a/sys/arch/arc/include/Makefile     Sun Apr 15 15:33:08 2001 +0000
+++ b/sys/arch/arc/include/Makefile     Sun Apr 15 17:13:04 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.20 2001/04/15 15:29:03 kleink Exp $
+#      $NetBSD: Makefile,v 1.21 2001/04/15 17:13:06 kleink Exp $
 
 KDIR=  /sys/arch/arc/include
 INCSDIR= /usr/include/arc
@@ -12,7 +12,7 @@
        ecoff_machdep.h elf_machdep.h endian.h endian_machdep.h \
        float.h \
        ieee.h ieeefp.h \
-       int_const.h int_limits.h int_mwgwtypes.h int_types.h \
+       int_const.h int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h \
        kcore.h kdbparam.h \
        limits.h lock.h \
        math.h mips_opcode.h mouse.h \
diff -r 23d69d4316ed -r 9145c598a928 sys/arch/arc/include/int_fmtio.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arc/include/int_fmtio.h  Sun Apr 15 17:13:04 2001 +0000
@@ -0,0 +1,3 @@
+/*     $NetBSD: int_fmtio.h,v 1.1 2001/04/15 17:13:06 kleink Exp $     */
+
+#include <mips/int_fmtio.h>
diff -r 23d69d4316ed -r 9145c598a928 sys/arch/arm/include/Makefile
--- a/sys/arch/arm/include/Makefile     Sun Apr 15 15:33:08 2001 +0000
+++ b/sys/arch/arm/include/Makefile     Sun Apr 15 17:13:04 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.14 2001/04/15 15:29:03 kleink Exp $
+#      $NetBSD: Makefile,v 1.15 2001/04/15 17:13:06 kleink Exp $
 
 KDIR=  /sys/arch/arm/include
 INCSDIR= /usr/include/arm
@@ -10,8 +10,8 @@
        elf_machdep.h endian_machdep.h \
        float.h fp.h frame.h \
        ieee.h ieeefp.h \
-       int_const.h int_limits.h int_mwgwtypes.h int_types.h ipkdb.h \
-       isa_machdep.h isapnp_machdep.h \
+       int_const.h int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h \
+       ipkdb.h isa_machdep.h isapnp_machdep.h \
        limits.h lock.h \
        math.h \
        ofisa_machdep.h ofw.h \
diff -r 23d69d4316ed -r 9145c598a928 sys/arch/arm/include/int_fmtio.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arm/include/int_fmtio.h  Sun Apr 15 17:13:04 2001 +0000
@@ -0,0 +1,175 @@
+/*     $NetBSD: int_fmtio.h,v 1.1 2001/04/15 17:13:06 kleink Exp $     */



Home | Main Index | Thread Index | Old Index