From 0dbd90d74e57f9af3c3185e5f27ac94fcab8ae7a Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 27 Mar 2024 00:36:33 +0100 Subject: [PATCH] gcc: match signed integers --- device_mapper/libdm-report.c | 4 ++-- lib/format_text/format-text.c | 2 +- lib/metadata/raid_manip.c | 7 ++++--- libdm/libdm-report.c | 4 ++-- libdm/libdm-stats.c | 2 +- tools/command.c | 2 +- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/device_mapper/libdm-report.c b/device_mapper/libdm-report.c index 85c88efc6..aabd03b14 100644 --- a/device_mapper/libdm-report.c +++ b/device_mapper/libdm-report.c @@ -4309,7 +4309,7 @@ static void _recalculate_fields(struct dm_report *rh) struct row *row; struct dm_report_field *field; int len; - size_t id_len; + int id_len; dm_list_iterate_items(row, &rh->rows) { dm_list_iterate_items(field, &row->fields) { @@ -4326,7 +4326,7 @@ static void _recalculate_fields(struct dm_report *rh) } if (rh->flags & DM_REPORT_OUTPUT_FIELD_IDS_IN_HEADINGS) { - id_len = strlen(rh->fields[field->props->field_num].id); + id_len = (int) strlen(rh->fields[field->props->field_num].id); if (field->props->width < id_len) field->props->width = id_len; } diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c index 3d4eac27b..884da9817 100644 --- a/lib/format_text/format-text.c +++ b/lib/format_text/format-text.c @@ -1934,7 +1934,7 @@ static int _text_pv_initialise(const struct format_type *fmt, return 0; } - if (pva->label_sector != -1) + if (pva->label_sector != UINT64_C(-1)) pv->label_sector = pva->label_sector; return 1; diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c index ad0aa3740..41736c711 100644 --- a/lib/metadata/raid_manip.c +++ b/lib/metadata/raid_manip.c @@ -2470,7 +2470,7 @@ static int _raid_reshape(struct logical_volume *lv, * FIXME Use alternative mechanism - separate parameter or enum. */ static int _reshape_requested(const struct logical_volume *lv, const struct segment_type *segtype, - const int data_copies, const uint32_t region_size, + const uint32_t data_copies, const uint32_t region_size, const uint32_t stripes, const uint32_t stripe_size) { struct lv_segment *seg = first_seg(lv); @@ -2917,7 +2917,8 @@ static int _raid_allow_extraction(struct logical_volume *lv, int extract_count, struct dm_list *target_pvs) { - int s, redundancy = 0; + int redundancy = 0; + unsigned s; char *dev_health; char *sync_action; struct lv_segment *seg = first_seg(lv); @@ -6370,7 +6371,7 @@ static int _conversion_options_allowed(const struct lv_segment *seg_from, const struct segment_type **segtype_to, int yes, uint32_t new_image_count, - int new_data_copies, int new_region_size, + int new_data_copies, uint32_t new_region_size, uint32_t *stripes, unsigned new_stripe_size_supplied) { int r = 1; diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c index 09b8b3c81..c015a57fe 100644 --- a/libdm/libdm-report.c +++ b/libdm/libdm-report.c @@ -4308,7 +4308,7 @@ static void _recalculate_fields(struct dm_report *rh) struct row *row; struct dm_report_field *field; int len; - size_t id_len; + int id_len; dm_list_iterate_items(row, &rh->rows) { dm_list_iterate_items(field, &row->fields) { @@ -4325,7 +4325,7 @@ static void _recalculate_fields(struct dm_report *rh) } if (rh->flags & DM_REPORT_OUTPUT_FIELD_IDS_IN_HEADINGS) { - id_len = strlen(rh->fields[field->props->field_num].id); + id_len = (int) strlen(rh->fields[field->props->field_num].id); if (field->props->width < id_len) field->props->width = id_len; } diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c index 47f028155..cccccac8e 100644 --- a/libdm/libdm-stats.c +++ b/libdm/libdm-stats.c @@ -4638,7 +4638,7 @@ static int _stats_unmap_regions(struct dm_stats *dms, uint64_t group_id, log_very_verbose("Kept region " FMTu64, i); } else { - if (i == group_id) + if (i == (int64_t)group_id) *regroup = 1; if (!_stats_delete_region(dms, i)) { diff --git a/tools/command.c b/tools/command.c index e30d2fa04..8198c5f3a 100644 --- a/tools/command.c +++ b/tools/command.c @@ -1421,7 +1421,7 @@ static void _create_opt_names_alpha(void) qsort(opt_names_alpha, ARG_COUNT, sizeof(long), _long_name_compare); } -static int _copy_line(const char **line, int max_line, int *position) +static int _copy_line(const char **line, size_t max_line, int *position) { size_t len;