]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: avoid use of non-standard typeof()
authorThomas Weißschuh <thomas@t-8ch.de>
Thu, 30 Nov 2023 22:26:27 +0000 (23:26 +0100)
committerThomas Weißschuh <thomas@t-8ch.de>
Fri, 1 Dec 2023 07:09:44 +0000 (08:09 +0100)
__typeof__ is also non-standard but it's obviously so and consistent
with the rest of the codebase.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
libblkid/src/superblocks/bcache.c
libblkid/src/superblocks/zonefs.c

index f6f34bbad60c3bb3deb6f7f80532bddab67a2c5e..83815286989836d8e2f1c611f5e29d7849c991a9 100644 (file)
@@ -189,7 +189,7 @@ static int bcache_verify_checksum(blkid_probe pr, const struct blkid_idmag *mag,
                return 0;
 
        /* up to the end of bcs->d[] */
-       csummed_size = offsetof(typeof(*bcs), d) +
+       csummed_size = offsetof(__typeof__(*bcs), d) +
                sizeof(bcs->d[0]) * le16_to_cpu(bcs->keys);
        csummed = blkid_probe_get_sb_buffer(pr, mag, csummed_size);
        csum = ul_crc64_we(csummed + BCACHE_SB_CSUMMED_START,
@@ -238,7 +238,7 @@ static void probe_bcachefs_sb_members(blkid_probe pr,
        uint64_t sectors = 0;
        uint8_t i;
 
-       if (BYTES(field) != offsetof(typeof(*members), members[bcs->nr_devices]))
+       if (BYTES(field) != offsetof(__typeof__(*members), members[bcs->nr_devices]))
                return;
 
        blkid_probe_set_uuid_as(pr, members->members[dev_idx].uuid, "UUID_SUB");
@@ -258,7 +258,7 @@ static void probe_bcachefs_sb_disk_groups(blkid_probe pr,
        struct bcachefs_sb_field_disk_groups *disk_groups =
                        (struct bcachefs_sb_field_disk_groups *) field;
 
-       if (BYTES(field) != offsetof(typeof(*disk_groups), disk_groups[bcs->nr_devices]))
+       if (BYTES(field) != offsetof(__typeof__(*disk_groups), disk_groups[bcs->nr_devices]))
                return;
 
        blkid_probe_set_id_label(pr, "LABEL_SUB",
index 8aa45b0d34b3e04faad504a9b46e0c771fb25138..e8fcab34fe30cbb4576e5e579292fb2deddfce64 100644 (file)
@@ -54,7 +54,7 @@ static int zonefs_verify_csum(blkid_probe pr, const struct zonefs_super *sb)
        uint32_t expected = le32_to_cpu(sb->s_crc);
        uint32_t crc = ul_crc32_exclude_offset(
                        ~0LL, (unsigned char *) sb, sizeof(*sb),
-                      offsetof(typeof(*sb), s_crc), sizeof(sb->s_crc));
+                      offsetof(__typeof__(*sb), s_crc), sizeof(sb->s_crc));
        return blkid_probe_verify_csum(pr, crc, expected);
 }