]> granicus.if.org Git - vim/commitdiff
patch 8.1.1020: compiler warning for Python3 interface v8.1.1020
authorBram Moolenaar <Bram@vim.org>
Tue, 19 Mar 2019 21:11:41 +0000 (22:11 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 19 Mar 2019 21:11:41 +0000 (22:11 +0100)
Problem:    Compiler warning for Python3 interface.
Solution:   Add type cast. (Ozaki Kiichi, closes #4128, closes #4103)

src/if_python3.c
src/version.c

index 3c6ee15e3c6b96582e950e194ca96f59e9717a3b..8b1b5beb6e63994bfcee855af6d33a2cc42a8e7a 100644 (file)
@@ -799,10 +799,11 @@ static struct PyModuleDef vimmodule;
  */
 #include "if_py_both.h"
 
+// NOTE: Must always be used at the start of a block, since it declares "name".
 #define GET_ATTR_STRING(name, nameobj) \
     char       *name = ""; \
     if (PyUnicode_Check(nameobj)) \
-       name = _PyUnicode_AsString(nameobj)
+       name = (char *)_PyUnicode_AsString(nameobj)
 
 #define PY3OBJ_DELETED(obj) (obj->ob_base.ob_refcnt<=0)
 
index a32770e2b798ef5c2c2c2e7dc7472949582f4f9f..c336046bf4e6992fc76050a75f316ffbe9fa3890 100644 (file)
@@ -779,6 +779,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1020,
 /**/
     1019,
 /**/