util-linux/libblkid-ntfs-fix-compiler-warning-Wpedantic.patch
2019-09-30 11:19:16 -04:00

47 lines
1.7 KiB
Diff

From 9b13b5602e16f719934b29d5efbf5a3aacf9832c Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Wed, 2 Jan 2019 14:44:59 +0100
Subject: [PATCH 574/686] libblkid: (ntfs) fix compiler warning [-Wpedantic]
libblkid/src/superblocks/ntfs.c:80:2: warning: ISO C restricts enumerator
values to range of 'int' (4294967295 is too large) [-Wpedantic]
Addressed: https://github.com/karelzak/util-linux/pull/732
Signed-off-by: Karel Zak <kzak@redhat.com>
---
libblkid/src/superblocks/ntfs.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/libblkid/src/superblocks/ntfs.c b/libblkid/src/superblocks/ntfs.c
index 3297309..5ea2a45 100644
--- a/libblkid/src/superblocks/ntfs.c
+++ b/libblkid/src/superblocks/ntfs.c
@@ -75,10 +75,8 @@ struct file_attribute {
/* Windows 10 Creators edition has extended the cluster size limit to 2MB */
#define NTFS_MAX_CLUSTER_SIZE (2 * 1024 * 1024)
-enum {
- MFT_RECORD_ATTR_VOLUME_NAME = 0x60,
- MFT_RECORD_ATTR_END = 0xffffffff
-};
+#define MFT_RECORD_ATTR_VOLUME_NAME 0x60
+#define MFT_RECORD_ATTR_END 0xffffffff
static int probe_ntfs(blkid_probe pr, const struct blkid_idmag *mag)
{
@@ -190,9 +188,9 @@ static int probe_ntfs(blkid_probe pr, const struct blkid_idmag *mag)
if (!attr_len)
break;
- if (le32_to_cpu(attr->type) == MFT_RECORD_ATTR_END)
+ if (le32_to_cpu(attr->type) == (uint32_t) MFT_RECORD_ATTR_END)
break;
- if (le32_to_cpu(attr->type) == MFT_RECORD_ATTR_VOLUME_NAME) {
+ if (le32_to_cpu(attr->type) == (uint32_t) MFT_RECORD_ATTR_VOLUME_NAME) {
unsigned int val_off = le16_to_cpu(attr->value_offset);
unsigned int val_len = le32_to_cpu(attr->value_len);
unsigned char *val = ((uint8_t *) attr) + val_off;
--
1.8.3.1