]> git.neil.brown.name Git - edlib.git/commitdiff
Use PANE_DATA_PTR_TYPE in lang-python
authorNeilBrown <neil@brown.name>
Thu, 14 Sep 2023 10:13:32 +0000 (20:13 +1000)
committerNeilBrown <neil@brown.name>
Fri, 15 Sep 2023 03:38:14 +0000 (13:38 +1000)
This avoid the need for _data.

Signed-off-by: NeilBrown <neil@brown.name>
lang-python.c

index 3f5c3f5bdcbaf107226f5a54461c5cc266c1cadf..0539fee1d6493aa1c337bf8630dae391fb6b51a6 100644 (file)
@@ -68,6 +68,8 @@ struct doc_ref {
 #include <signal.h>
 
 #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;