]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.1788: C4090 warnings in strings.c v9.0.1788
authorK.Takata <kentkt@csc.jp>
Sat, 26 Aug 2023 16:05:08 +0000 (18:05 +0200)
committerChristian Brabandt <cb@256bit.org>
Sat, 26 Aug 2023 16:05:08 +0000 (18:05 +0200)
Problem:  C4090 warnings in strings.c
Solution: Add type casts

closes: #12917

MSVC shows the following warnings:
```
strings.c(2436): warning C4090: 'function': different 'const' qualifiers
strings.c(2774): warning C4090: 'function': different 'const' qualifiers
strings.c(3865): warning C4090: 'function': different 'const' qualifiers
```

So add type casts to suppress them.

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken .Takata <kentkt@csc.jp>
src/strings.c
src/version.c

index 993674406cc3daae0740975798fc842aca8f703e..d1d82f48227d183f9ab9b0cffbcea08b22302c36 100644 (file)
@@ -2433,7 +2433,8 @@ adjust_types(
        if (*ap_types == NULL)
            new_types = ALLOC_CLEAR_MULT(const char *, arg);
        else
-           new_types = vim_realloc(*ap_types, arg * sizeof(const char *));
+           new_types = vim_realloc((char **)*ap_types,
+                                               arg * sizeof(const char *));
 
        if (new_types == NULL)
            return FAIL;
@@ -2771,7 +2772,7 @@ parse_fmt_types(
     return OK;
 
 error:
-    vim_free(*ap_types);
+    vim_free((char**)*ap_types);
     *ap_types = NULL;
     *num_posarg = 0;
     return FAIL;
@@ -3862,7 +3863,7 @@ vim_vsnprintf_typval(
     if (tvs != NULL && tvs[num_posarg != 0 ? num_posarg : arg_idx - 1].v_type != VAR_UNKNOWN)
        emsg(_(e_too_many_arguments_to_printf));
 
-    vim_free(ap_types);
+    vim_free((char*)ap_types);
     va_end(ap);
 
     // Return the number of characters formatted (excluding trailing nul
index eb65fc1f291da6b64b29dab891f2fcec6c8ee6a1..d6e259c0140c7f05e3d00fafc75bfa95ecfd1f51 100644 (file)
@@ -699,6 +699,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1788,
 /**/
     1787,
 /**/