Omaha #4259 fix compiler issues
Change-Id: I16fe1f201bc3676fcf6079743112d8cbaddb0892 Former-commit-id: 4741e21ae3f1b3e0904980b75d2c1dd82aace7ad
This commit is contained in:
parent
a6491bd9d8
commit
460f1a7429
2 changed files with 13 additions and 6 deletions
|
@ -78,11 +78,13 @@ static PyObject* pyjlist_inplace_fill(PyObject*, Py_ssize_t);
|
||||||
*/
|
*/
|
||||||
PyJlist_Object* pyjlist_new() {
|
PyJlist_Object* pyjlist_new() {
|
||||||
/*
|
/*
|
||||||
* some sample code sets this, something about not necessarily being set
|
* Some compilers really don't like tp_base being set on the PyTypeObject
|
||||||
* at compile time with some compilers, seems to work ok with it commented
|
* definition (at the bottom of this file). This ensures it will work
|
||||||
* out
|
* with those compilers.
|
||||||
*/
|
*/
|
||||||
// PyJlist_Type.tp_base = &PyJobject_Type;
|
if(!PyJlist_Type.tp_base) {
|
||||||
|
PyJlist_Type.tp_base = &PyJobject_Type;
|
||||||
|
}
|
||||||
|
|
||||||
if(PyType_Ready(&PyJlist_Type) < 0)
|
if(PyType_Ready(&PyJlist_Type) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -562,7 +564,11 @@ PyTypeObject PyJlist_Type = {
|
||||||
pyjlist_methods, /* tp_methods */
|
pyjlist_methods, /* tp_methods */
|
||||||
0, /* tp_members */
|
0, /* tp_members */
|
||||||
0, /* tp_getset */
|
0, /* tp_getset */
|
||||||
&PyJobject_Type, /* tp_base */
|
/*
|
||||||
|
* make more compilers happy by setting
|
||||||
|
* tp_base in pyjlist_new
|
||||||
|
*/
|
||||||
|
0, // &PyJobject_Type /* tp_base */
|
||||||
0, /* tp_dict */
|
0, /* tp_dict */
|
||||||
0, /* tp_descr_get */
|
0, /* tp_descr_get */
|
||||||
0, /* tp_descr_set */
|
0, /* tp_descr_set */
|
||||||
|
|
|
@ -661,6 +661,7 @@ static PyObject* pyjobject_richcompare(PyJobject_Object *self,
|
||||||
|
|
||||||
if(PyType_IsSubtype(Py_TYPE(_other), &PyJobject_Type)) {
|
if(PyType_IsSubtype(Py_TYPE(_other), &PyJobject_Type)) {
|
||||||
PyJobject_Object *other = (PyJobject_Object *) _other;
|
PyJobject_Object *other = (PyJobject_Object *) _other;
|
||||||
|
jboolean eq;
|
||||||
|
|
||||||
jobject target, other_target;
|
jobject target, other_target;
|
||||||
|
|
||||||
|
@ -694,7 +695,7 @@ static PyObject* pyjobject_richcompare(PyJobject_Object *self,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
jboolean eq = (*env)->CallBooleanMethod(
|
eq = (*env)->CallBooleanMethod(
|
||||||
env,
|
env,
|
||||||
target,
|
target,
|
||||||
objectEquals,
|
objectEquals,
|
||||||
|
|
Loading…
Add table
Reference in a new issue