summaryrefslogtreecommitdiffstats
path: root/libfdisk/src
diff options
context:
space:
mode:
authorKarel Zak2018-07-23 11:39:13 +0200
committerKarel Zak2018-07-23 11:39:13 +0200
commitec4b88b83da25d44bcfa4f4de72cb1b0642ccf6d (patch)
tree16e0a2bb970510ff7a4fec9914905ec8005d94bf /libfdisk/src
parentlibmount: fix compiler warning [-Wcast-qual] (diff)
downloadkernel-qcow2-util-linux-ec4b88b83da25d44bcfa4f4de72cb1b0642ccf6d.tar.gz
kernel-qcow2-util-linux-ec4b88b83da25d44bcfa4f4de72cb1b0642ccf6d.tar.xz
kernel-qcow2-util-linux-ec4b88b83da25d44bcfa4f4de72cb1b0642ccf6d.zip
libfdisk: fix compiler warnings [-Wcast-qual]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk/src')
-rw-r--r--libfdisk/src/dos.c4
-rw-r--r--libfdisk/src/gpt.c4
-rw-r--r--libfdisk/src/sgi.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/libfdisk/src/dos.c b/libfdisk/src/dos.c
index 41784053c..f73516460 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 4d34ca78c..1ceb4f571 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 fd40f533f..19d799205 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);