|
Karsten Hopp |
e1d7cb |
To: vim_dev@googlegroups.com
|
|
Karsten Hopp |
e1d7cb |
Subject: Patch 7.3.584
|
|
Karsten Hopp |
e1d7cb |
Fcc: outbox
|
|
Karsten Hopp |
e1d7cb |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
e1d7cb |
Mime-Version: 1.0
|
|
Karsten Hopp |
e1d7cb |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
e1d7cb |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
e1d7cb |
------------
|
|
Karsten Hopp |
e1d7cb |
|
|
Karsten Hopp |
e1d7cb |
Patch 7.3.584
|
|
Karsten Hopp |
e1d7cb |
Problem: PyCObject is not always defined.
|
|
Karsten Hopp |
e1d7cb |
Solution: Use PyObject instead.
|
|
Karsten Hopp |
e1d7cb |
Files: src/if_py_both.h, src/if_python.c
|
|
Karsten Hopp |
e1d7cb |
|
|
Karsten Hopp |
e1d7cb |
|
|
Karsten Hopp |
e1d7cb |
*** ../vim-7.3.583/src/if_py_both.h 2012-06-29 17:51:58.000000000 +0200
|
|
Karsten Hopp |
e1d7cb |
--- src/if_py_both.h 2012-06-30 13:25:24.000000000 +0200
|
|
Karsten Hopp |
e1d7cb |
***************
|
|
Karsten Hopp |
e1d7cb |
*** 2432,2463 ****
|
|
Karsten Hopp |
e1d7cb |
convert_dl(PyObject *obj, typval_T *tv,
|
|
Karsten Hopp |
e1d7cb |
pytotvfunc py_to_tv, PyObject *lookupDict)
|
|
Karsten Hopp |
e1d7cb |
{
|
|
Karsten Hopp |
e1d7cb |
- # ifdef PY_USE_CAPSULE
|
|
Karsten Hopp |
e1d7cb |
PyObject *capsule;
|
|
Karsten Hopp |
e1d7cb |
- # else
|
|
Karsten Hopp |
e1d7cb |
- PyCObject *cobject;
|
|
Karsten Hopp |
e1d7cb |
- # endif
|
|
Karsten Hopp |
e1d7cb |
char hexBuf[sizeof(void *) * 2 + 3];
|
|
Karsten Hopp |
e1d7cb |
|
|
Karsten Hopp |
e1d7cb |
sprintf(hexBuf, "%p", obj);
|
|
Karsten Hopp |
e1d7cb |
|
|
Karsten Hopp |
e1d7cb |
# ifdef PY_USE_CAPSULE
|
|
Karsten Hopp |
e1d7cb |
capsule = PyDict_GetItemString(lookupDict, hexBuf);
|
|
Karsten Hopp |
e1d7cb |
- if (capsule == NULL)
|
|
Karsten Hopp |
e1d7cb |
# else
|
|
Karsten Hopp |
e1d7cb |
! cobject = (PyCObject *)PyDict_GetItemString(lookupDict, hexBuf);
|
|
Karsten Hopp |
e1d7cb |
! if (cobject == NULL)
|
|
Karsten Hopp |
e1d7cb |
# endif
|
|
Karsten Hopp |
e1d7cb |
{
|
|
Karsten Hopp |
e1d7cb |
# ifdef PY_USE_CAPSULE
|
|
Karsten Hopp |
e1d7cb |
capsule = PyCapsule_New(tv, NULL, NULL);
|
|
Karsten Hopp |
e1d7cb |
- PyDict_SetItemString(lookupDict, hexBuf, capsule);
|
|
Karsten Hopp |
e1d7cb |
- Py_DECREF(capsule);
|
|
Karsten Hopp |
e1d7cb |
# else
|
|
Karsten Hopp |
e1d7cb |
! cobject = PyCObject_FromVoidPtr(tv, NULL);
|
|
Karsten Hopp |
e1d7cb |
! PyDict_SetItemString(lookupDict, hexBuf, cobject);
|
|
Karsten Hopp |
e1d7cb |
! Py_DECREF(cobject);
|
|
Karsten Hopp |
e1d7cb |
# endif
|
|
Karsten Hopp |
e1d7cb |
if (py_to_tv(obj, tv, lookupDict) == -1)
|
|
Karsten Hopp |
e1d7cb |
{
|
|
Karsten Hopp |
e1d7cb |
tv->v_type = VAR_UNKNOWN;
|
|
Karsten Hopp |
e1d7cb |
--- 2432,2456 ----
|
|
Karsten Hopp |
e1d7cb |
convert_dl(PyObject *obj, typval_T *tv,
|
|
Karsten Hopp |
e1d7cb |
pytotvfunc py_to_tv, PyObject *lookupDict)
|
|
Karsten Hopp |
e1d7cb |
{
|
|
Karsten Hopp |
e1d7cb |
PyObject *capsule;
|
|
Karsten Hopp |
e1d7cb |
char hexBuf[sizeof(void *) * 2 + 3];
|
|
Karsten Hopp |
e1d7cb |
|
|
Karsten Hopp |
e1d7cb |
sprintf(hexBuf, "%p", obj);
|
|
Karsten Hopp |
e1d7cb |
|
|
Karsten Hopp |
e1d7cb |
# ifdef PY_USE_CAPSULE
|
|
Karsten Hopp |
e1d7cb |
capsule = PyDict_GetItemString(lookupDict, hexBuf);
|
|
Karsten Hopp |
e1d7cb |
# else
|
|
Karsten Hopp |
e1d7cb |
! capsule = (PyObject *)PyDict_GetItemString(lookupDict, hexBuf);
|
|
Karsten Hopp |
e1d7cb |
# endif
|
|
Karsten Hopp |
e1d7cb |
+ if (capsule == NULL)
|
|
Karsten Hopp |
e1d7cb |
{
|
|
Karsten Hopp |
e1d7cb |
# ifdef PY_USE_CAPSULE
|
|
Karsten Hopp |
e1d7cb |
capsule = PyCapsule_New(tv, NULL, NULL);
|
|
Karsten Hopp |
e1d7cb |
# else
|
|
Karsten Hopp |
e1d7cb |
! capsule = PyCObject_FromVoidPtr(tv, NULL);
|
|
Karsten Hopp |
e1d7cb |
# endif
|
|
Karsten Hopp |
e1d7cb |
+ PyDict_SetItemString(lookupDict, hexBuf, capsule);
|
|
Karsten Hopp |
e1d7cb |
+ Py_DECREF(capsule);
|
|
Karsten Hopp |
e1d7cb |
if (py_to_tv(obj, tv, lookupDict) == -1)
|
|
Karsten Hopp |
e1d7cb |
{
|
|
Karsten Hopp |
e1d7cb |
tv->v_type = VAR_UNKNOWN;
|
|
Karsten Hopp |
e1d7cb |
***************
|
|
Karsten Hopp |
e1d7cb |
*** 2478,2484 ****
|
|
Karsten Hopp |
e1d7cb |
# ifdef PY_USE_CAPSULE
|
|
Karsten Hopp |
e1d7cb |
v = PyCapsule_GetPointer(capsule, NULL);
|
|
Karsten Hopp |
e1d7cb |
# else
|
|
Karsten Hopp |
e1d7cb |
! v = PyCObject_AsVoidPtr(cobject);
|
|
Karsten Hopp |
e1d7cb |
# endif
|
|
Karsten Hopp |
e1d7cb |
copy_tv(v, tv);
|
|
Karsten Hopp |
e1d7cb |
}
|
|
Karsten Hopp |
e1d7cb |
--- 2471,2477 ----
|
|
Karsten Hopp |
e1d7cb |
# ifdef PY_USE_CAPSULE
|
|
Karsten Hopp |
e1d7cb |
v = PyCapsule_GetPointer(capsule, NULL);
|
|
Karsten Hopp |
e1d7cb |
# else
|
|
Karsten Hopp |
e1d7cb |
! v = PyCObject_AsVoidPtr(capsule);
|
|
Karsten Hopp |
e1d7cb |
# endif
|
|
Karsten Hopp |
e1d7cb |
copy_tv(v, tv);
|
|
Karsten Hopp |
e1d7cb |
}
|
|
Karsten Hopp |
e1d7cb |
*** ../vim-7.3.583/src/if_python.c 2012-06-30 13:21:03.000000000 +0200
|
|
Karsten Hopp |
e1d7cb |
--- src/if_python.c 2012-06-30 13:23:22.000000000 +0200
|
|
Karsten Hopp |
e1d7cb |
***************
|
|
Karsten Hopp |
e1d7cb |
*** 327,334 ****
|
|
Karsten Hopp |
e1d7cb |
static PyObject* (*dll_PyCapsule_New)(void *, char *, PyCapsule_Destructor);
|
|
Karsten Hopp |
e1d7cb |
static void* (*dll_PyCapsule_GetPointer)(PyObject *, char *);
|
|
Karsten Hopp |
e1d7cb |
# else
|
|
Karsten Hopp |
e1d7cb |
! static PyCObject* (*dll_PyCObject_FromVoidPtr)(void *cobj, void (*destr)(void *));
|
|
Karsten Hopp |
e1d7cb |
! static void* (*dll_PyCObject_AsVoidPtr)(PyCObject *);
|
|
Karsten Hopp |
e1d7cb |
# endif
|
|
Karsten Hopp |
e1d7cb |
|
|
Karsten Hopp |
e1d7cb |
static HINSTANCE hinstPython = 0; /* Instance of python.dll */
|
|
Karsten Hopp |
e1d7cb |
--- 327,334 ----
|
|
Karsten Hopp |
e1d7cb |
static PyObject* (*dll_PyCapsule_New)(void *, char *, PyCapsule_Destructor);
|
|
Karsten Hopp |
e1d7cb |
static void* (*dll_PyCapsule_GetPointer)(PyObject *, char *);
|
|
Karsten Hopp |
e1d7cb |
# else
|
|
Karsten Hopp |
e1d7cb |
! static PyObject* (*dll_PyCObject_FromVoidPtr)(void *cobj, void (*destr)(void *));
|
|
Karsten Hopp |
e1d7cb |
! static void* (*dll_PyCObject_AsVoidPtr)(PyObject *);
|
|
Karsten Hopp |
e1d7cb |
# endif
|
|
Karsten Hopp |
e1d7cb |
|
|
Karsten Hopp |
e1d7cb |
static HINSTANCE hinstPython = 0; /* Instance of python.dll */
|
|
Karsten Hopp |
e1d7cb |
*** ../vim-7.3.583/src/version.c 2012-06-30 13:21:03.000000000 +0200
|
|
Karsten Hopp |
e1d7cb |
--- src/version.c 2012-06-30 13:33:08.000000000 +0200
|
|
Karsten Hopp |
e1d7cb |
***************
|
|
Karsten Hopp |
e1d7cb |
*** 716,717 ****
|
|
Karsten Hopp |
e1d7cb |
--- 716,719 ----
|
|
Karsten Hopp |
e1d7cb |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
e1d7cb |
+ /**/
|
|
Karsten Hopp |
e1d7cb |
+ 584,
|
|
Karsten Hopp |
e1d7cb |
/**/
|
|
Karsten Hopp |
e1d7cb |
|
|
Karsten Hopp |
e1d7cb |
--
|
|
Karsten Hopp |
e1d7cb |
hundred-and-one symptoms of being an internet addict:
|
|
Karsten Hopp |
e1d7cb |
91. It's Saturday afternoon in the middle of May and you
|
|
Karsten Hopp |
e1d7cb |
are on computer.
|
|
Karsten Hopp |
e1d7cb |
|
|
Karsten Hopp |
e1d7cb |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
e1d7cb |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
e1d7cb |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
Karsten Hopp |
e1d7cb |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|