~mdw
/
catacomb-python
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
*.c: Use Python macros rather than functions where possible.
[catacomb-python]
/
algorithms.c
diff --git
a/algorithms.c
b/algorithms.c
index
31bd95b
..
886c159
100644
(file)
--- a/
algorithms.c
+++ b/
algorithms.c
@@
-193,9
+193,9
@@
static PyObject *ksget_min(PyObject *me, void *hunoz)
{
PyObject *set = ((keyszset_pyobj *)me)->set;
int i, n, y, x = -1;
{
PyObject *set = ((keyszset_pyobj *)me)->set;
int i, n, y, x = -1;
- n = PyTuple_
Size
(set);
+ n = PyTuple_
GET_SIZE
(set);
for (i = 0; i < n; i++) {
for (i = 0; i < n; i++) {
- y = PyInt_A
sLong(PyTuple_GetItem
(set, i));
+ y = PyInt_A
S_LONG(PyTuple_GET_ITEM
(set, i));
if (x == -1 || y < x) x = y;
}
return (PyInt_FromLong(x));
if (x == -1 || y < x) x = y;
}
return (PyInt_FromLong(x));
@@
-205,9
+205,9
@@
static PyObject *ksget_max(PyObject *me, void *hunoz)
{
PyObject *set = ((keyszset_pyobj *)me)->set;
int i, n, y, x = -1;
{
PyObject *set = ((keyszset_pyobj *)me)->set;
int i, n, y, x = -1;
- n = PyTuple_
Size
(set);
+ n = PyTuple_
GET_SIZE
(set);
for (i = 0; i < n; i++) {
for (i = 0; i < n; i++) {
- y = PyInt_A
sLong(PyTuple_GetItem
(set, i));
+ y = PyInt_A
S_LONG(PyTuple_GET_ITEM
(set, i));
if (y > x) x = y;
}
return (PyInt_FromLong(x));
if (y > x) x = y;
}
return (PyInt_FromLong(x));