[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[2.06 RELEASE PATCH v3 1/4] types: Define PRI{x, d}GRUB_INT{32, 64}_T fo
From: |
Javier Martinez Canillas |
Subject: |
[2.06 RELEASE PATCH v3 1/4] types: Define PRI{x, d}GRUB_INT{32, 64}_T format specifiers |
Date: |
Mon, 24 May 2021 19:40:04 +0200 |
There are already constant macros defined for unsigned integers but no for
signed integers. Add macro constants for format specifiers of the latter.
Suggested-by: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
---
Changes in v3:
- Add dkiper Reviewed-by tag.
- Fix PRIuGRUB_INT32_T typo.
include/grub/types.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/grub/types.h b/include/grub/types.h
index b36b26a79d4..0a3ff159136 100644
--- a/include/grub/types.h
+++ b/include/grub/types.h
@@ -86,10 +86,16 @@
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;
+# define PRIxGRUB_INT32_T "x"
+# define PRIdGRUB_INT32_T "d"
#if GRUB_CPU_SIZEOF_LONG == 8
typedef long grub_int64_t;
+# define PRIxGRUB_INT64_T "lx"
+# define PRIdGRUB_INT64_T "ld"
#else
typedef long long grub_int64_t;
+# define PRIxGRUB_INT64_T "llx"
+# define PRIdGRUB_INT64_T "lld"
#endif
typedef unsigned char grub_uint8_t;
--
2.31.1
- [2.06 RELEASE PATCH v3 0/4] Add XFS bigtime and needsrepair support, Javier Martinez Canillas, 2021/05/24
- [2.06 RELEASE PATCH v3 1/4] types: Define PRI{x, d}GRUB_INT{32, 64}_T format specifiers,
Javier Martinez Canillas <=
- [2.06 RELEASE PATCH v3 3/4] fs/xfs: Add bigtime incompat feature support, Javier Martinez Canillas, 2021/05/24
- [2.06 RELEASE PATCH v3 4/4] fs/xfs: Add needsrepair incompat feature support, Javier Martinez Canillas, 2021/05/24
- [2.06 RELEASE PATCH v3 2/4] fs: Use 64-bit type for filesystem timestamp, Javier Martinez Canillas, 2021/05/24
- Re: [2.06 RELEASE PATCH v3 0/4] Add XFS bigtime and needsrepair support, Daniel Kiper, 2021/05/25