From 883114e8824ecf5094faa2c860bd1379228d209f Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 27 Dec 2020 12:14:32 -0500 Subject: vim-patch:8.2.0928: many type casts are used for vim_strnsave() Problem: Many type casts are used for vim_strnsave(). Solution: Make the length argument size_t instead of int. (Ken Takata, closes vim/vim#5633) Remove some type casts. https://github.com/vim/vim/commit/df44a27b53586fccfc6a3aedc89061fdd9a515ff N/A patches for version.c: vim-patch:8.2.0315: build failure on HP-UX system Problem: Build failure on HP-UX system. Solution: Use LONG_LONG_MIN instead of LLONG_MIN. Add type casts for switch statement. (John Marriott) https://github.com/vim/vim/commit/c593bec4120f122e8a9129ec461968f1bd214435 vim-patch:8.2.1052: build failure with older compilers Problem: Build failure with older compilers. Solution: Move declaration to start of block. https://github.com/vim/vim/commit/7acde51832f383f9a6d2e740cd0420b433ea841a vim-patch:8.2.2229: build failure without the +eval feature Problem: build failure without the +eval feature. Solution: Add #ifdef. https://github.com/vim/vim/commit/39cb2dab18e85fc60f116a4543e433616872b690 vim-patch:8.2.2232: compiler error for falling through into next case Problem: Compiler error for falling through into next case. Solution: Move FALLTHROUGH below the #endif https://github.com/vim/vim/commit/9618a25b9c054f0ee4e267d2db96b6e7c113ed7a --- src/nvim/ex_docmd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/nvim/ex_docmd.c') diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 8828e781b6..3fc02e0693 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -4988,7 +4988,6 @@ static int uc_add_command(char_u *name, size_t name_len, char_u *rep, FUNC_ATTR_NONNULL_ARG(1, 3) { ucmd_T *cmd = NULL; - char_u *p; int i; int cmp = 1; char_u *rep_buf = NULL; @@ -5048,7 +5047,7 @@ static int uc_add_command(char_u *name, size_t name_len, char_u *rep, if (cmp != 0) { ga_grow(gap, 1); - p = vim_strnsave(name, (int)name_len); + char_u *const p = vim_strnsave(name, name_len); cmd = USER_CMD_GA(gap, i); memmove(cmd + 1, cmd, (gap->ga_len - i) * sizeof(ucmd_T)); @@ -6197,8 +6196,9 @@ int parse_compl_arg(const char_u *value, int vallen, int *complp, return FAIL; } - if (arg != NULL) - *compl_arg = vim_strnsave(arg, (int)arglen); + if (arg != NULL) { + *compl_arg = vim_strnsave(arg, arglen); + } return OK; } @@ -9292,7 +9292,7 @@ static void ex_match(exarg_T *eap) } else { p = skiptowhite(eap->arg); if (!eap->skip) { - g = vim_strnsave(eap->arg, (int)(p - eap->arg)); + g = vim_strnsave(eap->arg, p - eap->arg); } p = skipwhite(p); if (*p == NUL) { -- cgit