chiark
/
gitweb
/
~mdw
/
pyke
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
*.c: Use Python `METH_NOARGS' methods where applicable.
[pyke]
/
mapping.c
diff --git
a/mapping.c
b/mapping.c
index 615c5edcbdefe8e1211d04e45609994d33dddc6d..7080ca57f2e14b7b34fabf4a170699ede14a9e04 100644
(file)
--- a/
mapping.c
+++ b/
mapping.c
@@
-196,13
+196,12
@@
PyObject *gmapmeth_has_key(PyObject *me, PyObject *arg)
return (getbool(PyMapping_HasKey(me, k)));
}
return (getbool(PyMapping_HasKey(me, k)));
}
-PyObject *gmapmeth_keys(PyObject *me
, PyObject *arg
)
+PyObject *gmapmeth_keys(PyObject *me)
{
PyObject *l = 0, *i = 0, *k, *rc = 0;
int err;
{
PyObject *l = 0, *i = 0, *k, *rc = 0;
int err;
- if (!PyArg_ParseTuple(arg, ":keys") ||
- (l = PyList_New(0)) == 0 ||
+ if ((l = PyList_New(0)) == 0 ||
(i = PyObject_GetIter(me)) == 0)
goto done;
while ((k = PyIter_Next(i)) != 0)
(i = PyObject_GetIter(me)) == 0)
goto done;
while ((k = PyIter_Next(i)) != 0)
@@
-214,13
+213,12
@@
done:
return (rc);
}
return (rc);
}
-PyObject *gmapmeth_values(PyObject *me
, PyObject *arg
)
+PyObject *gmapmeth_values(PyObject *me)
{
PyObject *l = 0, *i = 0, *k, *v, *rc = 0;
int err = 0;
{
PyObject *l = 0, *i = 0, *k, *v, *rc = 0;
int err = 0;
- if (!PyArg_ParseTuple(arg, ":values") ||
- (l = PyList_New(0)) == 0 ||
+ if ((l = PyList_New(0)) == 0 ||
(i = PyObject_GetIter(me)) == 0)
goto done;
while ((k = PyIter_Next(i)) != 0) {
(i = PyObject_GetIter(me)) == 0)
goto done;
while ((k = PyIter_Next(i)) != 0) {
@@
-237,13
+235,12
@@
done:
return (rc);
}
return (rc);
}
-PyObject *gmapmeth_items(PyObject *me
, PyObject *arg
)
+PyObject *gmapmeth_items(PyObject *me)
{
PyObject *l = 0, *i = 0, *k, *v, *z, *rc = 0;
int err = 0;
{
PyObject *l = 0, *i = 0, *k, *v, *z, *rc = 0;
int err = 0;
- if (!PyArg_ParseTuple(arg, ":items") ||
- (l = PyList_New(0)) == 0 ||
+ if ((l = PyList_New(0)) == 0 ||
(i = PyObject_GetIter(me)) == 0)
goto done;
while ((k = PyIter_Next(i)) != 0) {
(i = PyObject_GetIter(me)) == 0)
goto done;
while ((k = PyIter_Next(i)) != 0) {
@@
-262,19
+259,15
@@
done:
return (rc);
}
return (rc);
}
-PyObject *gmapmeth_iterkeys(PyObject *me, PyObject *arg)
-{
- if (!PyArg_ParseTuple(arg, ":iterkeys")) return (0);
- return (PyObject_GetIter(me));
-}
+PyObject *gmapmeth_iterkeys(PyObject *me)
+ { return (PyObject_GetIter(me)); }
-PyObject *gmapmeth_itervalues(PyObject *me
, PyObject *arg
)
+PyObject *gmapmeth_itervalues(PyObject *me)
{
PyObject *i;
iter_pyobj *ii;
{
PyObject *i;
iter_pyobj *ii;
- if (!PyArg_ParseTuple(arg, ":itervalues") ||
- (i = PyObject_GetIter(me)) == 0)
+ if ((i = PyObject_GetIter(me)) == 0)
return (0);
ii = PyObject_NEW(iter_pyobj, valiter_pytype);
ii->map = me; Py_INCREF(me);
return (0);
ii = PyObject_NEW(iter_pyobj, valiter_pytype);
ii->map = me; Py_INCREF(me);
@@
-282,13
+275,12
@@
PyObject *gmapmeth_itervalues(PyObject *me, PyObject *arg)
return ((PyObject *)ii);
}
return ((PyObject *)ii);
}
-PyObject *gmapmeth_iteritems(PyObject *me
, PyObject *arg
)
+PyObject *gmapmeth_iteritems(PyObject *me)
{
PyObject *i;
iter_pyobj *ii;
{
PyObject *i;
iter_pyobj *ii;
- if (!PyArg_ParseTuple(arg, ":iteritems") ||
- (i = PyObject_GetIter(me)) == 0)
+ if ((i = PyObject_GetIter(me)) == 0)
return (0);
ii = PyObject_NEW(iter_pyobj, itemiter_pytype);
ii->map = me; Py_INCREF(me);
return (0);
ii = PyObject_NEW(iter_pyobj, itemiter_pytype);
ii->map = me; Py_INCREF(me);
@@
-296,12
+288,11
@@
PyObject *gmapmeth_iteritems(PyObject *me, PyObject *arg)
return ((PyObject *)ii);
}
return ((PyObject *)ii);
}
-PyObject *gmapmeth_clear(PyObject *me
, PyObject *arg
)
+PyObject *gmapmeth_clear(PyObject *me)
{
PyObject *i = 0, *k = 0, *rc = 0;
{
PyObject *i = 0, *k = 0, *rc = 0;
- if (!PyArg_ParseTuple(arg, ":clear") ||
- (i = PyObject_GetIter(me)) == 0)
+ if ((i = PyObject_GetIter(me)) == 0)
goto end;
while ((k = PyIter_Next(i)) != 0) {
PyObject_DelItem(me, k);
goto end;
while ((k = PyIter_Next(i)) != 0) {
PyObject_DelItem(me, k);
@@
-383,12
+374,11
@@
end:
return (rc);
}
return (rc);
}
-PyObject *gmapmeth_popitem(PyObject *me
, PyObject *arg
)
+PyObject *gmapmeth_popitem(PyObject *me)
{
PyObject *i = 0, *k = 0, *v = 0, *rc = 0;
{
PyObject *i = 0, *k = 0, *v = 0, *rc = 0;
- if (!PyArg_ParseTuple(arg, ":popitem") ||
- (i = PyObject_GetIter(me)) == 0)
+ if ((i = PyObject_GetIter(me)) == 0)
goto end;
if ((k = PyIter_Next(i)) == 0) {
if (!PyErr_Occurred()) VALERR("popitem(): mapping is empty");
goto end;
if ((k = PyIter_Next(i)) == 0) {
if (!PyErr_Occurred()) VALERR("popitem(): mapping is empty");