mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 00:06:44 -04:00
ext: Use different names for each gen_next method
This commit is contained in:
parent
d8775fa01e
commit
b049c891d1
@ -24,7 +24,7 @@ extern struct Dtool_PyTypedObject Dtool_CInterval;
|
|||||||
/**
|
/**
|
||||||
* Yields continuously until the interval is done.
|
* Yields continuously until the interval is done.
|
||||||
*/
|
*/
|
||||||
static PyObject *gen_next(PyObject *self) {
|
static PyObject *gen_next_c_interval(PyObject *self) {
|
||||||
const CInterval *ival;
|
const CInterval *ival;
|
||||||
if (!Dtool_Call_ExtractThisPointer(self, Dtool_CInterval, (void **)&ival)) {
|
if (!Dtool_Call_ExtractThisPointer(self, Dtool_CInterval, (void **)&ival)) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -54,7 +54,7 @@ __await__(PyObject *self) {
|
|||||||
// we call this via Python.
|
// we call this via Python.
|
||||||
PyObject *result = PyObject_CallMethod(self, "start", nullptr);
|
PyObject *result = PyObject_CallMethod(self, "start", nullptr);
|
||||||
Py_XDECREF(result);
|
Py_XDECREF(result);
|
||||||
return Dtool_NewGenerator(self, &gen_next);
|
return Dtool_NewGenerator(self, &gen_next_c_interval);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // HAVE_PYTHON
|
#endif // HAVE_PYTHON
|
||||||
|
@ -227,7 +227,7 @@ readlines(Py_ssize_t hint) {
|
|||||||
/**
|
/**
|
||||||
* Yields continuously to read all the lines from the istream.
|
* Yields continuously to read all the lines from the istream.
|
||||||
*/
|
*/
|
||||||
static PyObject *gen_next(PyObject *self) {
|
static PyObject *gen_next_istream(PyObject *self) {
|
||||||
istream *stream = nullptr;
|
istream *stream = nullptr;
|
||||||
if (!Dtool_Call_ExtractThisPointer(self, Dtool_std_istream, (void **)&stream)) {
|
if (!Dtool_Call_ExtractThisPointer(self, Dtool_std_istream, (void **)&stream)) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -247,7 +247,7 @@ static PyObject *gen_next(PyObject *self) {
|
|||||||
*/
|
*/
|
||||||
PyObject *Extension<istream>::
|
PyObject *Extension<istream>::
|
||||||
__iter__(PyObject *self) {
|
__iter__(PyObject *self) {
|
||||||
return Dtool_NewGenerator(self, &gen_next);
|
return Dtool_NewGenerator(self, &gen_next_istream);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -132,7 +132,7 @@ static PyObject *get_done_result(const AsyncFuture *future) {
|
|||||||
/**
|
/**
|
||||||
* Yields continuously until the task has finished.
|
* Yields continuously until the task has finished.
|
||||||
*/
|
*/
|
||||||
static PyObject *gen_next(PyObject *self) {
|
static PyObject *gen_next_asyncfuture(PyObject *self) {
|
||||||
const AsyncFuture *future = nullptr;
|
const AsyncFuture *future = nullptr;
|
||||||
if (!Dtool_Call_ExtractThisPointer(self, Dtool_AsyncFuture, (void **)&future)) {
|
if (!Dtool_Call_ExtractThisPointer(self, Dtool_AsyncFuture, (void **)&future)) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -158,7 +158,7 @@ static PyObject *gen_next(PyObject *self) {
|
|||||||
*/
|
*/
|
||||||
PyObject *Extension<AsyncFuture>::
|
PyObject *Extension<AsyncFuture>::
|
||||||
__await__(PyObject *self) {
|
__await__(PyObject *self) {
|
||||||
return Dtool_NewGenerator(self, &gen_next);
|
return Dtool_NewGenerator(self, &gen_next_asyncfuture);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user