From: Karel Zak Date: Mon, 23 Jul 2018 09:39:13 +0000 (+0200) Subject: libfdisk: fix compiler warnings [-Wcast-qual] X-Git-Tag: v2.33-rc1~106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec4b88b83da25d44bcfa4f4de72cb1b0642ccf6d;p=thirdparty%2Futil-linux.git libfdisk: fix compiler warnings [-Wcast-qual] Signed-off-by: Karel Zak --- diff --git a/libfdisk/src/dos.c b/libfdisk/src/dos.c index 41784053ca..f735164606 100644 --- a/libfdisk/src/dos.c +++ b/libfdisk/src/dos.c @@ -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; diff --git a/libfdisk/src/gpt.c b/libfdisk/src/gpt.c index 4d34ca78c8..1ceb4f5710 100644 --- a/libfdisk/src/gpt.c +++ b/libfdisk/src/gpt.c @@ -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); diff --git a/libfdisk/src/sgi.c b/libfdisk/src/sgi.c index fd40f533f4..19d799205c 100644 --- a/libfdisk/src/sgi.c +++ b/libfdisk/src/sgi.c @@ -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);