Problem: Many type casts are used for vim_strnsave().
Solution: Make the length argument size_t instead of int. (Ken Takata,
closes #5633) Remove some type casts.
save_ei = vim_strsave(p_ei);
if (save_ei != NULL)
{
- new_ei = vim_strnsave(p_ei, (int)(STRLEN(p_ei) + STRLEN(what)));
+ new_ei = vim_strnsave(p_ei, STRLEN(p_ei) + STRLEN(what));
if (new_ei != NULL)
{
if (*what == ',' && *p_ei == NUL)
;
if (p > arg)
{
- group_name = vim_strnsave(arg, (int)(p - arg));
+ group_name = vim_strnsave(arg, p - arg);
if (group_name == NULL) // out of memory
return AUGROUP_ERROR;
group = au_find_group(group_name);
{
// Copy the message into allocated memory (excluding the NL)
// and remove it from the buffer (including the NL).
- msg = vim_strnsave(buf, (int)(nl - buf));
+ msg = vim_strnsave(buf, nl - buf);
channel_consume(channel, part, (int)(nl - buf) + 1);
}
}
{
// Copy the message into allocated memory and remove it from the
// buffer.
- msg = vim_strnsave(buf, (int)(nl - buf));
+ msg = vim_strnsave(buf, nl - buf);
channel_consume(channel, part, (int)(nl - buf) + 1);
}
}
{
if (ga_grow(&ga, 1) == FAIL)
break;
- ((char_u **)ga.ga_data)[ga.ga_len] = vim_strnsave(s, (int)(e - s));
+ ((char_u **)ga.ga_data)[ga.ga_len] = vim_strnsave(s, e - s);
++ga.ga_len;
}
for (p = *arg; ASCII_ISALNUM(*p) || *p == '_' || *p == '-'; ++p)
;
tv->v_type = VAR_STRING;
- tv->vval.v_string = vim_strnsave(*arg, (int)(p - *arg));
+ tv->vval.v_string = vim_strnsave(*arg, p - *arg);
*arg = skipwhite(p);
return OK;
if (curbuf->b_fname != NULL)
{
newname = vim_strnsave(curbuf->b_fname,
- (int)(STRLEN(curbuf->b_fname) + 4));
+ STRLEN(curbuf->b_fname) + 4);
if (newname != NULL)
STRCAT(newname, ".new");
}
{
kp = (kmap_T *)curbuf->b_kmap_ga.ga_data + curbuf->b_kmap_ga.ga_len;
s = skiptowhite(p);
- kp->from = vim_strnsave(p, (int)(s - p));
+ kp->from = vim_strnsave(p, s - p);
p = skipwhite(s);
s = skiptowhite(p);
- kp->to = vim_strnsave(p, (int)(s - p));
+ kp->to = vim_strnsave(p, s - p);
if (kp->from == NULL || kp->to == NULL
|| STRLEN(kp->from) + STRLEN(kp->to) >= KMAP_LLEN
if (n1 >= len || n2 < 0 || n1 > n2)
s = NULL;
else
- s = vim_strnsave(s + n1, (int)(n2 - n1 + 1));
+ s = vim_strnsave(s + n1, n2 - n1 + 1);
}
else
{
vim_free(li1->li_tv.vval.v_string);
li1->li_tv.vval.v_string = vim_strnsave(regmatch.startp[0],
- (int)(regmatch.endp[0] - regmatch.startp[0]));
+ regmatch.endp[0] - regmatch.startp[0]);
li3->li_tv.vval.v_number =
(varnumber_T)(regmatch.startp[0] - expr);
li4->li_tv.vval.v_number =
copy_tv(&li->li_tv, rettv);
else
rettv->vval.v_string = vim_strnsave(regmatch.startp[0],
- (int)(regmatch.endp[0] - regmatch.startp[0]));
+ regmatch.endp[0] - regmatch.startp[0]);
}
else if (l != NULL)
rettv->vval.v_number = idx;
}
}
}
- rettv->vval.v_string = vim_strnsave(head, (int)(tail - head));
+ rettv->vval.v_string = vim_strnsave(head, tail - head);
}
#ifdef FEAT_FLOAT
while (*linep && !VIM_ISWHITE(*linep) && *linep != '=')
++linep;
vim_free(key);
- key = vim_strnsave_up(key_start, (int)(linep - key_start));
+ key = vim_strnsave_up(key_start, linep - key_start);
if (key == NULL)
{
error = TRUE;
* shorter.
*/
char_u *
-vim_strnsave(char_u *string, int len)
+vim_strnsave(char_u *string, size_t len)
{
char_u *p;
* This uses ASCII lower-to-upper case translation, language independent.
*/
char_u *
-vim_strnsave_up(char_u *string, int len)
+vim_strnsave_up(char_u *string, size_t len)
{
char_u *p1;
void do_outofmem_msg(size_t size);
void free_all_mem(void);
char_u *vim_strsave(char_u *string);
-char_u *vim_strnsave(char_u *string, int len);
+char_u *vim_strnsave(char_u *string, size_t len);
char_u *vim_memsave(char_u *p, size_t len);
char_u *vim_strsave_escaped(char_u *string, char_u *esc_chars);
char_u *vim_strsave_escaped_ext(char_u *string, char_u *esc_chars, int cc, int bsl);
int csh_like_shell(void);
char_u *vim_strsave_shellescape(char_u *string, int do_special, int do_newline);
char_u *vim_strsave_up(char_u *string);
-char_u *vim_strnsave_up(char_u *string, int len);
+char_u *vim_strnsave_up(char_u *string, size_t len);
void vim_strup(char_u *p);
char_u *strup_save(char_u *orig);
char_u *strlow_save(char_u *orig);
while (*key_end && !VIM_ISWHITE(*key_end) && *key_end != '=')
++key_end;
vim_free(key);
- key = vim_strnsave_up(rest, (int)(key_end - rest));
+ key = vim_strnsave_up(rest, key_end - rest);
if (key == NULL) // out of memory
{
rest = NULL;
arg_end = skiptowhite(arg_start);
next_arg = skipwhite(arg_end);
vim_free(key);
- key = vim_strnsave_up(arg_start, (int)(arg_end - arg_start));
+ key = vim_strnsave_up(arg_start, arg_end - arg_start);
if (STRCMP(key, "CCOMMENT") == 0)
{
if (!eap->skip)
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 928,
/**/
927,
/**/