summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/GvimExt/gvimext.cpp6
-rw-r--r--src/GvimExt/gvimext.h8
-rw-r--r--src/Make_mvc.mak7
-rw-r--r--src/buffer.c8
-rw-r--r--src/charset.c2
-rw-r--r--src/diff.c4
-rw-r--r--src/edit.c24
-rw-r--r--src/eval.c93
-rw-r--r--src/ex_cmds.c36
-rw-r--r--src/ex_cmds2.c2
-rw-r--r--src/ex_docmd.c10
-rw-r--r--src/ex_eval.c2
-rw-r--r--src/ex_getln.c8
-rw-r--r--src/fileio.c30
-rw-r--r--src/fold.c10
-rw-r--r--src/getchar.c2
-rw-r--r--src/gui.c12
-rw-r--r--src/gui_w32.c12
-rw-r--r--src/gui_w48.c2
-rw-r--r--src/hardcopy.c32
-rw-r--r--src/hashtab.c16
-rw-r--r--src/if_cscope.c48
-rw-r--r--src/if_ruby.c14
-rw-r--r--src/main.c2
-rw-r--r--src/mbyte.c16
-rw-r--r--src/memline.c8
-rw-r--r--src/menu.c2
-rw-r--r--src/message.c26
-rw-r--r--src/misc1.c22
-rw-r--r--src/misc2.c2
-rw-r--r--src/netbeans.c32
-rw-r--r--src/normal.c4
-rw-r--r--src/ops.c10
-rw-r--r--src/option.c12
-rw-r--r--src/os_mswin.c26
-rw-r--r--src/os_win32.c14
-rw-r--r--src/po/zh_TW.UTF-8.po13
-rw-r--r--src/popupmnu.c4
-rw-r--r--src/proto/os_mswin.pro4
-rw-r--r--src/quickfix.c8
-rw-r--r--src/screen.c26
-rw-r--r--src/search.c14
-rw-r--r--src/spell.c182
-rw-r--r--src/syntax.c8
-rw-r--r--src/tag.c12
-rw-r--r--src/undo.c2
-rw-r--r--src/version.h6
47 files changed, 439 insertions, 404 deletions
diff --git a/src/GvimExt/gvimext.cpp b/src/GvimExt/gvimext.cpp
index c204a0c573..dbd769abed 100644
--- a/src/GvimExt/gvimext.cpp
+++ b/src/GvimExt/gvimext.cpp
@@ -103,7 +103,7 @@ getRuntimeDir(char *buf)
strcpy(buf, searchpath(buf));
// remove "gvim.exe" from the end
- for (idx = strlen(buf) - 1; idx >= 0; idx--)
+ for (idx = (int)strlen(buf) - 1; idx >= 0; idx--)
if (buf[idx] == '\\' || buf[idx] == '/')
{
buf[idx + 1] = 0;
@@ -279,7 +279,7 @@ dyn_gettext_load(void)
getRuntimeDir(szBuff);
if (szBuff[0] != 0)
{
- len = strlen(szBuff);
+ len = (DWORD)strlen(szBuff);
if (dyn_libintl_init(szBuff))
{
strcpy(szBuff + len, "lang");
@@ -740,7 +740,7 @@ STDMETHODIMP CShellExt::PushToWindow(HWND hParent,
return NOERROR;
}
-STDMETHODIMP CShellExt::GetCommandString(UINT idCmd,
+STDMETHODIMP CShellExt::GetCommandString(UINT_PTR idCmd,
UINT uFlags,
UINT FAR *reserved,
LPSTR pszName,
diff --git a/src/GvimExt/gvimext.h b/src/GvimExt/gvimext.h
index d68807320a..c0e39cb173 100644
--- a/src/GvimExt/gvimext.h
+++ b/src/GvimExt/gvimext.h
@@ -43,6 +43,12 @@
#include <windowsx.h>
#include <shlobj.h>
+/* Accommodate old versions of VC that don't have a modern Platform SDK */
+#if _MSC_VER < 1300
+#undef UINT_PTR
+#define UINT_PTR UINT
+#endif
+
#define ResultFromShort(i) ResultFromScode(MAKE_SCODE(SEVERITY_SUCCESS, 0, (USHORT)(i)))
// Initialize GUIDs (should be done only and at-least once per DLL/EXE)
@@ -152,7 +158,7 @@ public:
STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi);
- STDMETHODIMP GetCommandString(UINT idCmd,
+ STDMETHODIMP GetCommandString(UINT_PTR idCmd,
UINT uFlags,
UINT FAR *reserved,
LPSTR pszName,
diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak
index 9bb048703f..f9d211d347 100644
--- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -167,13 +167,16 @@ OBJDIR = $(OBJDIR)Z
OBJDIR = $(OBJDIR)d
!endif
-# Win32.mak requires that CPU be set appropriately
+# Win32.mak requires that CPU be set appropriately.
+# To cross-compile for Win64, set CPU=AMD64 or CPU=IA64.
!ifdef PROCESSOR_ARCHITECTURE
# We're on Windows NT or using VC 6+
+! ifndef CPU
CPU = $(PROCESSOR_ARCHITECTURE)
-! if ("$(CPU)" == "x86") || ("$(CPU)" == "X86")
+! if ("$(CPU)" == "x86") || ("$(CPU)" == "X86")
CPU = i386
+! endif
! endif
!else # !PROCESSOR_ARCHITECTURE
# We're on Windows 95
diff --git a/src/buffer.c b/src/buffer.c
index 64ed9711d0..7d625f2e59 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -3171,7 +3171,7 @@ maketitle()
i_name = gettail(curbuf->b_ffname);
*i_str = NUL;
/* Truncate name at 100 bytes. */
- len = STRLEN(i_name);
+ len = (int)STRLEN(i_name);
if (len > 100)
{
len -= 100;
@@ -3425,7 +3425,7 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hltab, t
}
else
#endif
- n = (p - t) - item[groupitem[groupdepth]].maxwid + 1;
+ n = (long)(p - t) - item[groupitem[groupdepth]].maxwid + 1;
*t = '<';
mch_memmove(t + 1, t + n, p - (t + n));
@@ -3461,7 +3461,7 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hltab, t
mch_memmove(t + n - l, t, p - t);
l = n - l;
if (p + l >= out + outlen)
- l = (out + outlen) - p - 1;
+ l = (long)((out + outlen) - p - 1);
p += l;
for (n = groupitem[groupdepth] + 1; n < curitem; n++)
item[n].start += l;
@@ -3792,7 +3792,7 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hltab, t
{
item[curitem].type = Highlight;
item[curitem].start = p;
- item[curitem].minwid = -syn_namen2id(t, s - t);
+ item[curitem].minwid = -syn_namen2id(t, (int)(s - t));
curitem++;
}
++s;
diff --git a/src/charset.c b/src/charset.c
index df8685216f..6ad8ae5876 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -351,7 +351,7 @@ transstr(s)
else
{
transchar_hex(hexbuf, c);
- len += STRLEN(hexbuf);
+ len += (int)STRLEN(hexbuf);
}
}
else
diff --git a/src/diff.c b/src/diff.c
index f5577f16b6..5f8a84a173 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -1850,8 +1850,8 @@ diff_find_change(wp, lnum, startp, endp)
&& vim_iswhite(line_org[si_org])
&& vim_iswhite(line_new[si_new]))
{
- si_org = skipwhite(line_org + si_org) - line_org;
- si_new = skipwhite(line_new + si_new) - line_new;
+ si_org = (int)(skipwhite(line_org + si_org) - line_org);
+ si_new = (int)(skipwhite(line_new + si_new) - line_new);
}
else
{
diff --git a/src/edit.c b/src/edit.c
index 8fd9ed451f..c6287e056e 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -2485,7 +2485,7 @@ ins_compl_show_pum()
compl_match_arraysize = 0;
compl = compl_first_match;
if (compl_leader != NULL)
- lead_len = STRLEN(compl_leader);
+ lead_len = (int)STRLEN(compl_leader);
do
{
if ((compl->cp_flags & ORIGINAL_TEXT) == 0
@@ -2643,7 +2643,7 @@ ins_compl_dictionaries(dict_start, pat, flags, thesaurus)
* pattern. */
if (ctrl_x_mode == CTRL_X_WHOLE_LINE)
{
- i = STRLEN(pat) + 8;
+ i = (int)STRLEN(pat) + 8;
ptr = alloc(i);
if (ptr == NULL)
return;
@@ -2967,7 +2967,7 @@ ins_compl_bs()
mb_ptr_back(line, p);
vim_free(compl_leader);
- compl_leader = vim_strnsave(line + compl_col, (p - line) - compl_col);
+ compl_leader = vim_strnsave(line + compl_col, (int)(p - line) - compl_col);
if (compl_leader != NULL)
{
ins_compl_del_pum();
@@ -3988,7 +3988,7 @@ ins_compl_next(allow_get_expansion, count, insert_match)
/* Set "compl_shown_match" to the actually shown match, it may differ
* when "compl_leader" is used to omit some of the matches. */
while (!ins_compl_equal(compl_shown_match,
- compl_leader, STRLEN(compl_leader))
+ compl_leader, (int)STRLEN(compl_leader))
&& compl_shown_match->cp_next != NULL
&& compl_shown_match->cp_next != compl_first_match)
compl_shown_match = compl_shown_match->cp_next;
@@ -4038,7 +4038,7 @@ ins_compl_next(allow_get_expansion, count, insert_match)
if ((compl_shown_match->cp_flags & ORIGINAL_TEXT) == 0
&& compl_leader != NULL
&& !ins_compl_equal(compl_shown_match,
- compl_leader, STRLEN(compl_leader)))
+ compl_leader, (int)STRLEN(compl_leader)))
++todo;
else
/* Remember a matching item. */
@@ -4446,7 +4446,7 @@ ins_complete(c)
}
else if (ctrl_x_mode == CTRL_X_WHOLE_LINE)
{
- compl_col = skipwhite(line) - line;
+ compl_col = (colnr_T)(skipwhite(line) - line);
compl_length = (int)curs_col - (int)compl_col;
if (compl_length < 0) /* cursor in indent: empty pattern */
compl_length = 0;
@@ -5668,7 +5668,7 @@ auto_format(trailblank, prev_line)
if (!wasatend && has_format_option(FO_WHITE_PAR))
{
new = ml_get_curline();
- len = STRLEN(new);
+ len = (colnr_T)STRLEN(new);
if (curwin->w_cursor.col == len)
{
pnew = vim_strnsave(new, len + 2);
@@ -5984,7 +5984,7 @@ stop_insert(end_insert_pos, esc)
* deleted characters. */
if (VIsual_active && VIsual.lnum == curwin->w_cursor.lnum)
{
- cc = STRLEN(ml_get_curline());
+ cc = (int)STRLEN(ml_get_curline());
if (VIsual.col > (colnr_T)cc)
{
VIsual.col = cc;
@@ -6718,7 +6718,7 @@ replace_do_bs()
del_char(FALSE);
# ifdef FEAT_VREPLACE
if (State & VREPLACE_FLAG)
- orig_len = STRLEN(ml_get_cursor());
+ orig_len = (int)STRLEN(ml_get_cursor());
# endif
replace_push(cc);
}
@@ -6728,7 +6728,7 @@ replace_do_bs()
pchar_cursor(cc);
#ifdef FEAT_VREPLACE
if (State & VREPLACE_FLAG)
- orig_len = STRLEN(ml_get_cursor()) - 1;
+ orig_len = (int)STRLEN(ml_get_cursor()) - 1;
#endif
}
replace_pop_ins();
@@ -6738,7 +6738,7 @@ replace_do_bs()
{
/* Get the number of screen cells used by the inserted characters */
p = ml_get_cursor();
- ins_len = STRLEN(p) - orig_len;
+ ins_len = (int)STRLEN(p) - orig_len;
vcol = start_vcol;
for (i = 0; i < ins_len; ++i)
{
@@ -7908,7 +7908,7 @@ ins_bs(c, mode, inserted_space_p)
TRUE);
int len;
- len = STRLEN(ptr);
+ len = (int)STRLEN(ptr);
if (len > 0 && ptr[len - 1] == ' ')
ptr[len - 1] = NUL;
}
diff --git a/src/eval.c b/src/eval.c
index 4dc6a299d4..1f208b9180 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1913,7 +1913,7 @@ list_hashtable_vars(ht, prefix, empty)
dictitem_T *di;
int todo;
- todo = ht->ht_used;
+ todo = (int)ht->ht_used;
for (hi = ht->ht_array; todo > 0 && !got_int; ++hi)
{
if (!HASHITEM_EMPTY(hi))
@@ -2666,7 +2666,7 @@ set_var_lval(lp, endp, rettv, copy, op)
typval_T tv;
/* handle +=, -= and .= */
- if (get_var_tv(lp->ll_name, STRLEN(lp->ll_name),
+ if (get_var_tv(lp->ll_name, (int)STRLEN(lp->ll_name),
&tv, TRUE) == OK)
{
if (tv_op(&tv, rettv, op) == OK)
@@ -3129,7 +3129,7 @@ ex_call(eap)
++fudi.fd_dict->dv_refcount;
/* If it is the name of a variable of type VAR_FUNC use its contents. */
- len = STRLEN(tofree);
+ len = (int)STRLEN(tofree);
name = deref_func_name(tofree, &len);
/* Skip white space to allow ":call func ()". Not good, but required for
@@ -3164,7 +3164,7 @@ ex_call(eap)
curwin->w_cursor.col = 0;
}
arg = startarg;
- if (get_func_tv(name, STRLEN(name), &rettv, &arg,
+ if (get_func_tv(name, (int)STRLEN(name), &rettv, &arg,
eap->line1, eap->line2, &doesrange,
!eap->skip, fudi.fd_dict) == FAIL)
{
@@ -3491,7 +3491,7 @@ item_lock(tv, deep, lock)
if (deep < 0 || deep > 1)
{
/* recursive: lock/unlock the items the List contains */
- todo = d->dv_hashtab.ht_used;
+ todo = (int)d->dv_hashtab.ht_used;
for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi)
{
if (!HASHITEM_EMPTY(hi))
@@ -3534,7 +3534,7 @@ del_menutrans_vars()
int todo;
hash_lock(&globvarht);
- todo = globvarht.ht_used;
+ todo = (int)globvarht.ht_used;
for (hi = globvarht.ht_array; todo > 0 && !got_int; ++hi)
{
if (!HASHITEM_EMPTY(hi))
@@ -5480,7 +5480,7 @@ dict_equal(d1, d2, ic)
if (dict_len(d1) != dict_len(d2))
return FALSE;
- todo = d1->dv_hashtab.ht_used;
+ todo = (int)d1->dv_hashtab.ht_used;
for (hi = d1->dv_hashtab.ht_array; todo > 0; ++hi)
{
if (!HASHITEM_EMPTY(hi))
@@ -6130,7 +6130,7 @@ set_ref_in_ht(ht, copyID)
int todo;
hashitem_T *hi;
- todo = ht->ht_used;
+ todo = (int)ht->ht_used;
for (hi = ht->ht_array; todo > 0; ++hi)
if (!HASHITEM_EMPTY(hi))
{
@@ -6251,7 +6251,7 @@ dict_free(d)
/* Lock the hashtab, we don't want it to resize while freeing items. */
hash_lock(&d->dv_hashtab);
- todo = d->dv_hashtab.ht_used;
+ todo = (int)d->dv_hashtab.ht_used;
for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi)
{
if (!HASHITEM_EMPTY(hi))
@@ -6280,7 +6280,7 @@ dictitem_alloc(key)
{
dictitem_T *di;
- di = (dictitem_T *)alloc(sizeof(dictitem_T) + STRLEN(key));
+ di = (dictitem_T *)alloc((unsigned)(sizeof(dictitem_T) + STRLEN(key)));
if (di != NULL)
{
STRCPY(di->di_key, key);
@@ -6298,7 +6298,8 @@ dictitem_copy(org)
{
dictitem_T *di;
- di = (dictitem_T *)alloc(sizeof(dictitem_T) + STRLEN(org->di_key));
+ di = (dictitem_T *)alloc((unsigned)(sizeof(dictitem_T)
+ + STRLEN(org->di_key)));
if (di != NULL)
{
STRCPY(di->di_key, org->di_key);
@@ -6365,7 +6366,7 @@ dict_copy(orig, deep, copyID)
orig->dv_copyID = copyID;
orig->dv_copydict = copy;
}
- todo = orig->dv_hashtab.ht_used;
+ todo = (int)orig->dv_hashtab.ht_used;
for (hi = orig->dv_hashtab.ht_array; todo > 0 && !got_int; ++hi)
{
if (!HASHITEM_EMPTY(hi))
@@ -6462,7 +6463,7 @@ dict_len(d)
{
if (d == NULL)
return 0L;
- return d->dv_hashtab.ht_used;
+ return (long)d->dv_hashtab.ht_used;
}
/*
@@ -6567,7 +6568,7 @@ dict2string(tv, copyID)
ga_init2(&ga, (int)sizeof(char), 80);
ga_append(&ga, '{');
- todo = d->dv_hashtab.ht_used;
+ todo = (int)d->dv_hashtab.ht_used;
for (hi = d->dv_hashtab.ht_array; todo > 0 && !got_int; ++hi)
{
if (!HASHITEM_EMPTY(hi))
@@ -6859,7 +6860,7 @@ string_quote(str, function)
len = (function ? 13 : 3);
if (str != NULL)
{
- len += STRLEN(str);
+ len += (unsigned)STRLEN(str);
for (p = str; *p != NUL; mb_ptr_adv(p))
if (*p == '\'')
++len;
@@ -7291,7 +7292,7 @@ deref_func_name(name, lenp)
*lenp = 0;
return (char_u *)""; /* just in case */
}
- *lenp = STRLEN(v->di_tv.vval.v_string);
+ *lenp = (int)STRLEN(v->di_tv.vval.v_string);
return v->di_tv.vval.v_string;
}
@@ -7554,21 +7555,21 @@ call_func(name, len, rettv, argcount, argvars, firstline, lastline,
switch (error)
{
case ERROR_UNKNOWN:
- emsg_funcname("E117: Unknown function: %s", name);
+ emsg_funcname(N_("E117: Unknown function: %s"), name);
break;
case ERROR_TOOMANY:
emsg_funcname(e_toomanyarg, name);
break;
case ERROR_TOOFEW:
- emsg_funcname("E119: Not enough arguments for function: %s",
+ emsg_funcname(N_("E119: Not enough arguments for function: %s"),
name);
break;
case ERROR_SCRIPT:
- emsg_funcname("E120: Using <SID> not in a script context: %s",
+ emsg_funcname(N_("E120: Using <SID> not in a script context: %s"),
name);
break;
case ERROR_DICT:
- emsg_funcname("E725: Calling dict function without Dictionary: %s",
+ emsg_funcname(N_("E725: Calling dict function without Dictionary: %s"),
name);
break;
}
@@ -8047,7 +8048,7 @@ f_byteidx(argvars, rettv)
return;
t += (*mb_ptr2len)(t);
}
- rettv->vval.v_number = t - str;
+ rettv->vval.v_number = (varnumber_T)(t - str);
#else
if (idx <= STRLEN(str))
rettv->vval.v_number = idx;
@@ -8110,7 +8111,7 @@ f_call(argvars, rettv)
}
if (item == NULL)
- (void)call_func(func, STRLEN(func), rettv, argc, argv,
+ (void)call_func(func, (int)STRLEN(func), rettv, argc, argv,
curwin->w_cursor.lnum, curwin->w_cursor.lnum,
&dummy, TRUE, selfdict);
@@ -8191,7 +8192,7 @@ f_col(argvars, rettv)
{
/* '> can be MAXCOL, get the length of the line then */
if (fp->lnum <= curbuf->b_ml.ml_line_count)
- col = STRLEN(ml_get(fp->lnum)) + 1;
+ col = (colnr_T)STRLEN(ml_get(fp->lnum)) + 1;
else
col = MAXCOL;
}
@@ -8420,7 +8421,7 @@ f_count(argvars, rettv)
EMSG(_(e_invarg));
}
- todo = error ? 0 : d->dv_hashtab.ht_used;
+ todo = error ? 0 : (int)d->dv_hashtab.ht_used;
for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi)
{
if (!HASHITEM_EMPTY(hi))
@@ -8952,7 +8953,7 @@ f_extend(argvars, rettv)
/* Go over all entries in the second dict and add them to the
* first dict. */
- todo = d2->dv_hashtab.ht_used;
+ todo = (int)d2->dv_hashtab.ht_used;
for (hi2 = d2->dv_hashtab.ht_array; todo > 0; ++hi2)
{
if (!HASHITEM_EMPTY(hi2))
@@ -9154,7 +9155,7 @@ filter_map(argvars, rettv, map)
ht = &d->dv_hashtab;
hash_lock(ht);
- todo = ht->ht_used;
+ todo = (int)ht->ht_used;
for (hi = ht->ht_array; todo > 0; ++hi)
{
if (!HASHITEM_EMPTY(hi))
@@ -11320,7 +11321,7 @@ f_input(argvars, rettv)
if (xp_name == NULL)
return;
- xp_namelen = STRLEN(xp_name);
+ xp_namelen = (int)STRLEN(xp_name);
if (parse_compl_arg(xp_name, xp_namelen, &xp_type, &argt,
&xp_arg) == FAIL)
@@ -11634,7 +11635,7 @@ dict_list(argvars, rettv, what)
if (rettv_list_alloc(rettv) == FAIL)
return;
- todo = d->dv_hashtab.ht_used;
+ todo = (int)d->dv_hashtab.ht_used;
for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi)
{
if (!HASHITEM_EMPTY(hi))
@@ -12153,8 +12154,8 @@ find_some_match(argvars, rettv, type)
else
{
#ifdef FEAT_MBYTE
- startcol = regmatch.startp[0]
- + (*mb_ptr2len)(regmatch.startp[0]) - str;
+ startcol = (colnr_T)(regmatch.startp[0]
+ + (*mb_ptr2len)(regmatch.startp[0]) - str);
#else
startcol = regmatch.startp[0] + 1 - str;
#endif
@@ -12198,7 +12199,7 @@ find_some_match(argvars, rettv, type)
else
rettv->vval.v_number =
(varnumber_T)(regmatch.endp[0] - str);
- rettv->vval.v_number += str - expr;
+ rettv->vval.v_number += (varnumber_T)(str - expr);
}
}
vim_free(regmatch.regprog);
@@ -12323,7 +12324,7 @@ max_min(argvars, rettv, domax)
d = argvars[0].vval.v_dict;
if (d != NULL)
{
- todo = d->dv_hashtab.ht_used;
+ todo = (int)d->dv_hashtab.ht_used;
for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi)
{
if (!HASHITEM_EMPTY(hi))
@@ -12711,7 +12712,7 @@ f_readfile(argvars, rettv)
filtd = 0;
while (cnt < maxline || maxline < 0)
{
- readlen = fread(buf + filtd, 1, FREAD_SIZE - filtd, fd);
+ readlen = (int)fread(buf + filtd, 1, FREAD_SIZE - filtd, fd);
buflen = filtd + readlen;
tolist = 0;
for ( ; filtd < buflen || readlen <= 0; ++filtd)
@@ -14599,7 +14600,7 @@ item_compare2(s1, s2)
copy_tv(&(*(listitem_T **)s2)->li_tv, &argv[1]);
rettv.v_type = VAR_UNKNOWN; /* clear_tv() uses this */
- res = call_func(item_compare_func, STRLEN(item_compare_func),
+ res = call_func(item_compare_func, (int)STRLEN(item_compare_func),
&rettv, 2, argv, 0L, 0L, &dummy, TRUE, NULL);
clear_tv(&argv[0]);
clear_tv(&argv[1]);
@@ -15134,7 +15135,7 @@ f_strridx(argvars, rettv)
needle = get_tv_string_chk(&argvars[1]);
haystack = get_tv_string_buf_chk(&argvars[0], buf);
- haystack_len = STRLEN(haystack);
+ haystack_len = (int)STRLEN(haystack);
rettv->vval.v_number = -1;
if (needle == NULL || haystack == NULL)
@@ -16972,7 +16973,7 @@ handle_subscript(arg, rettv, evaluate, verbose)
/* Invoke the function. Recursive! */
s = functv.vval.v_string;
- ret = get_func_tv(s, STRLEN(s), rettv, arg,
+ ret = get_func_tv(s, (int)STRLEN(s), rettv, arg,
curwin->w_cursor.lnum, curwin->w_cursor.lnum,
&len, evaluate, selfdict);
@@ -17512,7 +17513,7 @@ vars_clear_ext(ht, free_val)
dictitem_T *v;
hash_lock(ht);
- todo = ht->ht_used;
+ todo = (int)ht->ht_used;
for (hi = ht->ht_array; todo > 0; ++hi)
{
if (!HASHITEM_EMPTY(hi))
@@ -18166,7 +18167,7 @@ ex_function(eap)
{
if (!eap->skip)
{
- todo = func_hashtab.ht_used;
+ todo = (int)func_hashtab.ht_used;
for (hi = func_hashtab.ht_array; todo > 0 && !got_int; ++hi)
{
if (!HASHITEM_EMPTY(hi))
@@ -18200,7 +18201,7 @@ ex_function(eap)
{
regmatch.rm_ic = p_ic;
- todo = func_hashtab.ht_used;
+ todo = (int)func_hashtab.ht_used;
for (hi = func_hashtab.ht_array; todo > 0 && !got_int; ++hi)
{
if (!HASHITEM_EMPTY(hi))
@@ -18684,8 +18685,8 @@ ex_function(eap)
if (scriptname != NULL)
{
p = vim_strchr(scriptname, '/');
- plen = STRLEN(p);
- slen = STRLEN(sourcing_name);
+ plen = (int)STRLEN(p);
+ slen = (int)STRLEN(sourcing_name);
if (slen > plen && fnamecmp(p,
sourcing_name + slen - plen) == 0)
j = OK;
@@ -18866,7 +18867,7 @@ trans_function_name(pp, skip, flags, fdp)
if (lv.ll_exp_name != NULL)
{
- len = STRLEN(lv.ll_exp_name);
+ len = (int)STRLEN(lv.ll_exp_name);
if (lead <= 2 && lv.ll_name == lv.ll_exp_name
&& STRNCMP(lv.ll_name, "s:", 2) == 0)
{
@@ -19110,7 +19111,7 @@ func_dump_profile(fd)
ufunc_T **sorttab;
int st_len = 0;
- todo = func_hashtab.ht_used;
+ todo = (int)func_hashtab.ht_used;
sorttab = (ufunc_T **)alloc((unsigned)(sizeof(ufunc_T) * todo));
for (hi = func_hashtab.ht_array; todo > 0; ++hi)
@@ -20274,7 +20275,7 @@ write_viminfo_varlist(fp)
fprintf(fp, _("\n# global variables:\n"));
- todo = globvarht.ht_used;
+ todo = (int)globvarht.ht_used;
for (hi = globvarht.ht_array; todo > 0; ++hi)
{
if (!HASHITEM_EMPTY(hi))
@@ -20310,7 +20311,7 @@ store_session_globals(fd)
int todo;
char_u *p, *t;
- todo = globvarht.ht_used;
+ todo = (int)globvarht.ht_used;
for (hi = globvarht.ht_array; todo > 0; ++hi)
{
if (!HASHITEM_EMPTY(hi))
@@ -20542,7 +20543,7 @@ shortpath_for_partial(fnamep, bufp, fnamelen)
else
pbuf = tfname = FullName_save(*fnamep, FALSE);
- len = tflen = STRLEN(tfname);
+ len = tflen = (int)STRLEN(tfname);
if (!get_short_pathname(&tfname, &pbuf, &len))
return -1;
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 533b2cc097..aafe31cf09 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -435,7 +435,7 @@ ex_sort(eap)
for (lnum = eap->line1; lnum <= eap->line2; ++lnum)
{
s = ml_get(lnum);
- len = STRLEN(s);
+ len = (int)STRLEN(s);
if (maxlen < len)
maxlen = len;
@@ -445,11 +445,11 @@ ex_sort(eap)
{
if (sort_rx)
{
- start_col = regmatch.startp[0] - s;
- end_col = regmatch.endp[0] - s;
+ start_col = (colnr_T)(regmatch.startp[0] - s);
+ end_col = (colnr_T)(regmatch.endp[0] - s);
}
else
- start_col = regmatch.endp[0] - s;
+ start_col = (colnr_T)(regmatch.endp[0] - s);
}
else
if (regmatch.regprog != NULL)
@@ -526,7 +526,7 @@ ex_sort(eap)
count = 0;
/* Adjust marks for deleted (or added) lines and prepare for displaying. */
- deleted = count - (lnum - eap->line2);
+ deleted = (long)(count - (lnum - eap->line2));
if (deleted > 0)
mark_adjust(eap->line2 - deleted, eap->line2, (long)MAXLNUM, -deleted);
else if (deleted < 0)
@@ -3182,7 +3182,7 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags)
/* Set v:swapcommand for the SwapExists autocommands. */
if (command != NULL)
- len = STRLEN(command) + 3;
+ len = (int)STRLEN(command) + 3;
else
len = 30;
p = alloc((unsigned)len);
@@ -3986,7 +3986,7 @@ ex_z(eap)
switch (*kind)
{
case '-':
- start = lnum - bigness * (x - kind);
+ start = lnum - bigness * (linenr_T)(x - kind);
end = start + bigness;
curs = end;
break;
@@ -4013,7 +4013,7 @@ ex_z(eap)
default: /* '+' */
start = lnum;
if (*kind == '+')
- start += bigness * (x - kind - 1) + 1;
+ start += bigness * (linenr_T)(x - kind - 1) + 1;
else if (eap->addr_count == 0)
++start;
end = start + bigness - 1;
@@ -4514,7 +4514,7 @@ do_sub(eap)
* Avoids that ":s/\nB\@=//gc" get stuck. */
if (nmatch > 1)
{
- matchcol = STRLEN(sub_firstline);
+ matchcol = (colnr_T)STRLEN(sub_firstline);
nmatch = 1;
}