[Python-checkins] python/dist/src/Mac/Modules/cf _CFmodule.c,1.18,1.19 cfsupport.py,1.18,1.19

jackjansen@users.sourceforge.net jackjansen@users.sourceforge.net
Mon, 23 Dec 2002 14:35:49 -0800


Update of /cvsroot/python/python/dist/src/Mac/Modules/cf
In directory sc8-pr-cvs1:/tmp/cvs-serv19646

Modified Files:
	_CFmodule.c cfsupport.py 
Log Message:
- Various tweaks to forestall compiler warnings.


Index: _CFmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/cf/_CFmodule.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** _CFmodule.c	19 Dec 2002 21:24:29 -0000	1.18
--- _CFmodule.c	23 Dec 2002 22:35:38 -0000	1.19
***************
*** 172,176 ****
  		self->ob_freeit((CFTypeRef)self->ob_itself);
  	}
! 	PyObject_Del(self);
  }
  
--- 172,176 ----
  		self->ob_freeit((CFTypeRef)self->ob_itself);
  	}
! 	PyObject_Free((PyObject *)self);
  }
  
***************
*** 355,359 ****
  	PyObject *_res = NULL;
  
! 	return PyCF_CF2Python(_self->ob_itself);
  
  }
--- 355,360 ----
  	PyObject *_res = NULL;
  
! 	_res = PyCF_CF2Python(_self->ob_itself);
! 	return _res;
  
  }
***************
*** 407,411 ****
  {
  	char buf[100];
! 	sprintf(buf, "<CFTypeRef type-%d object at 0x%8.8x for 0x%8.8x>", CFGetTypeID(self->ob_itself), (unsigned)self, (unsigned)self->ob_itself);
  	return PyString_FromString(buf);
  }
--- 408,412 ----
  {
  	char buf[100];
! 	sprintf(buf, "<CFTypeRef type-%d object at 0x%8.8x for 0x%8.8x>", (int)CFGetTypeID(self->ob_itself), (unsigned)self, (unsigned)self->ob_itself);
  	return PyString_FromString(buf);
  }
***************
*** 486,490 ****
  		self->ob_freeit((CFTypeRef)self->ob_itself);
  	}
! 	PyObject_Del(self);
  }
  
--- 487,491 ----
  		self->ob_freeit((CFTypeRef)self->ob_itself);
  	}
! 	PyObject_Free((PyObject *)self);
  }
  
***************
*** 642,646 ****
  		self->ob_freeit((CFTypeRef)self->ob_itself);
  	}
! 	PyObject_Del(self);
  }
  
--- 643,647 ----
  		self->ob_freeit((CFTypeRef)self->ob_itself);
  	}
! 	PyObject_Free((PyObject *)self);
  }
  
***************
*** 827,831 ****
  		self->ob_freeit((CFTypeRef)self->ob_itself);
  	}
! 	PyObject_Del(self);
  }
  
--- 828,832 ----
  		self->ob_freeit((CFTypeRef)self->ob_itself);
  	}
! 	PyObject_Free((PyObject *)self);
  }
  
***************
*** 965,969 ****
  		self->ob_freeit((CFTypeRef)self->ob_itself);
  	}
! 	PyObject_Del(self);
  }
  
--- 966,970 ----
  		self->ob_freeit((CFTypeRef)self->ob_itself);
  	}
! 	PyObject_Free((PyObject *)self);
  }
  
***************
*** 1093,1097 ****
  		self->ob_freeit((CFTypeRef)self->ob_itself);
  	}
! 	PyObject_Del(self);
  }
  
--- 1094,1098 ----
  		self->ob_freeit((CFTypeRef)self->ob_itself);
  	}
! 	PyObject_Free((PyObject *)self);
  }
  
***************
*** 1263,1267 ****
  		self->ob_freeit((CFTypeRef)self->ob_itself);
  	}
! 	PyObject_Del(self);
  }
  
--- 1264,1268 ----
  		self->ob_freeit((CFTypeRef)self->ob_itself);
  	}
! 	PyObject_Free((PyObject *)self);
  }
  
***************
*** 1486,1490 ****
  		self->ob_freeit((CFTypeRef)self->ob_itself);
  	}
! 	PyObject_Del(self);
  }
  
--- 1487,1491 ----
  		self->ob_freeit((CFTypeRef)self->ob_itself);
  	}
! 	PyObject_Free((PyObject *)self);
  }
  
***************
*** 2158,2162 ****
  		self->ob_freeit((CFTypeRef)self->ob_itself);
  	}
! 	PyObject_Del(self);
  }
  
--- 2159,2163 ----
  		self->ob_freeit((CFTypeRef)self->ob_itself);
  	}
! 	PyObject_Free((PyObject *)self);
  }
  
***************
*** 2491,2495 ****
  		self->ob_freeit((CFTypeRef)self->ob_itself);
  	}
! 	PyObject_Del(self);
  }
  
--- 2492,2496 ----
  		self->ob_freeit((CFTypeRef)self->ob_itself);
  	}
! 	PyObject_Free((PyObject *)self);
  }
  
***************
*** 4168,4172 ****
  		return Py_BuildValue("O&", CFURLRefObj_New, rv);
  
! 	return Py_BuildValue("O&", CFTypeRefObj_New, rv);
  
  }
--- 4169,4174 ----
  		return Py_BuildValue("O&", CFURLRefObj_New, rv);
  
! 	_res = Py_BuildValue("O&", CFTypeRefObj_New, rv);
! 	return _res;
  
  }
***************
*** 4325,4328 ****
--- 4327,4331 ----
  		return;
  	CFTypeRef_Type.ob_type = &PyType_Type;
+ 	if (PyType_Ready(&CFTypeRef_Type) < 0) return;
  	Py_INCREF(&CFTypeRef_Type);
  	PyModule_AddObject(m, "CFTypeRef", (PyObject *)&CFTypeRef_Type);
***************
*** 4331,4334 ****
--- 4334,4338 ----
  	PyModule_AddObject(m, "CFTypeRefType", (PyObject *)&CFTypeRef_Type);
  	CFArrayRef_Type.ob_type = &PyType_Type;
+ 	if (PyType_Ready(&CFArrayRef_Type) < 0) return;
  	Py_INCREF(&CFArrayRef_Type);
  	PyModule_AddObject(m, "CFArrayRef", (PyObject *)&CFArrayRef_Type);
***************
*** 4337,4340 ****
--- 4341,4345 ----
  	PyModule_AddObject(m, "CFArrayRefType", (PyObject *)&CFArrayRef_Type);
  	CFMutableArrayRef_Type.ob_type = &PyType_Type;
+ 	if (PyType_Ready(&CFMutableArrayRef_Type) < 0) return;
  	Py_INCREF(&CFMutableArrayRef_Type);
  	PyModule_AddObject(m, "CFMutableArrayRef", (PyObject *)&CFMutableArrayRef_Type);
***************
*** 4343,4346 ****
--- 4348,4352 ----
  	PyModule_AddObject(m, "CFMutableArrayRefType", (PyObject *)&CFMutableArrayRef_Type);
  	CFDictionaryRef_Type.ob_type = &PyType_Type;
+ 	if (PyType_Ready(&CFDictionaryRef_Type) < 0) return;
  	Py_INCREF(&CFDictionaryRef_Type);
  	PyModule_AddObject(m, "CFDictionaryRef", (PyObject *)&CFDictionaryRef_Type);
***************
*** 4349,4352 ****
--- 4355,4359 ----
  	PyModule_AddObject(m, "CFDictionaryRefType", (PyObject *)&CFDictionaryRef_Type);
  	CFMutableDictionaryRef_Type.ob_type = &PyType_Type;
+ 	if (PyType_Ready(&CFMutableDictionaryRef_Type) < 0) return;
  	Py_INCREF(&CFMutableDictionaryRef_Type);
  	PyModule_AddObject(m, "CFMutableDictionaryRef", (PyObject *)&CFMutableDictionaryRef_Type);
***************
*** 4355,4358 ****
--- 4362,4366 ----
  	PyModule_AddObject(m, "CFMutableDictionaryRefType", (PyObject *)&CFMutableDictionaryRef_Type);
  	CFDataRef_Type.ob_type = &PyType_Type;
