patch 9.1.0957: MS-Windows: conversion warnings

Commit: 
https://github.com/vim/vim/commit/084529c03dd3e74c0d4f46a93f76e33789ac112e
Author: Yegappan Lakshmanan <yegap...@yahoo.com>
Date:   Tue Dec 24 09:50:01 2024 +0100

    patch 9.1.0957: MS-Windows: conversion warnings
    
    Problem:  MS-Windows: conversion warnings
    Solution: add explicit type casts (Yegappan Lakshmanan)
    
    closes: #16288
    
    Signed-off-by: Yegappan Lakshmanan <yegap...@yahoo.com>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/ex_getln.c b/src/ex_getln.c
index 163c474db..93d612a70 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -628,7 +628,7 @@ may_adjust_incsearch_highlighting(
            return FAIL;
        }
        skiplen = 0;
-       patlen = last_search_pattern_len();
+       patlen = (int)last_search_pattern_len();
     }
     else
        pat = ccline.cmdbuff + skiplen;
@@ -1472,7 +1472,7 @@ cmdline_browse_history(
                }
                if (i == 0)
                {
-                   alloc_cmdbuff(len);
+                   alloc_cmdbuff((int)len);
                    if (ccline.cmdbuff == NULL)
                    {
                        res = GOTO_NORMAL_MODE;
@@ -1481,18 +1481,18 @@ cmdline_browse_history(
                }
            }
            ccline.cmdbuff[len] = NUL;
-           ccline.cmdpos = ccline.cmdlen = len;
+           ccline.cmdpos = ccline.cmdlen = (int)len;
        }
        else
        {
-           alloc_cmdbuff(plen);
+           alloc_cmdbuff((int)plen);
            if (ccline.cmdbuff == NULL)
            {
                res = GOTO_NORMAL_MODE;
                goto done;
            }
            STRCPY(ccline.cmdbuff, p);
-           ccline.cmdpos = ccline.cmdlen = plen;
+           ccline.cmdpos = ccline.cmdlen = (int)plen;
        }
 
        redrawcmd();
@@ -4778,8 +4778,8 @@ open_cmdwin(void)
            {
                // Execute the command directly.
                ccline.cmdbuff = vim_strnsave(p, plen);
-               ccline.cmdlen = plen;
-               ccline.cmdbufflen = plen + 1;
+               ccline.cmdlen = (int)plen;
+               ccline.cmdbufflen = (int)(plen + 1);
                cmdwin_result = CAR;
            }
            else
