Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2f2fffb

Browse files
committed
Fix two bad type identifiers that caused crashes on OSX (icglue and Nav).
Silence two innocuous warnings (_File and _collections).
1 parent 3f6dd68 commit 2f2fffb

4 files changed

Lines changed: 4 additions & 6 deletions

File tree

Mac/Modules/Nav.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,7 @@ static char Navrrtype__doc__[] =
403403
;
404404

405405
static PyTypeObject Navrrtype = {
406-
PyObject_HEAD_INIT(&PyType_Type)
407-
0, /*ob_size*/
406+
PyVarObject_HEAD_INIT(&PyType_Type, 0)
408407
"Nav.NavReplyRecord", /*tp_name*/
409408
sizeof(navrrobject), /*tp_basicsize*/
410409
0, /*tp_itemsize*/

Mac/Modules/file/_Filemodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3193,7 +3193,7 @@ PyMac_GetFSRef(PyObject *v, FSRef *fsr)
31933193

31943194
/* On OSX we now try a pathname */
31953195
if ( PyString_Check(v) || PyUnicode_Check(v)) {
3196-
char *path = NULL;
3196+
unsigned char *path = NULL;
31973197
if (!PyArg_Parse(v, "et", Py_FileSystemDefaultEncoding, &path))
31983198
return 0;
31993199
if ( (err=FSPathMakeRef(path, fsr, NULL)) )

Mac/Modules/icgluemodule.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,7 @@ static char Icitype__doc__[] =
392392
;
393393

394394
static PyTypeObject Icitype = {
395-
PyObject_HEAD_INIT(&PyType_Type)
396-
0, /*ob_size*/
395+
PyVarObject_HEAD_INIT(&PyType_Type, 0)
397396
"icglue.ic_instance", /*tp_name*/
398397
sizeof(iciobject), /*tp_basicsize*/
399398
0, /*tp_itemsize*/

Modules/_collectionsmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ defdict_copy(defdictobject *dd)
11031103
whose class constructor has the same signature. Subclasses that
11041104
define a different constructor signature must override copy().
11051105
*/
1106-
return PyObject_CallFunctionObjArgs(Py_Type(dd),
1106+
return PyObject_CallFunctionObjArgs((PyObject *)Py_Type(dd),
11071107
dd->default_factory, dd, NULL);
11081108
}
11091109

0 commit comments

Comments
 (0)