patch 9.1.0449: MS-Windows: Compiler warnings
Problem: MS-Windows: Compiler warnings
Solution: Resolve size_t to int warnings
closes: #14874
A couple of warnings in ex_docmd.c have been resolved by modifying their
function argument types, followed by some changes in various function
call sites. This also allowed removal of some casts to cope with
size_t/int conversion.
Signed-off-by: Mike Williams <mrmrdubya@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index c2aaca0..71bfa93 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -5077,7 +5077,7 @@
{
int has_wildcards; // need to expand wildcards
char_u *repl;
- int srclen;
+ size_t srclen;
char_u *p;
int n;
int escaped;
@@ -5201,7 +5201,7 @@
}
}
- p = repl_cmdline(eap, p, (size_t)srclen, repl, cmdlinep);
+ p = repl_cmdline(eap, p, srclen, repl, cmdlinep);
vim_free(repl);
if (p == NULL)
return FAIL;
@@ -9363,7 +9363,7 @@
* the variable. Otherwise return -1 and "*usedlen" is unchanged.
*/
int
-find_cmdline_var(char_u *src, int *usedlen)
+find_cmdline_var(char_u *src, size_t *usedlen)
{
// must be sorted by the 'value' field because it is used by bsearch()!
static keyvalue_T spec_str_tab[] = {
@@ -9444,7 +9444,7 @@
eval_vars(
char_u *src, // pointer into commandline
char_u *srcstart, // beginning of valid memory for src
- int *usedlen, // characters after src that are used
+ size_t *usedlen, // characters after src that are used
linenr_T *lnump, // line number for :e command, or NULL
char **errormsg, // pointer to error message
int *escaped, // return value has escaped white space (can
@@ -9514,7 +9514,7 @@
*/
else
{
- int off = 0;
+ size_t off = 0;
switch (spec_idx)
{
@@ -9781,7 +9781,7 @@
size_t len;
char_u *repl;
size_t repllen;
- int srclen;
+ size_t srclen;
char_u *p;
resultlen = STRLEN(arg);