]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0274: MS-Windows: a few compiler warnings v9.1.0274
authorMike Williams <mrmrdubya@gmail.com>
Sun, 7 Apr 2024 16:26:22 +0000 (18:26 +0200)
committerChristian Brabandt <cb@256bit.org>
Sun, 7 Apr 2024 16:26:22 +0000 (18:26 +0200)
Problem:  MS-Windows: a few compiler warnings
Solution: Change variable types to resolve compiler warnings
          (Mike Williams)

Windows compiles were reporting a few size_t to signed integer
conversion warnings that can be resolved by changing the variable
declarations to be size_t to start with.

closes: #14429

Signed-off-by: Mike Williams <mrmrdubya@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/getchar.c
src/ops.c
src/version.c

index 179c50c8fa876e7852fe2e9e29a8470950414f78..c8dde22096a99f5f7c537478c267f039281ecd88 100644 (file)
@@ -81,7 +81,7 @@ static int    KeyNoremap = 0;     // remapping flags
 static char_u  typebuf_init[TYPELEN_INIT];     // initial typebuf.tb_buf
 static char_u  noremapbuf_init[TYPELEN_INIT];  // initial typebuf.tb_noremap
 
-static int     last_recorded_len = 0;  // number of last recorded chars
+static size_t  last_recorded_len = 0;  // number of last recorded chars
 
 #ifdef FEAT_EVAL
 mapblock_T     *last_used_map = NULL;
@@ -163,7 +163,7 @@ get_recorded(void)
      * (possibly mapped) characters that stopped the recording.
      */
     len = STRLEN(p);
-    if ((int)len >= last_recorded_len)
+    if (len >= last_recorded_len)
     {
        len -= last_recorded_len;
        p[len] = NUL;
@@ -1789,7 +1789,7 @@ vgetc(void)
     else
     {
        // number of characters recorded from the last vgetc() call
-       static int      last_vgetc_recorded_len = 0;
+       static size_t   last_vgetc_recorded_len = 0;
 
        mod_mask = 0;
        vgetc_mod_mask = 0;
index dbdf119a7ce8927b0883bfa9cc0518b509a265d3..0ab0d005db5627d475c410f440fa9911cddc0124 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -1593,12 +1593,12 @@ op_insert(oparg_T *oap, long count1)
 
     if (oap->block_mode)
     {
-       long                    ins_len;
+       size_t                  ins_len;
        char_u                  *firstline, *ins_text;
        struct block_def        bd2;
        int                     did_indent = FALSE;
        size_t                  len;
-       int                     add;
+       size_t                  add;
        // offset when cursor was moved in insert mode
        int                     offset = 0;
 
@@ -1703,7 +1703,7 @@ op_insert(oparg_T *oap, long count1)
                    return;
            }
        }
-       if ((size_t)add > len)
+       if (add > len)
            add = len;  // short line, point to the NUL
        firstline += add;
        len -= add;
index da75e4b20fd0ccf5572ca1a4f7d542def47442a8..c54ec96a993c771ce8d1c0b8573f782c6753f984 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    274,
 /**/
     273,
 /**/