]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: fix compiler warnings [-Wcast-qual]
authorKarel Zak <kzak@redhat.com>
Mon, 23 Jul 2018 09:39:13 +0000 (11:39 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 23 Jul 2018 09:39:13 +0000 (11:39 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk/src/dos.c
libfdisk/src/gpt.c
libfdisk/src/sgi.c

index 41784053cacc4dee6fa741ab6cf8f3ccfad6def5..f7351646061c94c0953b10cce2399bbe0a85b6a5 100644 (file)
@@ -2153,8 +2153,8 @@ static void print_chain_of_logicals(struct fdisk_context *cxt)
 
 static int cmp_ebr_offsets(const void *a, const void *b)
 {
-       struct pte *ae = (struct pte *) a,
-                  *be = (struct pte *) b;
+       const struct pte *ae = (const struct pte *) a,
+                        *be = (const struct pte *) b;
 
        if (ae->offset == 0 && be->offset == 0)
                return 0;
index 4d34ca78c8acfff588242d52079ea2070fa8cbbe..1ceb4f571070712ff73bee5bcfd1c45a27d8fd8d 100644 (file)
@@ -3000,8 +3000,8 @@ static int gpt_toggle_partition_flag(
 
 static int gpt_entry_cmp_start(const void *a, const void *b)
 {
-       struct gpt_entry *ae = (struct gpt_entry *) a,
-                        *be = (struct gpt_entry *) b;
+       const struct gpt_entry  *ae = (const struct gpt_entry *) a,
+                               *be = (const struct gpt_entry *) b;
        int au = gpt_entry_is_used(ae),
            bu = gpt_entry_is_used(be);
 
index fd40f533f432ed75f6e38346a8e632b09f70dde6..19d799205c3ebfe5b84df4ac7325d00ace0b2136 100644 (file)
@@ -510,8 +510,8 @@ static int compare_start(struct fdisk_context *cxt,
         * Sort according to start sectors and prefer the largest partition:
         * entry zero is the entire-disk entry.
         */
-       unsigned int i = *(int *) x;
-       unsigned int j = *(int *) y;
+       const unsigned int i = *(const int *) x;
+       const unsigned int j = *(const int *) y;
        unsigned int a = sgi_get_start_sector(cxt, i);
        unsigned int b = sgi_get_start_sector(cxt, j);
        unsigned int c = sgi_get_num_sectors(cxt, i);