diff --git a/lib/imagery/iscatt_core.c b/lib/imagery/iscatt_core.c index 0267132a150..1ce5e9ceaeb 100644 --- a/lib/imagery/iscatt_core.c +++ b/lib/imagery/iscatt_core.c @@ -456,8 +456,9 @@ static int compute_scatts_from_chunk_row(struct scCats *scatt_conds, int *fd_cats_rasts) { - int i_rows_pix, i_cat, i_scatt, n_pixs; + int i_rows_pix, i_cat, i_scatt; int cat_id, scatt_plts_cat_idx, array_idx, max_arr_idx; + size_t n_pixs; char *b_1_null_row, *b_2_null_row; struct rast_row b_1_rast_row, b_2_rast_row; CELL *cat_rast_row; @@ -522,7 +523,7 @@ static int compute_scatts_from_chunk_row(struct scCats *scatt_conds, "Unable to read from category raster condition file.")); return -1; } - if (n_pixs != (row_size) / (int)sizeof(unsigned char)) { + if (n_pixs != ((unsigned)row_size / sizeof(unsigned char))) { G_free(rast_pixs); G_free(belongs_pix); G_warning( @@ -721,7 +722,7 @@ int I_compute_scatts(struct Cell_head *region, struct scCats *scatt_conds, for (i_cat = 0; i_cat < scatts->n_a_cats; i_cat++) fd_cats_rasts[i_cat] = -1; - G_zero(b_needed_bands, (size_t)n_bands * sizeof(int)); + G_zero(b_needed_bands, n_bands * (unsigned)sizeof(int)); get_needed_bands(scatt_conds, &b_needed_bands[0]); get_needed_bands(scatts, &b_needed_bands[0]); diff --git a/lib/imagery/list_gp.c b/lib/imagery/list_gp.c index b94a0092bcf..596a3b5f0b1 100644 --- a/lib/imagery/list_gp.c +++ b/lib/imagery/list_gp.c @@ -35,7 +35,7 @@ int I_list_group(const char *group, const struct Ref *ref, FILE *fd) max = 0; for (i = 0; i < ref->nfiles; i++) { I__list_group_name_fit(buf, ref->file[i].name, ref->file[i].mapset); - len = strlen(buf) + 4; + len = (int)strlen(buf) + 4; if (len > max) max = len; } diff --git a/lib/imagery/list_subgp.c b/lib/imagery/list_subgp.c index 0b630dcc466..6aaa772d8c2 100644 --- a/lib/imagery/list_subgp.c +++ b/lib/imagery/list_subgp.c @@ -90,7 +90,7 @@ int I_list_subgroup(const char *group, const char *subgroup, max = 0; for (i = 0; i < ref->nfiles; i++) { I__list_group_name_fit(buf, ref->file[i].name, ref->file[i].mapset); - len = strlen(buf) + 4; + len = (int)strlen(buf) + 4; if (len > max) max = len; } diff --git a/lib/imagery/loc_info.c b/lib/imagery/loc_info.c index c0cee9422a5..ef5c45ab7f3 100644 --- a/lib/imagery/loc_info.c +++ b/lib/imagery/loc_info.c @@ -9,15 +9,15 @@ char *I_location_info(const char *middle) char left[80]; char right[80]; char *buf; - int len, buf_len; + size_t len, buf_len; snprintf(left, 80, "LOCATION: %s", G_location()); snprintf(right, 80, "MAPSET: %s", G_mapset()); len = 79 - strlen(left) - strlen(middle) - strlen(right); buf_len = len + strlen(left) + strlen(middle) + strlen(right); buf = (char *)G_calloc(buf_len, sizeof(char)); - snprintf(buf, buf_len, "%s%*s%s%*s%s", left, len / 2, "", middle, len / 2, - "", right); + snprintf(buf, buf_len, "%s%*s%s%*s%s", left, (int)(len / 2), "", middle, + (int)(len / 2), "", right); return buf; } diff --git a/lib/imagery/manage_signatures.c b/lib/imagery/manage_signatures.c index 13cad69bb7f..5bad71fc924 100644 --- a/lib/imagery/manage_signatures.c +++ b/lib/imagery/manage_signatures.c @@ -294,7 +294,7 @@ static int list_by_type(I_SIGFILE_TYPE type, const char *mapset, int base, } /* Make items fully qualified names */ - int mapset_len = strlen(mapset); + size_t mapset_len = strlen(mapset); *out_list = (char **)G_realloc(*out_list, (base + count) * sizeof(char *)); for (int i = 0; i < count; i++) { diff --git a/lib/imagery/sig.c b/lib/imagery/sig.c index 31009016853..2c9579cf348 100644 --- a/lib/imagery/sig.c +++ b/lib/imagery/sig.c @@ -323,7 +323,8 @@ int I_write_signatures(FILE *fd, struct Signature *S) char **I_sort_signatures_by_semantic_label(struct Signature *S, const struct Ref *R) { - unsigned int total, complete; + unsigned int complete; + size_t total; unsigned int *match1, *match2, mc1, mc2, *new_order; double **new_means, ***new_vars; char **group_semantic_labels, **mismatches, **new_semantic_labels; diff --git a/lib/imagery/sigset.c b/lib/imagery/sigset.c index d4542223f70..2df742a4370 100644 --- a/lib/imagery/sigset.c +++ b/lib/imagery/sigset.c @@ -475,7 +475,8 @@ int I_WriteSigSet(FILE *fd, const struct SigSet *S) */ char **I_SortSigSetBySemanticLabel(struct SigSet *S, const struct Ref *R) { - unsigned int total, complete; + unsigned int complete; + size_t total; unsigned int *match1, *match2, mc1, mc2, *new_order; double ***new_means, ****new_vars; char **group_semantic_labels, **mismatches, **new_semantic_labels;