]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: (ntfs) fix compiler warning [-Wpedantic]
authorKarel Zak <kzak@redhat.com>
Wed, 2 Jan 2019 13:44:59 +0000 (14:44 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 4 Jan 2019 10:48:51 +0000 (11:48 +0100)
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

index 32973095ba188a427d331052ec6f6f287a52b41b..5ea2a454a91efa05e296252dd69ffd69757e9450 100644 (file)
@@ -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;