]> granicus.if.org Git - python/commitdiff
Fix two bad type identifiers that caused crashes on OSX (icglue and Nav).
authorGuido van Rossum <guido@python.org>
Wed, 25 Jul 2007 16:47:51 +0000 (16:47 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 25 Jul 2007 16:47:51 +0000 (16:47 +0000)
Silence two innocuous warnings (_File and _collections).

Mac/Modules/Nav.c
Mac/Modules/file/_Filemodule.c
Mac/Modules/icgluemodule.c
Modules/_collectionsmodule.c

index 6786ea029cb3508041202514acb361f65920f30f..f3d8a4874689aabe543fb6e0daa1e9887b5df80b 100644 (file)
@@ -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*/
index 8b4dd1308f55c43fa2906522f65f095fc449f707..0ca9e3bd9affc6a4a306b8d51255ce8a408a0787 100644 (file)
@@ -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)) )
index fa50f0d4631999d628966b6668951756dcb6e6e4..5ea6c723b75907165519ee9ff946c97d3449309d 100644 (file)
@@ -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*/
index e4542312eaf03751fc5b2d526784cee85a079084..1ee3612745c9260a2377f843692b8301b5d0a74e 100644 (file)
@@ -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);
 }