From 2f2fffb76689df57a93366121f30e078738c552b Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 25 Jul 2007 16:47:51 +0000 Subject: Fix two bad type identifiers that caused crashes on OSX (icglue and Nav). Silence two innocuous warnings (_File and _collections). --- Mac/Modules/Nav.c | 3 +-- Mac/Modules/file/_Filemodule.c | 2 +- Mac/Modules/icgluemodule.c | 3 +-- Modules/_collectionsmodule.c | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Mac/Modules/Nav.c b/Mac/Modules/Nav.c index 6786ea0..f3d8a48 100644 --- a/Mac/Modules/Nav.c +++ b/Mac/Modules/Nav.c @@ -403,8 +403,7 @@ static char Navrrtype__doc__[] = ; static PyTypeObject Navrrtype = { - PyObject_HEAD_INIT(&PyType_Type) - 0, /*ob_size*/ + PyVarObject_HEAD_INIT(&PyType_Type, 0) "Nav.NavReplyRecord", /*tp_name*/ sizeof(navrrobject), /*tp_basicsize*/ 0, /*tp_itemsize*/ diff --git a/Mac/Modules/file/_Filemodule.c b/Mac/Modules/file/_Filemodule.c index 8b4dd13..0ca9e3b 100644 --- a/Mac/Modules/file/_Filemodule.c +++ b/Mac/Modules/file/_Filemodule.c @@ -3193,7 +3193,7 @@ PyMac_GetFSRef(PyObject *v, FSRef *fsr) /* On OSX we now try a pathname */ if ( PyString_Check(v) || PyUnicode_Check(v)) { - char *path = NULL; + unsigned char *path = NULL; if (!PyArg_Parse(v, "et", Py_FileSystemDefaultEncoding, &path)) return 0; if ( (err=FSPathMakeRef(path, fsr, NULL)) ) diff --git a/Mac/Modules/icgluemodule.c b/Mac/Modules/icgluemodule.c index fa50f0d..5ea6c72 100644 --- a/Mac/Modules/icgluemodule.c +++ b/Mac/Modules/icgluemodule.c @@ -392,8 +392,7 @@ static char Icitype__doc__[] = ; static PyTypeObject Icitype = { - PyObject_HEAD_INIT(&PyType_Type) - 0, /*ob_size*/ + PyVarObject_HEAD_INIT(&PyType_Type, 0) "icglue.ic_instance", /*tp_name*/ sizeof(iciobject), /*tp_basicsize*/ 0, /*tp_itemsize*/ diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index e454231..1ee3612 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -1103,7 +1103,7 @@ defdict_copy(defdictobject *dd) whose class constructor has the same signature. Subclasses that define a different constructor signature must override copy(). */ - return PyObject_CallFunctionObjArgs(Py_Type(dd), + return PyObject_CallFunctionObjArgs((PyObject *)Py_Type(dd), dd->default_factory, dd, NULL); } -- cgit v0.12