From 88c4995d1ddfd4e2a572ddc73117b561cc25a0c1 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 15 Feb 2010 18:34:00 +0000 Subject: [PATCH] * add more 'const' - fixes gcc constness warning --- lib/report/report.c | 6 +++--- libdm/libdm-report.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/report/report.c b/lib/report/report.c index 6bcab55bf..9988be3f9 100644 --- a/lib/report/report.c +++ b/lib/report/report.c @@ -66,7 +66,7 @@ static int _dev_name_disp(struct dm_report *rh, struct dm_pool *mem __attribute( struct dm_report_field *field, const void *data, void *private __attribute((unused))) { - const char *name = dev_name(*(const struct device **) data); + const char *name = dev_name(*(const struct device * const *) data); return dm_report_field_string(rh, field, &name); } @@ -873,7 +873,7 @@ static int _pvmdafree_disp(struct dm_report *rh, struct dm_pool *mem, { struct lvmcache_info *info; uint64_t freespace = UINT64_MAX, mda_free; - const char *pvid = (const char *)(&((struct id *) data)->uuid); + const char *pvid = (const char *)(&((const struct id *) data)->uuid); struct metadata_area *mda; if ((info = info_from_pvid(pvid, 0))) @@ -916,7 +916,7 @@ static int _pvmdasize_disp(struct dm_report *rh, struct dm_pool *mem, { struct lvmcache_info *info; uint64_t min_mda_size = 0; - const char *pvid = (const char *)(&((struct id *) data)->uuid); + const char *pvid = (const char *)(&((const struct id *) data)->uuid); /* PVs could have 2 mdas of different sizes (rounding effect) */ if ((info = info_from_pvid(pvid, 0))) diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c index 992561487..aead86415 100644 --- a/libdm/libdm-report.c +++ b/libdm/libdm-report.c @@ -819,8 +819,8 @@ static int _report_headings(struct dm_report *rh) */ static int _row_compare(const void *a, const void *b) { - const struct row *rowa = *(const struct row **) a; - const struct row *rowb = *(const struct row **) b; + const struct row *rowa = *(const struct row * const *) a; + const struct row *rowb = *(const struct row * const *) b; const struct dm_report_field *sfa, *sfb; uint32_t cnt; -- 2.43.5