Skip to content

Commit

Permalink
Suppress vim_strnsave() warning
Browse files Browse the repository at this point in the history
Warning is occurred at here:
https://github.com/vim/vim/blob/7306d6b1c9528dcfe89eb77aa7ef354ffa9605a8/src/vim9compile.c#L4446

Maybe, it's better to change the prototype of vim_strnsave() than adding
type cast.
  • Loading branch information
k-takata committed Feb 13, 2020
1 parent 49c99fc commit 36cd4bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/misc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@ vim_strsave(char_u *string)
* shorter.
*/
char_u *
vim_strnsave(char_u *string, int len)
vim_strnsave(char_u *string, size_t len)
{
char_u *p;

Expand Down Expand Up @@ -1534,7 +1534,7 @@ vim_strsave_up(char_u *string)
* 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;

Expand Down
4 changes: 2 additions & 2 deletions src/proto/misc2.pro
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ void *mem_realloc(void *ptr, size_t size);
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);
Expand Down

0 comments on commit 36cd4bf

Please sign in to comment.