You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/11/19 08:50:39 UTC
[incubator-nuttx] 34/34: include/inttypes.h: Provide PRIdMAX and
friends using 'j' modifier
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 6ee7fdf874d802f7853db1f7a382b6e4bce708fb
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Thu Nov 19 14:09:39 2020 +0900
include/inttypes.h: Provide PRIdMAX and friends using 'j' modifier
Replace definitions in other places.
---
arch/sim/include/inttypes.h | 8 --------
include/inttypes.h | 15 +++++++++++++++
include/stdint.h | 26 --------------------------
3 files changed, 15 insertions(+), 34 deletions(-)
diff --git a/arch/sim/include/inttypes.h b/arch/sim/include/inttypes.h
index 35cef6e..31942ef 100644
--- a/arch/sim/include/inttypes.h
+++ b/arch/sim/include/inttypes.h
@@ -76,8 +76,6 @@
# define PRIu32 "u"
# define PRIu64 _PRI64PREFIX "u"
-# define PRIuMAX "llu"
-
# define PRIx8 "x"
# define PRIx16 "x"
# define PRIx32 "x"
@@ -93,22 +91,16 @@
# define SCNd32 "d"
# define SCNd64 _SCN64PREFIX "d"
-# define SCNdMAX "lld"
-
# define SCNi8 "hhi"
# define SCNi16 "hi"
# define SCNi32 "i"
# define SCNi64 _SCN64PREFIX "i"
-# define SCNiMAX "lli"
-
# define SCNo8 "hho"
# define SCNo16 "ho"
# define SCNo32 "o"
# define SCNo64 _SCN64PREFIX "o"
-# define SCNoMAX "llo"
-
# define SCNu8 "hhu"
# define SCNu16 "hu"
# define SCNu32 "u"
diff --git a/include/inttypes.h b/include/inttypes.h
index a404bbe..8a3cb43 100644
--- a/include/inttypes.h
+++ b/include/inttypes.h
@@ -306,6 +306,21 @@
#define SCNxFAST64 SCNx64
#endif
+/* intmax_t/uintmax_t */
+
+#define PRIdMAX "jd"
+#define PRIiMAX "ji"
+#define PRIoMAX "jo"
+#define PRIuMAX "ju"
+#define PRIxMAX "jx"
+#define PRIXMAX "jX"
+
+#define SCNdMAX "jd"
+#define SCNiMAX "ji"
+#define SCNoMAX "jo"
+#define SCNuMAX "ju"
+#define SCNxMAX "jx"
+
/****************************************************************************
* Type Definitions
****************************************************************************/
diff --git a/include/stdint.h b/include/stdint.h
index 70fa0ec..469e3a2 100644
--- a/include/stdint.h
+++ b/include/stdint.h
@@ -147,19 +147,6 @@
# define UINTMAX_MIN UINT64_MIN
# define UINTMAX_MAX UINT64_MAX
-# define PRIdMAX PRId64
-# define PRIiMAX PRIi64
-# define PRIoMAX PRIo64
-# define PRIuMAX PRIu64
-# define PRIxMAX PRIx64
-# define PRIXMAX PRIX64
-
-# define SCNdMAX SCNd64
-# define SCNiMAX SCNi64
-# define SCNoMAX SCNo64
-# define SCNuMAX SCNu64
-# define SCNxMAX SCNx64
-
# define INTMAX_C(x) INT64_C(x)
# define UINTMAX_C(x) UINT64_C(x)
#else
@@ -169,19 +156,6 @@
# define UINTMAX_MIN UINT32_MIN
# define UINTMAX_MAX UINT32_MAX
-# define PRIdMAX PRId32
-# define PRIiMAX PRIi32
-# define PRIoMAX PRIo32
-# define PRIuMAX PRIu32
-# define PRIxMAX PRIx32
-# define PRIXMAX PRIX32
-
-# define SCNdMAX SCNd32
-# define SCNiMAX SCNi32
-# define SCNoMAX SCNo32
-# define SCNuMAX SCNu32
-# define SCNxMAX SCNx32
-
# define INTMAX_C(x) INT32_C(x)
# define UINTMAX_C(x) UINT32_C(x)
#endif