vim-patch:8.2.2826: compiler warnings for int to size_t conversion

Problem:    Compiler warnings for int to size_t conversion. (Randall W.
            Morris)
Solution:   Add type casts.
551c1aed65

Still keep it size_t, but avoid calculating multiple times.
This commit is contained in:
zeertzjq
2022-08-25 13:04:03 +08:00
parent 7656cd527b
commit e7dd65eea3

View File

@@ -5140,6 +5140,7 @@ static bool vgr_match_buflines(qf_list_T *qfl, char *fname, buf_T *buf, char *sp
FUNC_ATTR_NONNULL_ARG(1, 3, 4, 5, 6) FUNC_ATTR_NONNULL_ARG(1, 3, 4, 5, 6)
{ {
bool found_match = false; bool found_match = false;
const size_t pat_len = STRLEN(spat);
for (linenr_T lnum = 1; lnum <= buf->b_ml.ml_line_count && *tomatch > 0; lnum++) { for (linenr_T lnum = 1; lnum <= buf->b_ml.ml_line_count && *tomatch > 0; lnum++) {
colnr_T col = 0; colnr_T col = 0;
@@ -5181,7 +5182,6 @@ static bool vgr_match_buflines(qf_list_T *qfl, char *fname, buf_T *buf, char *sp
} }
} }
} else { } else {
const size_t pat_len = STRLEN(spat);
char *const str = (char *)ml_get_buf(buf, lnum, false); char *const str = (char *)ml_get_buf(buf, lnum, false);
int score; int score;
uint32_t matches[MAX_FUZZY_MATCHES]; uint32_t matches[MAX_FUZZY_MATCHES];