]> granicus.if.org Git - vim/commitdiff
patch 8.1.0601: a few compiler warnings v8.1.0601
authorBram Moolenaar <Bram@vim.org>
Sun, 16 Dec 2018 13:37:39 +0000 (14:37 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 16 Dec 2018 13:37:39 +0000 (14:37 +0100)
Problem:    A few compiler warnings.
Solution:   Add type casts. (Mike Williams)

src/GvimExt/gvimext.cpp
src/memline.c
src/textprop.c
src/version.c

index 30b2dddb67c095efd7ec23fce12adf93d1d00fb7..b9d9d91f01b137e7ad60d90fabf9bc54093fb2af 100644 (file)
@@ -1084,7 +1084,6 @@ STDMETHODIMP CShellExt::InvokeSingleGvim(HWND hParent,
        CloseHandle(pi.hProcess);
        CloseHandle(pi.hThread);
     }
-theend:
     free(cmdStrW);
 
     return NOERROR;
index 0eb31c3c5c5bd9b5b37661690c1c8bf88257eefe..eaa3b65abaaf6ee32565f1f86299768b7c461621 100644 (file)
@@ -3146,7 +3146,7 @@ ml_replace(linenr_T lnum, char_u *line, int copy)
     colnr_T len = -1;
 
     if (line != NULL)
-       len = STRLEN(line);
+       len = (colnr_T)STRLEN(line);
     return ml_replace_len(lnum, line, len, copy);
 }
 
@@ -3196,14 +3196,14 @@ ml_replace_len(linenr_T lnum, char_u *line_arg, colnr_T len_arg, int copy)
            size_t textproplen = curbuf->b_ml.ml_line_len - oldtextlen;
 
            // Need to copy over text properties, stored after the text.
-           newline = alloc(len + 1 + textproplen);
+           newline = alloc(len + 1 + (int)textproplen);
            if (newline != NULL)
            {
                mch_memmove(newline, line, len + 1);
                mch_memmove(newline + len + 1, curbuf->b_ml.ml_line_ptr + oldtextlen, textproplen);
                vim_free(line);
                line = newline;
-               len += textproplen;
+               len += (colnr_T)textproplen;
            }
        }
     }
index 3e0207da37b2eab14f5932bf7aec07c895d59a1e..05df2e1398b1e0520fd7a8aad0394c9a4dfec514 100644 (file)
@@ -301,7 +301,7 @@ get_text_props(buf_T *buf, linenr_T lnum, char_u **props, int will_change)
     }
     if (proplen > 0)
        *props = text + textlen;
-    return proplen / sizeof(textprop_T);
+    return (int)(proplen / sizeof(textprop_T));
 }
 
     static proptype_T *
@@ -393,7 +393,7 @@ f_prop_clear(typval_T *argvars, typval_T *rettv UNUSED)
                buf->b_ml.ml_line_ptr = newtext;
                buf->b_ml.ml_flags |= ML_LINE_DIRTY;
            }
-           buf->b_ml.ml_line_len = len;
+           buf->b_ml.ml_line_len = (int)len;
        }
     }
     redraw_buf_later(buf, NOT_VALID);
@@ -423,8 +423,8 @@ f_prop_list(typval_T *argvars, typval_T *rettv)
     {
        char_u      *text = ml_get_buf(buf, lnum, FALSE);
        size_t      textlen = STRLEN(text) + 1;
-       int         count = (buf->b_ml.ml_line_len - textlen)
-                                                         / sizeof(textprop_T);
+       int         count = (int)((buf->b_ml.ml_line_len - textlen)
+                                                        / sizeof(textprop_T));
        int         i;
        textprop_T  prop;
        proptype_T  *pt;
@@ -607,7 +607,7 @@ prop_type_set(typval_T *argvars, int add)
            EMSG2(_("E969: Property type %s already defined"), name);
            return;
        }
-       prop = (proptype_T *)alloc_clear(sizeof(proptype_T) + STRLEN(name));
+       prop = (proptype_T *)alloc_clear((int)(sizeof(proptype_T) + STRLEN(name)));
        if (prop == NULL)
            return;
        STRCPY(prop->pt_name, name);
index a485b2851c8572ded162c2cd0429b28ed7ebcf03..5db10015215be24e7ae95fdc439ca2391a017f9e 100644 (file)
@@ -799,6 +799,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    601,
 /**/
     600,
 /**/