[PyObjC-svn] r2252 - in trunk/pyobjc/pyobjc-core/Modules/objc: . test

[email protected] Tue, 26 May 2009 09:46:39 -0500
Newsgroups gmane.comp.python.pyobjc.cvs
Message-ID <[email protected]>
Author: ronaldoussoren
Date: Tue May 26 09:46:38 2009
New Revision: 2252

Log:
Work slighty better with 'byref' and 'bycopy' attributes.


Modified:
   trunk/pyobjc/pyobjc-core/Modules/objc/libffi_support.m
   trunk/pyobjc/pyobjc-core/Modules/objc/objc-runtime-compat.h
   trunk/pyobjc/pyobjc-core/Modules/objc/objc_support.m
   trunk/pyobjc/pyobjc-core/Modules/objc/test/testbndl2.m

Modified: trunk/pyobjc/pyobjc-core/Modules/objc/libffi_support.m
==============================================================================
--- trunk/pyobjc/pyobjc-core/Modules/objc/libffi_support.m	(original)
+++ trunk/pyobjc/pyobjc-core/Modules/objc/libffi_support.m	Tue May 26 09:46:38 2009
@@ -337,6 +337,7 @@
 static ffi_type*
 signature_to_ffi_type(const char* argtype)
 {
+	argtype = PyObjCRT_SkipTypeQualifiers(argtype);
 	switch (*argtype) {
 	case _C_VOID: return &ffi_type_void;
 	case _C_ID: return &ffi_type_pointer;

Modified: trunk/pyobjc/pyobjc-core/Modules/objc/objc-runtime-compat.h
==============================================================================
--- trunk/pyobjc/pyobjc-core/Modules/objc/objc-runtime-compat.h	(original)
+++ trunk/pyobjc/pyobjc-core/Modules/objc/objc-runtime-compat.h	Tue May 26 09:46:38 2009
@@ -30,6 +30,7 @@
 #define _C_INOUT    'N'
 #define _C_OUT      'o'
 #define _C_BYCOPY   'O'
+#define _C_BYREF   'R'
 #define _C_ONEWAY   'V'
 #define _C_LNG_LNG   'q'
 #define _C_ULNG_LNG  'Q'

Modified: trunk/pyobjc/pyobjc-core/Modules/objc/objc_support.m
==============================================================================
--- trunk/pyobjc/pyobjc-core/Modules/objc/objc_support.m	(original)
+++ trunk/pyobjc/pyobjc-core/Modules/objc/objc_support.m	Tue May 26 09:46:38 2009
@@ -333,6 +333,7 @@
 			*type == _C_INOUT ||
 			*type == _C_OUT ||
 			*type == _C_BYCOPY ||
+			*type == _C_BYREF ||
 			*type == _C_ONEWAY ||
 			*type == 'O') {
 		type++;
@@ -446,6 +447,7 @@
 	case _C_INOUT:
 	case _C_OUT:
 	case _C_BYCOPY:
+	case _C_BYREF:
 	case _C_ONEWAY:
 
 		/* Just skip the following typespec */
@@ -562,6 +564,7 @@
 	case _C_INOUT:
 	case _C_OUT:
 	case _C_BYCOPY:
+	case _C_BYREF:
 	case _C_ONEWAY:
 
 		/* Just skip the following typespec */
@@ -723,6 +726,7 @@
 	case _C_INOUT:
 	case _C_OUT:
 	case _C_BYCOPY:
+	case _C_BYREF:
 	case _C_ONEWAY:
 		return PyObjCRT_AlignOfType(type+1);
 	
@@ -880,6 +884,7 @@
 	case _C_INOUT:
 	case _C_OUT:
 	case _C_BYCOPY:
+	case _C_BYREF:
 	case _C_ONEWAY:
 		return PyObjCRT_SizeOfType(type+1);
 

Modified: trunk/pyobjc/pyobjc-core/Modules/objc/test/testbndl2.m
==============================================================================
--- trunk/pyobjc/pyobjc-core/Modules/objc/test/testbndl2.m	(original)
+++ trunk/pyobjc/pyobjc-core/Modules/objc/test/testbndl2.m	Tue May 26 09:46:38 2009
@@ -19584,6 +19584,16 @@
 	return res;
 }
 
++(bycopy id)returnByCopy
+{
+	return nil;
+}
+
++(byref id)returnByRef
+{
+	return nil;
+}
+
 
 @end // implementation PyObjC_TestClass2
 

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com