Minor C API documentation improvements. (GH-17696)
The added parentheses around the PyIter_Next assignment suppress the following warning which gcc throws without: ``` warning: using the result of an assignment as a condition without parentheses [-Wparentheses] ``` The other change is a typo fix
This commit is contained in:
parent
025eeaa196
commit
5c7ed7550e
|
@ -29,7 +29,7 @@ something like this::
|
||||||
/* propagate error */
|
/* propagate error */
|
||||||
}
|
}
|
||||||
|
|
||||||
while (item = PyIter_Next(iterator)) {
|
while ((item = PyIter_Next(iterator))) {
|
||||||
/* do something with item */
|
/* do something with item */
|
||||||
...
|
...
|
||||||
/* release reference when done */
|
/* release reference when done */
|
||||||
|
|
|
@ -37,7 +37,7 @@ PyInit_custom(void)
|
||||||
Py_INCREF(&CustomType);
|
Py_INCREF(&CustomType);
|
||||||
if (PyModule_AddObject(m, "Custom", (PyObject *) &CustomType) < 0) {
|
if (PyModule_AddObject(m, "Custom", (PyObject *) &CustomType) < 0) {
|
||||||
Py_DECREF(&CustomType);
|
Py_DECREF(&CustomType);
|
||||||
PY_DECREF(m);
|
Py_DECREF(m);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue