Commits

Ronald Oussoren  committed 1432f5b

- Fix compile-time warnings in Modules/{AppKit,Foundation}
- Fix compile-error with Python 2.2.
"I shall not perform obviously correct changes just before checking in" * 100
Sorry about this.

  • Participants
  • Parent commits 95cbd82

Comments (0)

Files changed (4)

File pyobjc/Modules/AppKit/_AppKit.m

 	NS_DURING
 		depths = NSAvailableWindowDepths();
 	NS_HANDLER
+		depths = NULL;
 		ObjCErr_FromObjC(localException);
 	NS_ENDHANDLER
 	if (PyErr_Occurred()) return NULL;
 				NULL);
 		}
 	NS_HANDLER
+		res = 0;
 		ObjCErr_FromObjC(localException);
 	NS_ENDHANDLER
 

File pyobjc/Modules/Foundation/_Foundation.m

 	NS_DURING
 		oc_result = NSFileTypeForHFSTypeCode(hfsTypeCode);
 	NS_HANDLER
+		oc_result = NULL;
 		ObjCErr_FromObjC(localException);
 	NS_ENDHANDLER
 
 	NS_DURING
 		hfsTypeCode = NSHFSTypeCodeFromFileType(fileType);
 	NS_HANDLER
+		hfsTypeCode = 0;
 		ObjCErr_FromObjC(localException);
 	NS_ENDHANDLER
 

File pyobjc/Modules/objc/objc-class.m

 
 #if PY_VERSION_HEX < 0x020300A2 /* Python 2.2 and early 2.3 alpha's */
 
-struct {
+typedef struct {
 	Class	  class;
 	PyObject* sel_to_py;
 	int	  method_magic;
 get_class_info(PyObject* class)
 {	
 	PyObject*          item;
-	struct class_info* info;
+	PyObjC_class_info* info;
 
 	if (class_to_objc == NULL) {
 		class_to_objc = NSCreateMapTable(ObjC_PyObjectKeyCallBacks,

File pyobjc/Modules/objc/objc-object.m

 	{ 0, 0, 0, 0, 0 }
 };
 
-PyObjCClassObject PyObjCObject_Type = {
+PyObjCClassObject PyObjCObject_Type = {{
 	PyObject_HEAD_INIT(&PyObjCClass_Type)
 	0,					/* ob_size */
 	"objc_object",				/* tp_name */
 	PyType_GenericAlloc,			/* tp_alloc */
 	object_new,				/* tp_new */
 	0,		        		/* tp_free */
-};
+}};