+ 	if (PyType_Ready(&CFDataRef_Type) < 0) return;
  	Py_INCREF(&CFDataRef_Type);
  	PyModule_AddObject(m, "CFDataRef", (PyObject *)&CFDataRef_Type);
***************
*** 4361,4364 ****
--- 4369,4373 ----
  	PyModule_AddObject(m, "CFDataRefType", (PyObject *)&CFDataRef_Type);
  	CFMutableDataRef_Type.ob_type = &PyType_Type;
+ 	if (PyType_Ready(&CFMutableDataRef_Type) < 0) return;
  	Py_INCREF(&CFMutableDataRef_Type);
  	PyModule_AddObject(m, "CFMutableDataRef", (PyObject *)&CFMutableDataRef_Type);
***************
*** 4367,4370 ****
--- 4376,4380 ----
  	PyModule_AddObject(m, "CFMutableDataRefType", (PyObject *)&CFMutableDataRef_Type);
  	CFStringRef_Type.ob_type = &PyType_Type;
+ 	if (PyType_Ready(&CFStringRef_Type) < 0) return;
  	Py_INCREF(&CFStringRef_Type);
  	PyModule_AddObject(m, "CFStringRef", (PyObject *)&CFStringRef_Type);
***************
*** 4373,4376 ****
--- 4383,4387 ----
  	PyModule_AddObject(m, "CFStringRefType", (PyObject *)&CFStringRef_Type);
  	CFMutableStringRef_Type.ob_type = &PyType_Type;
+ 	if (PyType_Ready(&CFMutableStringRef_Type) < 0) return;
  	Py_INCREF(&CFMutableStringRef_Type);
  	PyModule_AddObject(m, "CFMutableStringRef", (PyObject *)&CFMutableStringRef_Type);
***************
*** 4379,4382 ****
--- 4390,4394 ----
  	PyModule_AddObject(m, "CFMutableStringRefType", (PyObject *)&CFMutableStringRef_Type);
  	CFURLRef_Type.ob_type = &PyType_Type;
+ 	if (PyType_Ready(&CFURLRef_Type) < 0) return;
  	Py_INCREF(&CFURLRef_Type);
  	PyModule_AddObject(m, "CFURLRef", (PyObject *)&CFURLRef_Type);

Index: cfsupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/cf/cfsupport.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** cfsupport.py	13 May 2002 21:21:49 -0000	1.18
--- cfsupport.py	23 Dec 2002 22:35:38 -0000	1.19
***************
*** 262,266 ****
  		OutLbrace()
  		Output("char buf[100];")
! 		Output("""sprintf(buf, "<CFTypeRef type-%%d object at 0x%%8.8x for 0x%%8.8x>", CFGetTypeID(self->ob_itself), (unsigned)self, (unsigned)self->ob_itself);""")
  		Output("return PyString_FromString(buf);")
  		OutRbrace()
--- 262,266 ----
  		OutLbrace()
  		Output("char buf[100];")
! 		Output("""sprintf(buf, "<CFTypeRef type-%%d object at 0x%%8.8x for 0x%%8.8x>", (int)CFGetTypeID(self->ob_itself), (unsigned)self, (unsigned)self->ob_itself);""")
  		Output("return PyString_FromString(buf);")
  		OutRbrace()
***************
*** 559,563 ****
  # Convert CF objects to Python objects
  toPython_body = """
! return PyCF_CF2Python(_self->ob_itself);
  """
  
--- 559,564 ----
  # Convert CF objects to Python objects
  toPython_body = """
! _res = PyCF_CF2Python(_self->ob_itself);
! return _res;
  """
  
***************
*** 583,587 ****
  	return Py_BuildValue("O&", CFURLRefObj_New, rv);
  
! return Py_BuildValue("O&", CFTypeRefObj_New, rv);
  """
  f = ManualGenerator("toCF", toCF_body);
--- 584,589 ----
  	return Py_BuildValue("O&", CFURLRefObj_New, rv);
  
! _res = Py_BuildValue("O&", CFTypeRefObj_New, rv);
! return _res;
  """
  f = ManualGenerator("toCF", toCF_body);