build: enable MSVC level 3 warnings (#21934)

MSVC has 4 different warning levels: 1 (severe), 2 (significant), 3
(production quality) and 4 (informational). Enabling level 3 warnings
mostly revealed conversion problems, similar to GCC/clang -Wconversion
flag.
This commit is contained in:
dundargoc
2023-02-11 10:25:24 +01:00
committed by GitHub
parent c8c930ea78
commit 7224c889e0
32 changed files with 192 additions and 173 deletions

View File

@@ -1311,16 +1311,16 @@ static void parse_register(exarg_T *eap)
}
// Change line1 and line2 of Ex command to use count
void set_cmd_count(exarg_T *eap, long count, bool validate)
void set_cmd_count(exarg_T *eap, linenr_T count, bool validate)
{
if (eap->addr_type != ADDR_LINES) { // e.g. :buffer 2, :sleep 3
eap->line2 = (linenr_T)count;
eap->line2 = count;
if (eap->addr_count == 0) {
eap->addr_count = 1;
}
} else {
eap->line1 = eap->line2;
eap->line2 += (linenr_T)count - 1;
eap->line2 += count - 1;
eap->addr_count++;
// Be vi compatible: no error message for out of range.
if (validate && eap->line2 > curbuf->b_ml.ml_line_count) {
@@ -1338,7 +1338,7 @@ static int parse_count(exarg_T *eap, char **errormsg, bool validate)
if ((eap->argt & EX_COUNT) && ascii_isdigit(*eap->arg)
&& (!(eap->argt & EX_BUFNAME) || *(p = skipdigits(eap->arg + 1)) == NUL
|| ascii_iswhite(*p))) {
long n = getdigits_long(&eap->arg, false, -1);
linenr_T n = getdigits_int32(&eap->arg, false, -1);
eap->arg = skipwhite(eap->arg);
if (eap->args != NULL) {