[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[2.06 RELEASE PATCH v2 1/4] types: Define PRI{x, d}GRUB_INT{32, 64}_T fo
From: |
Javier Martinez Canillas |
Subject: |
[2.06 RELEASE PATCH v2 1/4] types: Define PRI{x, d}GRUB_INT{32, 64}_T format specifiers |
Date: |
Wed, 12 May 2021 17:46:13 +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>
---
(no changes since v1)
include/grub/types.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/grub/types.h b/include/grub/types.h
index b36b26a79d4..f460ef18c71 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 PRIuGRUB_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