From: NeilBrown Date: Thu, 14 Sep 2023 10:13:32 +0000 (+1000) Subject: Use PANE_DATA_PTR_TYPE in lang-python X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=f563d520f18a5d328ba4ca6a09ec5a1e0a55d78a;p=edlib.git Use PANE_DATA_PTR_TYPE in lang-python This avoid the need for _data. Signed-off-by: NeilBrown --- diff --git a/lang-python.c b/lang-python.c index 3f5c3f5b..0539fee1 100644 --- a/lang-python.c +++ b/lang-python.c @@ -68,6 +68,8 @@ struct doc_ref { #include #define DOC_DATA_TYPE struct python_doc +#define PANE_DATA_PTR_TYPE struct Pane * +struct Pane; #include "core.h" #include "misc.h" #include "rexel.h" @@ -145,7 +147,7 @@ static struct python_command *export_callable(PyObject *callable safe, return c; } -typedef struct { +typedef struct Pane { PyObject_HEAD; struct pane *pane; struct command cmd; @@ -206,7 +208,7 @@ static inline PyObject *safe Pane_Frompane(struct pane *p) { Pane *pane; if (p && p->handle && p->handle->func == python_pane_call.func) { - pane = p->_data; + pane = p->data; Py_INCREF(pane); } else if (p && p->handle && p->handle->func == python_doc_call.func) { struct python_doc *pd = p->doc_data;