[Python-checkins] CVS: python/dist/src/Tools/bgen/bgen macsupport.py,1.26,1.27 bgenType.py,1.7,1.8

Jack Jansen jackjansen@users.sourceforge.net
Mon, 18 Mar 2002 07:24:24 -0800


Update of /cvsroot/python/python/dist/src/Tools/bgen/bgen
In directory usw-pr-cvs1:/tmp/cvs-serv6252

Modified Files:
	macsupport.py bgenType.py 
Log Message:
Some structures should be passed to Py_BuildValue by reference, not by value,
notably FSSpec and FSRef objects. First half of fix for #531291.

2.2.1 candidate.

Index: macsupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/bgen/bgen/macsupport.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** macsupport.py	1 Jan 2002 22:39:58 -0000	1.26
--- macsupport.py	18 Mar 2002 15:24:22 -0000	1.27
***************
*** 47,53 ****
  # File System Specifications
  FSSpec_ptr = OpaqueType("FSSpec", "PyMac_BuildFSSpec", "PyMac_GetFSSpec")
! FSSpec = OpaqueByValueType("FSSpec", "PyMac_BuildFSSpec", "PyMac_GetFSSpec")
  FSRef_ptr = OpaqueType("FSRef", "PyMac_BuildFSRef", "PyMac_GetFSRef")
! FSRef = OpaqueByValueType("FSRef", "PyMac_BuildFSRef", "PyMac_GetFSRef")
  
  # OSType and ResType: 4-byte character strings
--- 47,53 ----
  # File System Specifications
  FSSpec_ptr = OpaqueType("FSSpec", "PyMac_BuildFSSpec", "PyMac_GetFSSpec")
! FSSpec = OpaqueByValueStructType("FSSpec", "PyMac_BuildFSSpec", "PyMac_GetFSSpec")
  FSRef_ptr = OpaqueType("FSRef", "PyMac_BuildFSRef", "PyMac_GetFSRef")
! FSRef = OpaqueByValueStructType("FSRef", "PyMac_BuildFSRef", "PyMac_GetFSRef")
  
  # OSType and ResType: 4-byte character strings

Index: bgenType.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/bgen/bgen/bgenType.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** bgenType.py	1 Jan 2002 22:40:02 -0000	1.7
--- bgenType.py	18 Mar 2002 15:24:22 -0000	1.8
***************
*** 234,237 ****
--- 234,245 ----
  	def mkvalueArgs(self, name):
  		return "%s, %s" % (self.new, name)
+ 		
+ class OpaqueByValueStructType(OpaqueByValueType):
+ 	"""Similar to OpaqueByValueType, but we also pass this to mkvalue by
+ 	address, in stead of by value.
+ 	"""
+ 
+ 	def mkvalueArgs(self, name):
+ 		return "%s, &%s" % (self.new, name)