Omaha #4259 fix compiler issues

Change-Id: I16fe1f201bc3676fcf6079743112d8cbaddb0892

Former-commit-id: 4741e21ae3f1b3e0904980b75d2c1dd82aace7ad
This commit is contained in:
Nate Jensen 2015-04-15 11:52:38 -05:00
parent a6491bd9d8
commit 460f1a7429
2 changed files with 13 additions and 6 deletions

View file

@ -78,11 +78,13 @@ static PyObject* pyjlist_inplace_fill(PyObject*, Py_ssize_t);
*/
PyJlist_Object* pyjlist_new() {
/*
* some sample code sets this, something about not necessarily being set
* at compile time with some compilers, seems to work ok with it commented
* out
* Some compilers really don't like tp_base being set on the PyTypeObject
* definition (at the bottom of this file). This ensures it will work
* 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)
return NULL;
@ -562,7 +564,11 @@ PyTypeObject PyJlist_Type = {
pyjlist_methods, /* tp_methods */
0, /* tp_members */
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_descr_get */
0, /* tp_descr_set */

View file

@ -661,6 +661,7 @@ static PyObject* pyjobject_richcompare(PyJobject_Object *self,
if(PyType_IsSubtype(Py_TYPE(_other), &PyJobject_Type)) {
PyJobject_Object *other = (PyJobject_Object *) _other;
jboolean eq;
jobject target, other_target;
@ -694,7 +695,7 @@ static PyObject* pyjobject_richcompare(PyJobject_Object *self,
return NULL;
}
jboolean eq = (*env)->CallBooleanMethod(
eq = (*env)->CallBooleanMethod(
env,
target,
objectEquals,