]> granicus.if.org Git - python/commitdiff
- Various tweaks to shut up compiler warnings.
authorJack Jansen <jack.jansen@cwi.nl>
Mon, 23 Dec 2002 23:16:25 +0000 (23:16 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Mon, 23 Dec 2002 23:16:25 +0000 (23:16 +0000)
- Regenerated with the correct calls to PyType_Ready and the correct
  deallocator calls.

27 files changed:
Mac/Modules/Nav.c
Mac/Modules/ae/_AEmodule.c
Mac/Modules/app/_Appmodule.c
Mac/Modules/carbonevt/CarbonEvtsupport.py
Mac/Modules/carbonevt/_CarbonEvtmodule.c
Mac/Modules/cg/_CGmodule.c
Mac/Modules/cm/_Cmmodule.c
Mac/Modules/ctl/_Ctlmodule.c
Mac/Modules/dlg/_Dlgmodule.c
Mac/Modules/drag/_Dragmodule.c
Mac/Modules/file/_Filemodule.c
Mac/Modules/ibcarbon/_IBCarbon.c
Mac/Modules/list/_Listmodule.c
Mac/Modules/macosmodule.c
Mac/Modules/menu/_Menumodule.c
Mac/Modules/menu/menusupport.py
Mac/Modules/mlte/_Mltemodule.c
Mac/Modules/qd/_Qdmodule.c
Mac/Modules/qdoffs/_Qdoffsmodule.c
Mac/Modules/qt/_Qtmodule.c
Mac/Modules/res/_Resmodule.c
Mac/Modules/scrap/_Scrapmodule.c
Mac/Modules/snd/_Sndmodule.c
Mac/Modules/te/_TEmodule.c
Mac/Modules/waste/wastemodule.c
Mac/Modules/waste/wastesupport.py
Mac/Modules/win/_Winmodule.c

index 8833a84ac46c86ffc7e4eb8ae833fd6469e9a43e..b4984dafd16490bbccb2fcad42f441ade408bbb5 100644 (file)
@@ -338,7 +338,7 @@ navrr_getattr(navrrobject *self, char *name)
                PyObject *rv, *rvitem;
                AEDesc desc;
                
-               if (err=AECountItems(&self->itself.selection, &count)) {
+               if ((err=AECountItems(&self->itself.selection, &count))) {
                        PyErr_Mac(ErrorObject, err);
                        return NULL;
                }
@@ -346,12 +346,12 @@ navrr_getattr(navrrobject *self, char *name)
                        return NULL;
                for(i=0; i<count; i++) {
                        desc.dataHandle = NULL;
-                       if (err=AEGetNthDesc(&self->itself.selection, i+1, typeFSS, NULL, &desc)) {
+                       if ((err=AEGetNthDesc(&self->itself.selection, i+1, typeFSS, NULL, &desc))) {
                                Py_DECREF(rv);
                                PyErr_Mac(ErrorObject, err);
                                return NULL;
                        }
-                       if (err=AEGetDescData(&desc, &fss, sizeof(FSSpec))) {
+                       if ((err=AEGetDescData(&desc, &fss, sizeof(FSSpec)))) {
                                Py_DECREF(rv);
                                PyErr_Mac(ErrorObject, err);
                                return NULL;
@@ -368,7 +368,7 @@ navrr_getattr(navrrobject *self, char *name)
                PyObject *rv, *rvitem;
                AEDesc desc;
                
-               if (err=AECountItems(&self->itself.selection, &count)) {
+               if ((err=AECountItems(&self->itself.selection, &count))) {
                        PyErr_Mac(ErrorObject, err);
                        return NULL;
                }
@@ -376,12 +376,12 @@ navrr_getattr(navrrobject *self, char *name)
                        return NULL;
                for(i=0; i<count; i++) {
                        desc.dataHandle = NULL;
-                       if (err=AEGetNthDesc(&self->itself.selection, i+1, typeFSRef, NULL, &desc)) {
+                       if ((err=AEGetNthDesc(&self->itself.selection, i+1, typeFSRef, NULL, &desc))) {
                                Py_DECREF(rv);
                                PyErr_Mac(ErrorObject, err);
                                return NULL;
                        }
-                       if (err=AEGetDescData(&desc, &fsr, sizeof(FSRef))) {
+                       if ((err=AEGetDescData(&desc, &fsr, sizeof(FSRef)))) {
                                Py_DECREF(rv);
                                PyErr_Mac(ErrorObject, err);
                                return NULL;
index b5b4cd6d078814a5ab044066727ea829f158d5fe..bcb24a75a676a8090f806b3dba3bb8f1719a1ba4 100644 (file)
@@ -94,7 +94,7 @@ int AEDesc_Convert(PyObject *v, AEDesc *p_itself)
 static void AEDesc_dealloc(AEDescObject *self)
 {
        AEDisposeDesc(&self->ob_itself);
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *AEDesc_AECoerceDesc(AEDescObject *_self, PyObject *_args)
@@ -1434,6 +1434,7 @@ void init_AE(void)
            PyDict_SetItemString(d, "Error", AE_Error) != 0)
                return;
        AEDesc_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&AEDesc_Type) < 0) return;
        Py_INCREF(&AEDesc_Type);
        PyModule_AddObject(m, "AEDesc", (PyObject *)&AEDesc_Type);
        /* Backward-compatible name */
index 347cf5bd6702e639dac40d9f6cfea32f92a46e1c..069c08feb1562cc3c563d8d3ea7096a9952e9929 100644 (file)
@@ -69,7 +69,7 @@ int ThemeDrawingStateObj_Convert(PyObject *v, ThemeDrawingState *p_itself)
 static void ThemeDrawingStateObj_dealloc(ThemeDrawingStateObject *self)
 {
        /* Cleanup of self->ob_itself goes here */
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *ThemeDrawingStateObj_SetThemeDrawingState(ThemeDrawingStateObject *_self, PyObject *_args)
@@ -1818,6 +1818,7 @@ void init_App(void)
            PyDict_SetItemString(d, "Error", App_Error) != 0)
                return;
        ThemeDrawingState_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&ThemeDrawingState_Type) < 0) return;
        Py_INCREF(&ThemeDrawingState_Type);
        PyModule_AddObject(m, "ThemeDrawingState", (PyObject *)&ThemeDrawingState_Type);
        /* Backward-compatible name */
index 7653b081819174938e01b976a40407340cad233f..492720f851a500ab457220b3c4a0a2506696bd78 100644 (file)
@@ -357,8 +357,8 @@ MPDeleteCriticalRegion(reentrantLock);
 #endif /* USE_MAC_MP_MULTITHREADING */
 
 Py_INCREF(Py_None);
-
-return Py_None;
+_res = Py_None;
+return _res;
 """                    
 
 f = ManualGenerator("RunApplicationEventLoop", runappeventloop);
index 86f67cf5f9c0b4760245057c143f2a83c79b1ba7..6d1aa0f2efaabdead4a9424712e3764382926a3a 100755 (executable)
@@ -171,7 +171,7 @@ int EventRef_Convert(PyObject *v, EventRef *p_itself)
 static void EventRef_dealloc(EventRefObject *self)
 {
        /* Cleanup of self->ob_itself goes here */
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *EventRef_RetainEvent(EventRefObject *_self, PyObject *_args)
@@ -515,7 +515,7 @@ int EventQueueRef_Convert(PyObject *v, EventQueueRef *p_itself)
 static void EventQueueRef_dealloc(EventQueueRefObject *self)
 {
        /* Cleanup of self->ob_itself goes here */
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *EventQueueRef_PostEventToQueue(EventQueueRefObject *_self, PyObject *_args)
@@ -735,7 +735,7 @@ int EventLoopRef_Convert(PyObject *v, EventLoopRef *p_itself)
 static void EventLoopRef_dealloc(EventLoopRefObject *self)
 {
        /* Cleanup of self->ob_itself goes here */
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *EventLoopRef_QuitEventLoop(EventLoopRefObject *_self, PyObject *_args)
@@ -864,7 +864,7 @@ int EventLoopTimerRef_Convert(PyObject *v, EventLoopTimerRef *p_itself)
 static void EventLoopTimerRef_dealloc(EventLoopTimerRefObject *self)
 {
        /* Cleanup of self->ob_itself goes here */
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *EventLoopTimerRef_RemoveEventLoopTimer(EventLoopTimerRefObject *_self, PyObject *_args)
@@ -1016,7 +1016,7 @@ static void EventHandlerRef_dealloc(EventHandlerRefObject *self)
                RemoveEventHandler(self->ob_itself);
                Py_DECREF(self->ob_callback);
        }
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *EventHandlerRef_AddEventTypesToHandler(EventHandlerRefObject *_self, PyObject *_args)
@@ -1203,7 +1203,7 @@ int EventHandlerCallRef_Convert(PyObject *v, EventHandlerCallRef *p_itself)
 static void EventHandlerCallRef_dealloc(EventHandlerCallRefObject *self)
 {
        /* Cleanup of self->ob_itself goes here */
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *EventHandlerCallRef_CallNextEventHandler(EventHandlerCallRefObject *_self, PyObject *_args)
@@ -1335,7 +1335,7 @@ int EventTargetRef_Convert(PyObject *v, EventTargetRef *p_itself)
 static void EventTargetRef_dealloc(EventTargetRefObject *self)
 {
        /* Cleanup of self->ob_itself goes here */
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *EventTargetRef_InstallStandardEventHandler(EventTargetRefObject *_self, PyObject *_args)
@@ -1489,7 +1489,7 @@ int EventHotKeyRef_Convert(PyObject *v, EventHotKeyRef *p_itself)
 static void EventHotKeyRef_dealloc(EventHotKeyRefObject *self)
 {
        /* Cleanup of self->ob_itself goes here */
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *EventHotKeyRef_UnregisterEventHotKey(EventHotKeyRefObject *_self, PyObject *_args)
@@ -2067,8 +2067,8 @@ static PyObject *CarbonEvents_RunApplicationEventLoop(PyObject *_self, PyObject
 #endif /* USE_MAC_MP_MULTITHREADING */
 
        Py_INCREF(Py_None);
-
-       return Py_None;
+       _res = Py_None;
+       return _res;
 
 }
 
@@ -2157,48 +2157,56 @@ void init_CarbonEvt(void)
            PyDict_SetItemString(d, "Error", CarbonEvents_Error) != 0)
                return;
        EventRef_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&EventRef_Type) < 0) return;
        Py_INCREF(&EventRef_Type);
        PyModule_AddObject(m, "EventRef", (PyObject *)&EventRef_Type);
        /* Backward-compatible name */
        Py_INCREF(&EventRef_Type);
        PyModule_AddObject(m, "EventRefType", (PyObject *)&EventRef_Type);
        EventQueueRef_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&EventQueueRef_Type) < 0) return;
        Py_INCREF(&EventQueueRef_Type);
        PyModule_AddObject(m, "EventQueueRef", (PyObject *)&EventQueueRef_Type);
        /* Backward-compatible name */
        Py_INCREF(&EventQueueRef_Type);
        PyModule_AddObject(m, "EventQueueRefType", (PyObject *)&EventQueueRef_Type);
        EventLoopRef_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&EventLoopRef_Type) < 0) return;
        Py_INCREF(&EventLoopRef_Type);
        PyModule_AddObject(m, "EventLoopRef", (PyObject *)&EventLoopRef_Type);
        /* Backward-compatible name */
        Py_INCREF(&EventLoopRef_Type);
        PyModule_AddObject(m, "EventLoopRefType", (PyObject *)&EventLoopRef_Type);
        EventLoopTimerRef_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&EventLoopTimerRef_Type) < 0) return;
        Py_INCREF(&EventLoopTimerRef_Type);
        PyModule_AddObject(m, "EventLoopTimerRef", (PyObject *)&EventLoopTimerRef_Type);
        /* Backward-compatible name */
        Py_INCREF(&EventLoopTimerRef_Type);
        PyModule_AddObject(m, "EventLoopTimerRefType", (PyObject *)&EventLoopTimerRef_Type);
        EventHandlerRef_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&EventHandlerRef_Type) < 0) return;
        Py_INCREF(&EventHandlerRef_Type);
        PyModule_AddObject(m, "EventHandlerRef", (PyObject *)&EventHandlerRef_Type);
        /* Backward-compatible name */
        Py_INCREF(&EventHandlerRef_Type);
        PyModule_AddObject(m, "EventHandlerRefType", (PyObject *)&EventHandlerRef_Type);
        EventHandlerCallRef_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&EventHandlerCallRef_Type) < 0) return;
        Py_INCREF(&EventHandlerCallRef_Type);
        PyModule_AddObject(m, "EventHandlerCallRef", (PyObject *)&EventHandlerCallRef_Type);
        /* Backward-compatible name */
        Py_INCREF(&EventHandlerCallRef_Type);
        PyModule_AddObject(m, "EventHandlerCallRefType", (PyObject *)&EventHandlerCallRef_Type);
        EventTargetRef_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&EventTargetRef_Type) < 0) return;
        Py_INCREF(&EventTargetRef_Type);
        PyModule_AddObject(m, "EventTargetRef", (PyObject *)&EventTargetRef_Type);
        /* Backward-compatible name */
        Py_INCREF(&EventTargetRef_Type);
        PyModule_AddObject(m, "EventTargetRefType", (PyObject *)&EventTargetRef_Type);
        EventHotKeyRef_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&EventHotKeyRef_Type) < 0) return;
        Py_INCREF(&EventHotKeyRef_Type);
        PyModule_AddObject(m, "EventHotKeyRef", (PyObject *)&EventHotKeyRef_Type);
        /* Backward-compatible name */
index fbafc6c1ce8f15d7bb0cecb06322d053b759cdde..3bc114c82b164e6a0250a7ebf1b612c4d02fcf26 100755 (executable)
@@ -241,7 +241,7 @@ int CGContextRefObj_Convert(PyObject *v, CGContextRef *p_itself)
 static void CGContextRefObj_dealloc(CGContextRefObject *self)
 {
        CGContextRelease(self->ob_itself);
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *CGContextRefObj_CGContextSaveGState(CGContextRefObject *_self, PyObject *_args)
@@ -1399,6 +1399,7 @@ void init_CG(void)
            PyDict_SetItemString(d, "Error", CG_Error) != 0)
                return;
        CGContextRef_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&CGContextRef_Type) < 0) return;
        Py_INCREF(&CGContextRef_Type);
        PyModule_AddObject(m, "CGContextRef", (PyObject *)&CGContextRef_Type);
        /* Backward-compatible name */
index 1eaa577a8c9d914ce1468e9834e68c09f9505063..7abdaa966e28ce6abea6ac500e2d9d80c1f266a2 100644 (file)
@@ -102,7 +102,7 @@ int CmpInstObj_Convert(PyObject *v, ComponentInstance *p_itself)
 static void CmpInstObj_dealloc(ComponentInstanceObject *self)
 {
        /* Cleanup of self->ob_itself goes here */
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *CmpInstObj_CloseComponent(ComponentInstanceObject *_self, PyObject *_args)
@@ -373,7 +373,7 @@ int CmpObj_Convert(PyObject *v, Component *p_itself)
 static void CmpObj_dealloc(ComponentObject *self)
 {
        /* Cleanup of self->ob_itself goes here */
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *CmpObj_UnregisterComponent(ComponentObject *_self, PyObject *_args)
@@ -935,12 +935,14 @@ void init_Cm(void)
            PyDict_SetItemString(d, "Error", Cm_Error) != 0)
                return;
        ComponentInstance_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&ComponentInstance_Type) < 0) return;
        Py_INCREF(&ComponentInstance_Type);
        PyModule_AddObject(m, "ComponentInstance", (PyObject *)&ComponentInstance_Type);
        /* Backward-compatible name */
        Py_INCREF(&ComponentInstance_Type);
        PyModule_AddObject(m, "ComponentInstanceType", (PyObject *)&ComponentInstance_Type);
        Component_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&Component_Type) < 0) return;
        Py_INCREF(&Component_Type);
        PyModule_AddObject(m, "Component", (PyObject *)&Component_Type);
        /* Backward-compatible name */
index cc4bce2d75a97c194a30b1106435690d30a987d5..98c6f4f05be8a822e4800e5fe89d0276f5585b79 100644 (file)
@@ -179,7 +179,7 @@ static void CtlObj_dealloc(ControlObject *self)
 {
        Py_XDECREF(self->ob_callbackdict);
        if (self->ob_itself)SetControlReference(self->ob_itself, (long)0); /* Make it forget about us */
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *CtlObj_HiliteControl(ControlObject *_self, PyObject *_args)
@@ -5849,6 +5849,7 @@ void init_Ctl(void)
            PyDict_SetItemString(d, "Error", Ctl_Error) != 0)
                return;
        Control_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&Control_Type) < 0) return;
        Py_INCREF(&Control_Type);
        PyModule_AddObject(m, "Control", (PyObject *)&Control_Type);
        /* Backward-compatible name */
index 50edc872030d61d9b4d9127afd46e235ce53134a..c4e3ed881957ad37e686e13c4a4d4b625e42c869 100644 (file)
@@ -172,7 +172,7 @@ int DlgObj_Convert(PyObject *v, DialogPtr *p_itself)
 static void DlgObj_dealloc(DialogObject *self)
 {
        DisposeDialog(self->ob_itself);
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *DlgObj_DrawDialog(DialogObject *_self, PyObject *_args)
@@ -1590,6 +1590,7 @@ void init_Dlg(void)
            PyDict_SetItemString(d, "Error", Dlg_Error) != 0)
                return;
        Dialog_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&Dialog_Type) < 0) return;
        Py_INCREF(&Dialog_Type);
        PyModule_AddObject(m, "Dialog", (PyObject *)&Dialog_Type);
        /* Backward-compatible name */
index 1a9406fbf66823f89c7d3ea370e60fa33574e75a..3b00da81376335c21dcf3d18411bccbc8b19d411 100644 (file)
@@ -84,7 +84,7 @@ int DragObj_Convert(PyObject *v, DragRef *p_itself)
 static void DragObj_dealloc(DragObjObject *self)
 {
        Py_XDECREF(self->sendproc);
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *DragObj_DisposeDrag(DragObjObject *_self, PyObject *_args)
@@ -1135,6 +1135,7 @@ void init_Drag(void)
            PyDict_SetItemString(d, "Error", Drag_Error) != 0)
                return;
        DragObj_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&DragObj_Type) < 0) return;
        Py_INCREF(&DragObj_Type);
        PyModule_AddObject(m, "DragObj", (PyObject *)&DragObj_Type);
        /* Backward-compatible name */
index ad901455d99ba62589138f2f7a57e3cae9edcdf5..70a8720abca51bf718d7148a5e79db1e8d2c445a 100644 (file)
@@ -2740,24 +2740,28 @@ void init_File(void)
            PyDict_SetItemString(d, "Error", File_Error) != 0)
                return;
        FInfo_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&FInfo_Type) < 0) return;
        Py_INCREF(&FInfo_Type);
        PyModule_AddObject(m, "FInfo", (PyObject *)&FInfo_Type);
        /* Backward-compatible name */
        Py_INCREF(&FInfo_Type);
        PyModule_AddObject(m, "FInfoType", (PyObject *)&FInfo_Type);
        Alias_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&Alias_Type) < 0) return;
        Py_INCREF(&Alias_Type);
        PyModule_AddObject(m, "Alias", (PyObject *)&Alias_Type);
        /* Backward-compatible name */
        Py_INCREF(&Alias_Type);
        PyModule_AddObject(m, "AliasType", (PyObject *)&Alias_Type);
        FSSpec_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&FSSpec_Type) < 0) return;
        Py_INCREF(&FSSpec_Type);
        PyModule_AddObject(m, "FSSpec", (PyObject *)&FSSpec_Type);
        /* Backward-compatible name */
        Py_INCREF(&FSSpec_Type);
        PyModule_AddObject(m, "FSSpecType", (PyObject *)&FSSpec_Type);
        FSRef_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&FSRef_Type) < 0) return;
        Py_INCREF(&FSRef_Type);
        PyModule_AddObject(m, "FSRef", (PyObject *)&FSRef_Type);
        /* Backward-compatible name */
index d2eff0276d842f097fbc7a0adcdd9bbb0fa8a8b5..1a712c690a4e63377e4b88a238a920f587a1b01c 100644 (file)
@@ -55,7 +55,7 @@ int IBNibRefObj_Convert(PyObject *v, IBNibRef *p_itself)
 static void IBNibRefObj_dealloc(IBNibRefObject *self)
 {
        DisposeNibReference(self->ob_itself);
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *IBNibRefObj_CreateWindowFromNib(IBNibRefObject *_self, PyObject *_args)
@@ -256,6 +256,7 @@ void init_IBCarbon(void)
            PyDict_SetItemString(d, "Error", IBCarbon_Error) != 0)
                return;
        IBNibRef_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&IBNibRef_Type) < 0) return;
        Py_INCREF(&IBNibRef_Type);
        PyModule_AddObject(m, "IBNibRef", (PyObject *)&IBNibRef_Type);
        /* Backward-compatible name */
index 5cd007e9f1516f3da6f9f975bff65ac114414bdf..05af28e2b9077359439356cca3142d68ada1d770 100644 (file)
@@ -112,7 +112,7 @@ static void ListObj_dealloc(ListObject *self)
        self->ob_ldef_func = NULL;
        SetListRefCon(self->ob_itself, (long)0);
        if (self->ob_must_be_disposed && self->ob_itself) LDispose(self->ob_itself);
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *ListObj_LAddColumn(ListObject *_self, PyObject *_args)
@@ -1151,6 +1151,7 @@ void init_List(void)
            PyDict_SetItemString(d, "Error", List_Error) != 0)
                return;
        List_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&List_Type) < 0) return;
        Py_INCREF(&List_Type);
        PyModule_AddObject(m, "List", (PyObject *)&List_Type);
        /* Backward-compatible name */
index 2ff58958537b969f19dabffa9097a6ed25f7a27f..5b445c0f8538129a03664b19fc6f8a70fd3e7613 100644 (file)
@@ -566,7 +566,7 @@ MacOS_openrf(PyObject *self, PyObject *args)
                FILE *tfp;
                char pathname[PATHNAMELEN];
                
-               if ( err=PyMac_GetFullPathname(&fss, pathname, PATHNAMELEN) ) {
+               if ( (err=PyMac_GetFullPathname(&fss, pathname, PATHNAMELEN)) ) {
                        PyMac_Error(err);
                        Py_DECREF(fp);
                        return NULL;
index 629adaf5c246f0dc837c6031a751014a707e7183..4e3aa20d87c8b77c08f4a29cca152840a5936c7b 100644 (file)
@@ -64,8 +64,6 @@ PyObject *OptMenuObj_New(MenuRef itself)
 /* Alternative version of MenuObj_Convert, which returns NULL for a None argument */
 int OptMenuObj_Convert(PyObject *v, MenuRef *p_itself)
 {
-       PyObject *tmp;
-       
        if ( v == Py_None ) {
                *p_itself = NULL;
                return 1;
@@ -108,7 +106,7 @@ int MenuObj_Convert(PyObject *v, MenuHandle *p_itself)
 static void MenuObj_dealloc(MenuObject *self)
 {
        /* Cleanup of self->ob_itself goes here */
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *MenuObj_DisposeMenu(MenuObject *_self, PyObject *_args)
@@ -3478,6 +3476,7 @@ void init_Menu(void)
            PyDict_SetItemString(d, "Error", Menu_Error) != 0)
                return;
        Menu_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&Menu_Type) < 0) return;
        Py_INCREF(&Menu_Type);
        PyModule_AddObject(m, "Menu", (PyObject *)&Menu_Type);
        /* Backward-compatible name */
index 7a660c57eff3c1cb96694966f5e087a11bc0da31..6c8229cc7201fa17e608b1137237dbf2071d504f 100644 (file)
@@ -83,8 +83,6 @@ PyObject *OptMenuObj_New(MenuRef itself)
 /* Alternative version of MenuObj_Convert, which returns NULL for a None argument */
 int OptMenuObj_Convert(PyObject *v, MenuRef *p_itself)
 {
-       PyObject *tmp;
-       
        if ( v == Py_None ) {
                *p_itself = NULL;
                return 1;
index dd30b97ef015bff79e9f0f513f2da40f11fce89b..aebec02b5efb265e9a9570ff030955ebdd496878 100644 (file)
@@ -125,7 +125,7 @@ int TXNObj_Convert(PyObject *v, TXNObject *p_itself)
 static void TXNObj_dealloc(TXNObjectObject *self)
 {
        /* Cleanup of self->ob_itself goes here */
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *TXNObj_TXNDeleteObject(TXNObjectObject *_self, PyObject *_args)
@@ -1377,7 +1377,7 @@ int TXNFontMenuObj_Convert(PyObject *v, TXNFontMenuObject *p_itself)
 static void TXNFontMenuObj_dealloc(TXNFontMenuObjectObject *self)
 {
        /* Cleanup of self->ob_itself goes here */
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *TXNFontMenuObj_TXNGetFontMenuHandle(TXNFontMenuObjectObject *_self, PyObject *_args)
@@ -1703,12 +1703,14 @@ void init_Mlte(void)
            PyDict_SetItemString(d, "Error", Mlte_Error) != 0)
                return;
        TXNObject_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&TXNObject_Type) < 0) return;
        Py_INCREF(&TXNObject_Type);
        PyModule_AddObject(m, "TXNObject", (PyObject *)&TXNObject_Type);
        /* Backward-compatible name */
        Py_INCREF(&TXNObject_Type);
        PyModule_AddObject(m, "TXNObjectType", (PyObject *)&TXNObject_Type);
        TXNFontMenuObject_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&TXNFontMenuObject_Type) < 0) return;
        Py_INCREF(&TXNFontMenuObject_Type);
        PyModule_AddObject(m, "TXNFontMenuObject", (PyObject *)&TXNFontMenuObject_Type);
        /* Backward-compatible name */
index c1690c180f5100801cb53d5541e7a8c50e3c2050..8187baa4b08d8326781205d1b734c80640be43c5 100644 (file)
@@ -196,7 +196,7 @@ int GrafObj_Convert(PyObject *v, GrafPtr *p_itself)
 static void GrafObj_dealloc(GrafPortObject *self)
 {
        /* Cleanup of self->ob_itself goes here */
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *GrafObj_MacSetPort(GrafPortObject *_self, PyObject *_args)
@@ -1172,7 +1172,7 @@ static void BMObj_dealloc(BitMapObject *self)
 {
        Py_XDECREF(self->referred_object);
        if (self->referred_bitmap) free(self->referred_bitmap);
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *BMObj_getdata(BitMapObject *_self, PyObject *_args)
@@ -6851,12 +6851,14 @@ void init_Qd(void)
            PyDict_SetItemString(d, "Error", Qd_Error) != 0)
                return;
        GrafPort_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&GrafPort_Type) < 0) return;
        Py_INCREF(&GrafPort_Type);
        PyModule_AddObject(m, "GrafPort", (PyObject *)&GrafPort_Type);
        /* Backward-compatible name */
        Py_INCREF(&GrafPort_Type);
        PyModule_AddObject(m, "GrafPortType", (PyObject *)&GrafPort_Type);
        BitMap_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&BitMap_Type) < 0) return;
        Py_INCREF(&BitMap_Type);
        PyModule_AddObject(m, "BitMap", (PyObject *)&BitMap_Type);
        /* Backward-compatible name */
index ea3d0155dbe1d63790c70009625eb4de296dc6f1..8d9f7efd0d0cdf4205299d0422c2cfec5839c5f0 100644 (file)
@@ -73,7 +73,7 @@ int GWorldObj_Convert(PyObject *v, GWorldPtr *p_itself)
 static void GWorldObj_dealloc(GWorldObject *self)
 {
        DisposeGWorld(self->ob_itself);
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *GWorldObj_GetGWorldDevice(GWorldObject *_self, PyObject *_args)
@@ -710,6 +710,7 @@ void init_Qdoffs(void)
            PyDict_SetItemString(d, "Error", Qdoffs_Error) != 0)
                return;
        GWorld_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&GWorld_Type) < 0) return;
        Py_INCREF(&GWorld_Type);
        PyModule_AddObject(m, "GWorld", (PyObject *)&GWorld_Type);
        /* Backward-compatible name */
index 83c6bac12df1ae72f26ba0abaec12696b258e672..6da1a5354c2e224800e48d969511449e175dceba 100644 (file)
@@ -130,7 +130,7 @@ int MovieCtlObj_Convert(PyObject *v, MovieController *p_itself)
 static void MovieCtlObj_dealloc(MovieControllerObject *self)
 {
        DisposeMovieController(self->ob_itself);
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *MovieCtlObj_MCSetMovie(MovieControllerObject *_self, PyObject *_args)
@@ -1201,7 +1201,7 @@ int TimeBaseObj_Convert(PyObject *v, TimeBase *p_itself)
 static void TimeBaseObj_dealloc(TimeBaseObject *self)
 {
        /* Cleanup of self->ob_itself goes here */
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *TimeBaseObj_DisposeTimeBase(TimeBaseObject *_self, PyObject *_args)
@@ -1689,7 +1689,7 @@ int UserDataObj_Convert(PyObject *v, UserData *p_itself)
 static void UserDataObj_dealloc(UserDataObject *self)
 {
        DisposeUserData(self->ob_itself);
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *UserDataObj_GetUserData(UserDataObject *_self, PyObject *_args)
@@ -2030,7 +2030,7 @@ int MediaObj_Convert(PyObject *v, Media *p_itself)
 static void MediaObj_dealloc(MediaObject *self)
 {
        DisposeTrackMedia(self->ob_itself);
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *MediaObj_LoadMediaIntoRam(MediaObject *_self, PyObject *_args)
@@ -3242,7 +3242,7 @@ int TrackObj_Convert(PyObject *v, Track *p_itself)
 static void TrackObj_dealloc(TrackObject *self)
 {
        DisposeMovieTrack(self->ob_itself);
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *TrackObj_LoadTrackIntoRam(TrackObject *_self, PyObject *_args)
@@ -4560,7 +4560,7 @@ int MovieObj_Convert(PyObject *v, Movie *p_itself)
 static void MovieObj_dealloc(MovieObject *self)
 {
        DisposeMovie(self->ob_itself);
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *MovieObj_MoviesTask(MovieObject *_self, PyObject *_args)
@@ -9740,36 +9740,42 @@ void init_Qt(void)
            PyDict_SetItemString(d, "Error", Qt_Error) != 0)
                return;
        MovieController_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&MovieController_Type) < 0) return;
        Py_INCREF(&MovieController_Type);
        PyModule_AddObject(m, "MovieController", (PyObject *)&MovieController_Type);
        /* Backward-compatible name */
        Py_INCREF(&MovieController_Type);
        PyModule_AddObject(m, "MovieControllerType", (PyObject *)&MovieController_Type);
        TimeBase_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&TimeBase_Type) < 0) return;
        Py_INCREF(&TimeBase_Type);
        PyModule_AddObject(m, "TimeBase", (PyObject *)&TimeBase_Type);
        /* Backward-compatible name */
        Py_INCREF(&TimeBase_Type);
        PyModule_AddObject(m, "TimeBaseType", (PyObject *)&TimeBase_Type);
        UserData_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&UserData_Type) < 0) return;
        Py_INCREF(&UserData_Type);
        PyModule_AddObject(m, "UserData", (PyObject *)&UserData_Type);
        /* Backward-compatible name */
        Py_INCREF(&UserData_Type);
        PyModule_AddObject(m, "UserDataType", (PyObject *)&UserData_Type);
        Media_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&Media_Type) < 0) return;
        Py_INCREF(&Media_Type);
        PyModule_AddObject(m, "Media", (PyObject *)&Media_Type);
        /* Backward-compatible name */
        Py_INCREF(&Media_Type);
        PyModule_AddObject(m, "MediaType", (PyObject *)&Media_Type);
        Track_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&Track_Type) < 0) return;
        Py_INCREF(&Track_Type);
        PyModule_AddObject(m, "Track", (PyObject *)&Track_Type);
        /* Backward-compatible name */
        Py_INCREF(&Track_Type);
        PyModule_AddObject(m, "TrackType", (PyObject *)&Track_Type);
        Movie_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&Movie_Type) < 0) return;
        Py_INCREF(&Movie_Type);
        PyModule_AddObject(m, "Movie", (PyObject *)&Movie_Type);
        /* Backward-compatible name */
index e34c2c59a3fe337239c25c48dc84b054842d99c5..e759269db0d2ec6bf4844f57ed805f7ae040211a 100644 (file)
@@ -101,7 +101,7 @@ static void ResObj_dealloc(ResourceObject *self)
                self->ob_freeit(self->ob_itself);
        }
        self->ob_itself = NULL;
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *ResObj_HomeResFile(ResourceObject *_self, PyObject *_args)
@@ -1744,6 +1744,7 @@ void init_Res(void)
            PyDict_SetItemString(d, "Error", Res_Error) != 0)
                return;
        Resource_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&Resource_Type) < 0) return;
        Py_INCREF(&Resource_Type);
        PyModule_AddObject(m, "Resource", (PyObject *)&Resource_Type);
        /* Backward-compatible name */
index 9c681d3c5b39d02200e53fca2606e386381d49a6..58e565f8d80e6b3536100011d80ca3616214609b 100644 (file)
@@ -127,7 +127,6 @@ static PyObject *ScrapObj_GetScrapFlavorData(ScrapObject *_self, PyObject *_args
                Py_XDECREF(_res);
                return PyMac_Error(_err);
        }
- destination__error__: ;
        return _res;
 }
 
@@ -152,7 +151,6 @@ static PyObject *ScrapObj_PutScrapFlavor(ScrapObject *_self, PyObject *_args)
        if (_err != noErr) return PyMac_Error(_err);
        Py_INCREF(Py_None);
        _res = Py_None;
- flavorData__error__: ;
        return _res;
 }
 
index 136504bfea43285e4d89118b64f8133721441807..c27fab626dded438d1e247112cdd9ae657e419f3 100644 (file)
@@ -78,7 +78,7 @@ static void SndCh_dealloc(SndChannelObject *self)
 {
        SndDisposeChannel(self->ob_itself, 1);
        Py_XDECREF(self->ob_callback);
-       PyObject_Del(self);
+       PyObject_Free((PyObject *)self);
 }
 
 static PyObject *SndCh_SndDoCommand(SndChannelObject *_self, PyObject *_args)
@@ -310,7 +310,7 @@ static void SPBObj_dealloc(SPBObject *self)
        self->ob_thiscallback = 0;
        Py_XDECREF(self->ob_completion);
        Py_XDECREF(self->ob_interrupt);
-       PyObject_Del(self);
+       PyObject_Free((PyObject *)self);
 }
 
 static PyMethodDef SPBObj_methods[] = {
@@ -1142,12 +1142,14 @@ void init_Snd(void)
            PyDict_SetItemString(d, "Error", Snd_Error) != 0)
                return;
        SndChannel_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&SndChannel_Type) < 0) return;
        Py_INCREF(&SndChannel_Type);
        PyModule_AddObject(m, "SndChannel", (PyObject *)&SndChannel_Type);
        /* Backward-compatible name */
        Py_INCREF(&SndChannel_Type);
        PyModule_AddObject(m, "SndChannelType", (PyObject *)&SndChannel_Type);
        SPB_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&SPB_Type) < 0) return;
        Py_INCREF(&SPB_Type);
        PyModule_AddObject(m, "SPB", (PyObject *)&SPB_Type);
        /* Backward-compatible name */
index ec5b9cb732c9750eeb299a6b591427ba4cc5f95a..2da251350766fed3a6e8a11cd6319cdf06287068 100644 (file)
@@ -100,7 +100,7 @@ int TEObj_Convert(PyObject *v, TEHandle *p_itself)
 static void TEObj_dealloc(TEObject *self)
 {
        TEDispose(self->ob_itself);
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *TEObj_TESetText(TEObject *_self, PyObject *_args)
@@ -1327,6 +1327,7 @@ void init_TE(void)
            PyDict_SetItemString(d, "Error", TE_Error) != 0)
                return;
        TE_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&TE_Type) < 0) return;
        Py_INCREF(&TE_Type);
        PyModule_AddObject(m, "TE", (PyObject *)&TE_Type);
        /* Backward-compatible name */
index 85159e5c487bb2f986b6830d4a6c096e28058e77..f05e467b0b19fc0b72436d160f4c7a2b7dbcc71a 100644 (file)
@@ -42,15 +42,15 @@ static PyObject *ExistingwasteObj_New(WEReference);
 /*
 ** Parse/generate TextStyle records
 */
-static
-PyObject *TextStyle_New(TextStylePtr itself)
+static PyObject *
+TextStyle_New(TextStylePtr itself)
 {
 
        return Py_BuildValue("lllO&", (long)itself->tsFont, (long)itself->tsFace, (long)itself->tsSize, QdRGB_New,
                                &itself->tsColor);
 }
 
-static
+static int
 TextStyle_Convert(PyObject *v, TextStylePtr p_itself)
 {
        long font, face, size;
@@ -66,8 +66,8 @@ TextStyle_Convert(PyObject *v, TextStylePtr p_itself)
 /*
 ** Parse/generate RunInfo records
 */
-static
-PyObject *RunInfo_New(WERunInfo *itself)
+static PyObject *
+RunInfo_New(WERunInfo *itself)
 {
 
        return Py_BuildValue("llhhO&O&", itself->runStart, itself->runEnd, itself->runHeight,
@@ -87,7 +87,7 @@ LongRect_New(LongRect *r)
        return Py_BuildValue("(llll)", r->left, r->top, r->right, r->bottom);
 }
 
-
+int
 LongPt_Convert(PyObject *v, LongPt *p)
 {
        return PyArg_Parse(v, "(ll)", &p->h, &p->v);
@@ -146,8 +146,12 @@ my_new_handler(Point *objectSize, WEObjectReference objref)
                if (!PyMac_GetPoint(rv, objectSize) )
                        err = errAECoercionFail;
        }
-       if ( args ) Py_DECREF(args);
-       if ( rv ) Py_DECREF(rv);
+       if ( args ) {
+               Py_DECREF(args);
+       }
+       if ( rv ) {
+               Py_DECREF(rv);
+       }
        return err;
 }
 
@@ -159,8 +163,12 @@ my_dispose_handler(WEObjectReference objref)
        
        args=Py_BuildValue("(O&)", WEOObj_New, objref);
        err = any_handler(weDisposeHandler, objref, args, &rv);
-       if ( args ) Py_DECREF(args);
-       if ( rv ) Py_DECREF(rv);
+       if ( args ) {
+               Py_DECREF(args);
+       }
+       if ( rv ) {
+               Py_DECREF(rv);
+       }
        return err;
 }
 
@@ -172,8 +180,12 @@ my_draw_handler(const Rect *destRect, WEObjectReference objref)
        
        args=Py_BuildValue("O&O&", PyMac_BuildRect, destRect, WEOObj_New, objref);
        err = any_handler(weDrawHandler, objref, args, &rv);
-       if ( args ) Py_DECREF(args);
-       if ( rv ) Py_DECREF(rv);
+       if ( args ) {
+               Py_DECREF(args);
+       }
+       if ( rv ) {
+               Py_DECREF(rv);
+       }
        return err;
 }
 
@@ -192,8 +204,12 @@ my_click_handler(Point hitPt, EventModifiers modifiers,
                retvalue = PyInt_AsLong(rv);
        else
                retvalue = 0;
-       if ( args ) Py_DECREF(args);
-       if ( rv ) Py_DECREF(rv);
+       if ( args ) {
+               Py_DECREF(args);
+       }
+       if ( rv ) {
+               Py_DECREF(rv);
+       }
        return retvalue;
 }
                
@@ -238,7 +254,7 @@ int WEOObj_Convert(PyObject *v, WEObjectReference *p_itself)
 static void WEOObj_dealloc(WEOObject *self)
 {
        /* Cleanup of self->ob_itself goes here */
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *WEOObj_WEGetObjectType(WEOObject *_self, PyObject *_args)
@@ -492,7 +508,7 @@ int wasteObj_Convert(PyObject *v, WEReference *p_itself)
 static void wasteObj_dealloc(wasteObject *self)
 {
        WEDispose(self->ob_itself);
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *wasteObj_WEGetText(wasteObject *_self, PyObject *_args)
@@ -2441,7 +2457,8 @@ static PyObject *waste_STDObjectHandlers(PyObject *_self, PyObject *_args)
                                        (UniversalProcPtr) NewWEClickObjectProc(HandleClickSound), NULL)) != noErr)
                        goto cleanup;
                Py_INCREF(Py_None);
-               return Py_None;
+               _res = Py_None;
+               return _res;
                
        cleanup:
                return PyMac_Error(err);
@@ -2483,7 +2500,8 @@ static PyObject *waste_WEInstallObjectHandler(PyObject *_self, PyObject *_args)
                err = WEInstallObjectHandler(objectType, selector, handler, we);
                if ( err ) return PyMac_Error(err);
                Py_INCREF(Py_None);
-               return Py_None;
+               _res = Py_None;
+               return _res;
 
 }
 
@@ -2555,12 +2573,14 @@ void initwaste(void)
            PyDict_SetItemString(d, "Error", waste_Error) != 0)
                return;
        WEO_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&WEO_Type) < 0) return;
        Py_INCREF(&WEO_Type);
        PyModule_AddObject(m, "WEO", (PyObject *)&WEO_Type);
        /* Backward-compatible name */
        Py_INCREF(&WEO_Type);
        PyModule_AddObject(m, "WEOType", (PyObject *)&WEO_Type);
        waste_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&waste_Type) < 0) return;
        Py_INCREF(&waste_Type);
        PyModule_AddObject(m, "waste", (PyObject *)&waste_Type);
        /* Backward-compatible name */
index 2e165a93d27e52061dcedea972dbaeca78844da2..e983b154ce6914ae5145c374eb1ad9f24831b026 100644 (file)
@@ -82,15 +82,15 @@ static PyObject *ExistingwasteObj_New(WEReference);
 /*
 ** Parse/generate TextStyle records
 */
-static
-PyObject *TextStyle_New(TextStylePtr itself)
+static PyObject *
+TextStyle_New(TextStylePtr itself)
 {
 
        return Py_BuildValue("lllO&", (long)itself->tsFont, (long)itself->tsFace, (long)itself->tsSize, QdRGB_New,
                                &itself->tsColor);
 }
 
-static
+static int
 TextStyle_Convert(PyObject *v, TextStylePtr p_itself)
 {
        long font, face, size;
@@ -106,8 +106,8 @@ TextStyle_Convert(PyObject *v, TextStylePtr p_itself)
 /*
 ** Parse/generate RunInfo records
 */
-static
-PyObject *RunInfo_New(WERunInfo *itself)
+static PyObject *
+RunInfo_New(WERunInfo *itself)
 {
 
        return Py_BuildValue("llhhO&O&", itself->runStart, itself->runEnd, itself->runHeight,
@@ -127,7 +127,7 @@ LongRect_New(LongRect *r)
        return Py_BuildValue("(llll)", r->left, r->top, r->right, r->bottom);
 }
 
-
+int
 LongPt_Convert(PyObject *v, LongPt *p)
 {
        return PyArg_Parse(v, "(ll)", &p->h, &p->v);
@@ -186,8 +186,12 @@ my_new_handler(Point *objectSize, WEObjectReference objref)
                if (!PyMac_GetPoint(rv, objectSize) )
                        err = errAECoercionFail;
        }
-       if ( args ) Py_DECREF(args);
-       if ( rv ) Py_DECREF(rv);
+       if ( args ) {
+               Py_DECREF(args);
+       }
+       if ( rv ) {
+               Py_DECREF(rv);
+       }
        return err;
 }
 
@@ -199,8 +203,12 @@ my_dispose_handler(WEObjectReference objref)
        
        args=Py_BuildValue("(O&)", WEOObj_New, objref);
        err = any_handler(weDisposeHandler, objref, args, &rv);
-       if ( args ) Py_DECREF(args);
-       if ( rv ) Py_DECREF(rv);
+       if ( args ) {
+               Py_DECREF(args);
+       }
+       if ( rv ) {
+               Py_DECREF(rv);
+       }
        return err;
 }
 
@@ -212,8 +220,12 @@ my_draw_handler(const Rect *destRect, WEObjectReference objref)
        
        args=Py_BuildValue("O&O&", PyMac_BuildRect, destRect, WEOObj_New, objref);
        err = any_handler(weDrawHandler, objref, args, &rv);
-       if ( args ) Py_DECREF(args);
-       if ( rv ) Py_DECREF(rv);
+       if ( args ) {
+               Py_DECREF(args);
+       }
+       if ( rv ) {
+               Py_DECREF(rv);
+       }
        return err;
 }
 
@@ -232,8 +244,12 @@ my_click_handler(Point hitPt, EventModifiers modifiers,
                retvalue = PyInt_AsLong(rv);
        else
                retvalue = 0;
-       if ( args ) Py_DECREF(args);
-       if ( rv ) Py_DECREF(rv);
+       if ( args ) {
+               Py_DECREF(args);
+       }
+       if ( rv ) {
+               Py_DECREF(rv);
+       }
        return retvalue;
 }
                
@@ -359,7 +375,8 @@ stdhandlers_body = """
                                (UniversalProcPtr) NewWEClickObjectProc(HandleClickSound), NULL)) != noErr)
                goto cleanup;
        Py_INCREF(Py_None);
-       return Py_None;
+       _res = Py_None;
+       return _res;
        
 cleanup:
        return PyMac_Error(err);
@@ -397,7 +414,8 @@ inshandler_body = """
        err = WEInstallObjectHandler(objectType, selector, handler, we);
        if ( err ) return PyMac_Error(err);
        Py_INCREF(Py_None);
-       return Py_None;
+       _res = Py_None;
+       return _res;
 """
 
 stdhand = ManualGenerator("STDObjectHandlers", stdhandlers_body)
index c0401e0f16b9e52ecd0f75d7283c01af5838213c..258845d986799f87adcb21accb55cf1cfb57800a 100644 (file)
@@ -110,7 +110,7 @@ static void WinObj_dealloc(WindowObject *self)
        }
        self->ob_itself = NULL;
        self->ob_freeit = NULL;
-       PyObject_Del(self);
+       self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *WinObj_GetWindowOwnerCount(WindowObject *_self, PyObject *_args)
@@ -3223,6 +3223,7 @@ void init_Win(void)
            PyDict_SetItemString(d, "Error", Win_Error) != 0)
                return;
        Window_Type.ob_type = &PyType_Type;
+       if (PyType_Ready(&Window_Type) < 0) return;
        Py_INCREF(&Window_Type);
        PyModule_AddObject(m, "Window", (PyObject *)&Window_Type);
        /* Backward-compatible name */