Shortened / wrapped some long lines.

Removed warning on use of panel_userptr() in PyCursesPanel_userptr().
This commit is contained in:
Fred Drake 2000-12-23 05:46:23 +00:00
parent 5caee408b8
commit 4e36d5885b
1 changed files with 11 additions and 8 deletions

View File

@ -141,24 +141,24 @@ find_po(PANEL *pan)
PARSESTR - format string for argument parsing */ PARSESTR - format string for argument parsing */
#define Panel_NoArgNoReturnFunction(X) \ #define Panel_NoArgNoReturnFunction(X) \
static PyObject *PyCursesPanel_ ## X (PyCursesPanelObject *self, PyObject *args) \ static PyObject *PyCursesPanel_##X(PyCursesPanelObject *self, PyObject *args) \
{ if (!PyArg_NoArgs(args)) return NULL; \ { if (!PyArg_NoArgs(args)) return NULL; \
return PyCursesCheckERR(X(self->pan), # X); } return PyCursesCheckERR(X(self->pan), # X); }
#define Panel_NoArgReturnStringFunction(X) \ #define Panel_NoArgReturnStringFunction(X) \
static PyObject *PyCursesPanel_ ## X (PyCursesPanelObject *self, PyObject *args) \ static PyObject *PyCursesPanel_##X(PyCursesPanelObject *self, PyObject *args) \
{ if (!PyArg_NoArgs(args)) return NULL; \ { if (!PyArg_NoArgs(args)) return NULL; \
return PyString_FromString(X(self->pan)); } return PyString_FromString(X(self->pan)); }
#define Panel_NoArgTrueFalseFunction(X) \ #define Panel_NoArgTrueFalseFunction(X) \
static PyObject * PyCursesPanel_ ## X (PyCursesPanelObject *self, PyObject *args) \ static PyObject *PyCursesPanel_##X(PyCursesPanelObject *self, PyObject *args) \
{ \ { \
if (!PyArg_NoArgs(args)) return NULL; \ if (!PyArg_NoArgs(args)) return NULL; \
if (X (self->pan) == FALSE) { Py_INCREF(Py_False); return Py_False; } \ if (X (self->pan) == FALSE) { Py_INCREF(Py_False); return Py_False; } \
else { Py_INCREF(Py_True); return Py_True; } } else { Py_INCREF(Py_True); return Py_True; } }
#define Panel_TwoArgNoReturnFunction(X, TYPE, PARSESTR) \ #define Panel_TwoArgNoReturnFunction(X, TYPE, PARSESTR) \
static PyObject * PyCursesPanel_ ## X (PyCursesPanelObject *self, PyObject *args) \ static PyObject *PyCursesPanel_##X(PyCursesPanelObject *self, PyObject *args) \
{ \ { \
TYPE arg1, arg2; \ TYPE arg1, arg2; \
if (!PyArg_Parse(args,PARSESTR, &arg1, &arg2)) return NULL; \ if (!PyArg_Parse(args,PARSESTR, &arg1, &arg2)) return NULL; \
@ -309,7 +309,8 @@ PyCursesPanel_set_panel_userptr(PyCursesPanelObject *self, PyObject *args)
} }
obj = PyTuple_GetItem(args, 0); obj = PyTuple_GetItem(args, 0);
Py_INCREF(obj); Py_INCREF(obj);
return PyCursesCheckERR(set_panel_userptr(self->pan, obj), "set_panel_userptr"); return PyCursesCheckERR(set_panel_userptr(self->pan, obj),
"set_panel_userptr");
} }
static PyObject *PyCursesPanel_userptr static PyObject *PyCursesPanel_userptr
@ -317,8 +318,9 @@ static PyObject *PyCursesPanel_userptr
{ {
PyObject *obj; PyObject *obj;
PyCursesInitialised; PyCursesInitialised;
if (!PyArg_NoArgs(args)) return NULL; if (!PyArg_NoArgs(args))
obj = panel_userptr(self->pan); return NULL;
obj = (PyObject *) panel_userptr(self->pan);
Py_INCREF(obj); Py_INCREF(obj);
return obj; return obj;
} }
@ -408,7 +410,8 @@ PyCurses_new_panel(PyObject *self, PyObject *args)
PyCursesWindowObject *win; PyCursesWindowObject *win;
PANEL *pan; PANEL *pan;
if (!PyArg_ParseTuple(args, "O!", &PyCursesWindow_Type, &win)) return NULL; if (!PyArg_ParseTuple(args, "O!", &PyCursesWindow_Type, &win))
return NULL;
pan = new_panel(win->win); pan = new_panel(win->win);
if (pan == NULL) { if (pan == NULL) {
PyErr_SetString(PyCursesError, catchall_NULL); PyErr_SetString(PyCursesError, catchall_NULL);