]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
types: Define PRI{x,d}GRUB_INT{32,64}_T format specifiers
authorJavier Martinez Canillas <javierm@redhat.com>
Mon, 24 May 2021 17:40:04 +0000 (19:40 +0200)
committerDaniel Kiper <daniel.kiper@oracle.com>
Fri, 28 May 2021 13:57:05 +0000 (15:57 +0200)
There are already PRI*_T constants defined for unsigned integers but not
for signed integers. Add format specifiers for 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>
include/grub/types.h

index b36b26a79d428e35b903d4f505c4a75fa11e42d5..0a3ff15913611614ed1981fb20cc87505cc1324d 100644 (file)
 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;