]> granicus.if.org Git - vim/commitdiff
patch 8.2.1148: warning for using int instead of size_t v8.2.1148
authorBram Moolenaar <Bram@vim.org>
Mon, 6 Jul 2020 19:53:17 +0000 (21:53 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 6 Jul 2020 19:53:17 +0000 (21:53 +0200)
Problem:    Warning for using int instead of size_t.
Solution:   Change "len" argument to size_t. (Mike Williams)

src/proto/vim9compile.pro
src/version.c
src/vim9compile.c
src/vim9script.c

index 040e4d7eb7acb6c828e13c3d07ed3b9fabb6d91f..05f6d50220d83d4b86b6d98e5ed3d8f6384e1756 100644 (file)
@@ -1,5 +1,5 @@
 /* vim9compile.c */
-int check_defined(char_u *p, int len, cctx_T *cctx);
+int check_defined(char_u *p, size_t len, cctx_T *cctx);
 type_T *typval2type(typval_T *tv);
 int check_type(type_T *expected, type_T *actual, int give_msg);
 char_u *skip_type(char_u *start);
index ec1e12e0b0a78b15af213c41a0b5d19ec489bff6..867eaf55f21e1f3de6c9b1d897c155489fcd5075 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1148,
 /**/
     1147,
 /**/
index db24eaead6bed6be488ae5c32a488da8d4805c3f..c876da0751c6f1ae86e64807e6cb29d60fefc0f8 100644 (file)
@@ -288,7 +288,7 @@ lookup_script(char_u *name, size_t len)
  * Return FAIL and give an error if it defined.
  */
     int
-check_defined(char_u *p, int len, cctx_T *cctx)
+check_defined(char_u *p, size_t len, cctx_T *cctx)
 {
     if (lookup_script(p, len) == OK
            || (cctx != NULL
index ef447c7e3524855f2581e0ffb464606e656b2f9a..77fe6b074a10a7d0c4b7e7360b2351d5559394c7 100644 (file)
@@ -324,7 +324,7 @@ handle_import(
            if (eval_isnamec1(*arg))
                while (eval_isnamec(*arg))
                    ++arg;
-           if (check_defined(p, (int)(arg - p), cctx) == FAIL)
+           if (check_defined(p, arg - p, cctx) == FAIL)
                goto erret;
            as_name = vim_strnsave(p, arg - p);
            arg = skipwhite_and_linebreak(arg, evalarg);