diff --git a/src/filepath.c b/src/filepath.c
index 3dd71bc40..1ac2f868a 100644
--- a/src/filepath.c
+++ b/src/filepath.c
@@ -675,7 +675,7 @@ repeat:
                            if (s != NULL)
                            {
                                *fnamep = s;
-                               *fnamelen = slen;
+                               *fnamelen = (int)slen;
                                vim_free(*bufp);
                                *bufp = s;
                                didit = TRUE;
diff --git a/src/option.c b/src/option.c
index f069d0f4b..e4c52bd35 100644
--- a/src/option.c
+++ b/src/option.c
@@ -193,7 +193,7 @@ set_init_default_backupskip(void)
                itemlen = vim_snprintf((char *)item, itemsize, "%s%s*", p, 
(has_trailing_path_sep) ? "" : PATHSEPSTR);
 
                if (find_dup_item(ga.ga_data, item, itemlen, 
options[opt_idx].flags) == NULL
-                       && ga_grow(&ga, itemseplen + itemlen + 1) == OK)
+                       && ga_grow(&ga, (int)(itemseplen + itemlen + 1)) == OK)
                {
                    ga.ga_len += vim_snprintf((char *)ga.ga_data + ga.ga_len,
                                    itemseplen + itemlen + 1,
@@ -8415,7 +8415,7 @@ vimrc_found(char_u *fname, char_u *envname)
                if (vim_getenv((char_u *)"MYVIMDIR", &dofree) == NULL)
                {
                    size_t  usedlen = 0;
-                   int     len = 0;
+                   size_t  len = 0;
                    char_u  *fbuf = NULL;
 
                    if (STRNCMP(gettail(fname), ".vimrc", 6) == 0)
@@ -8452,7 +8452,7 @@ vimrc_found(char_u *fname, char_u *envname)
                    }
 #endif
                    else
-                       (void)modify_fname((char_u *)":h", FALSE, &usedlen, &p, 
&fbuf, &len);
+                       (void)modify_fname((char_u *)":h", FALSE, &usedlen, &p, 
&fbuf, (int *)&len);
 
                    if (p != NULL)
                    {
diff --git a/src/undo.c b/src/undo.c
index 52df9394f..764912ae6 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -3124,7 +3124,7 @@ ex_undolist(exarg_T *eap UNUSED)
 
            // we have to call STRLEN() here because add_time() does not report
            // the number of characters added.
-           len += STRLEN(IObuff + len);
+           len += (int)STRLEN(IObuff + len);
            if (uhp->uh_save_nr > 0)
            {
                int n = (len >= 33) ? 0 : 33 - len;
diff --git a/src/usercmd.c b/src/usercmd.c
index c0d1bdb69..ff2c353e3 100644
--- a/src/usercmd.c
+++ b/src/usercmd.c
@@ -671,7 +671,7 @@ uc_list(char_u *name, size_t name_len)
            if (entry != NULL)
            {
                STRCPY(IObuff + len, entry->value.string);
-               len += entry->value.length;
+               len += (int)entry->value.length;
 #ifdef FEAT_EVAL
                if (p_verbose > 0 && cmd->uc_compl_arg != NULL)
                {
@@ -681,7 +681,7 @@ uc_list(char_u *name, size_t name_len)
                    {
                        IObuff[len++] = ',';
                        STRCPY(IObuff + len, cmd->uc_compl_arg);
-                       len += uc_compl_arglen;
+                       len += (int)uc_compl_arglen;
                    }
                }
 #endif
diff --git a/src/version.c b/src/version.c
index 700603962..8fa6c6996 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    957,
 /**/
     956,
 /**/
diff --git a/src/vim9compile.c b/src/vim9compile.c
index c84096360..c8a50cf4c 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -1838,7 +1838,7 @@ compile_lhs_script_var(
     int                script_var = FALSE;
     imported_T *import;
     char_u     *var_name;
-    int                var_name_len;
+    size_t     var_name_len;
 
     if (lhs->lhs_varlen > 1 && STRNCMP(var_start, "s:", 2) == 0)
        script_namespace = TRUE;
diff --git a/src/vim9execute.c b/src/vim9execute.c
index f20ff4064..de49aaa70 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -3184,7 +3184,7 @@ any_var_get_obj_member(class_T *current_class, isn_T 
*iptr, typval_T *tv)
     copy_tv(tv, &mtv);
 
     // 'name' can either be a object variable or a object method
-    int                namelen = STRLEN(iptr->isn_arg.string);
+    int                namelen = (int)STRLEN(iptr->isn_arg.string);
     int                save_did_emsg = did_emsg;
 
     if (get_member_tv(obj->obj_class, TRUE, iptr->isn_arg.string, namelen,
diff --git a/src/viminfo.c b/src/viminfo.c
index 0a433a7cf..5f1ad7475 100644
--- a/src/viminfo.c
+++ b/src/viminfo.c
@@ -1142,7 +1142,7 @@ barline_parse(vir_T *virp, char_u *text, garray_T *values)
                        // freed later, also need to free "buf" later
                        value->bv_tofree = buf;
                    s = sconv;
-                   len = STRLEN(s);
+                   len = (int)STRLEN(s);
                    converted = TRUE;
                }
            }

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1tQ0lt-000Lvy-Es%40256bit.org.

Raspunde prin e-mail lui