# HG changeset patch # User Bram Moolenaar # Date 1553030105 -3600 # Node ID 6694659c6ad6278a2e532510dc1bffe97dfd23e7 # Parent 43b5514f084c567c22705c92239d22822876e29c patch 8.1.1020: compiler warning for Python3 interface commit https://github.com/vim/vim/commit/828bff1f9b4847da79abd7a97ddc48687e257d6c Author: Bram Moolenaar Date: Tue Mar 19 22:11:41 2019 +0100 patch 8.1.1020: compiler warning for Python3 interface Problem: Compiler warning for Python3 interface. Solution: Add type cast. (Ozaki Kiichi, closes https://github.com/vim/vim/issues/4128, closes https://github.com/vim/vim/issues/4103) diff --git a/src/if_python3.c b/src/if_python3.c --- a/src/if_python3.c +++ b/src/if_python3.c @@ -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) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -780,6 +780,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1020, +/**/ 1019, /**/ 1018,