ExternalLibraryFunction.st
branchjv
changeset 17742 3fef0ed4c2d5
parent 17736 26cfea63471d
child 17747 f978415ba3d3
--- a/ExternalLibraryFunction.st	Sun Dec 27 19:45:23 2009 +0000
+++ b/ExternalLibraryFunction.st	Sun Dec 27 20:16:54 2009 +0000
@@ -585,9 +585,9 @@
 
 ffiTypeSymbolForType:aType
     "map type to one of the ffi-supported ones:
-        sint8, sint16, sint32, sint64
-        uint8, uint16, uint32, uint64
-        bool void pointer handle
+	sint8, sint16, sint32, sint64
+	uint8, uint16, uint32, uint64
+	bool void pointer handle
     "
 
     aType == #sint8           ifTrue:[^ aType ].
@@ -645,17 +645,17 @@
     aType == #unsigned        ifTrue:[^ #uint ].
 
     (aType isString or:[aType isSymbol]) ifFalse:[
-        CType isNil ifTrue:[
-            self error:'unknown type'.
-        ].
-        ^ aType typeSymbol.
+	CType isNil ifTrue:[
+	    self error:'unknown type'.
+	].
+	^ aType typeSymbol.
     ].
 
     (aType endsWith:'*') ifTrue:[
-        ^ #pointer.
+	^ #pointer.
     ].
     (aType endsWith:'Pointer') ifTrue:[
-        ^ #pointer.
+	^ #pointer.
     ].
     ^ aType
 
@@ -1198,6 +1198,10 @@
 	    } else if (__isByteArrayLike(arg)) {
 		if (async == true) goto badArgForAsyncCall;
 		__argValues[i].pointerVal = (void *)(__byteArrayVal(arg));
+	    } else if (__isWordArray(arg) || __isSignedWordArray(arg)
+		    || __isIntegerArray(arg) || __isSignedIntegerArray(arg)) {
+		if (async == true) goto badArgForAsyncCall;
+		__argValues[i].pointerVal = (void *)(__integerArrayVal(arg));
 	    } else if (__isFloatArray(arg)) {
 		if (async == true) goto badArgForAsyncCall;
 		__argValues[i].pointerVal = (void *)(__FloatArrayInstPtr(arg)->f_element);
@@ -1439,12 +1443,13 @@
 !ExternalLibraryFunction class methodsFor:'documentation'!
 
 version
-    ^ '$Id: ExternalLibraryFunction.st 10482 2009-12-04 20:30:11Z vranyj1 $'
+    ^ '$Id: ExternalLibraryFunction.st 10489 2009-12-27 20:16:54Z vranyj1 $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/ExternalLibraryFunction.st,v 1.74 2009/12/02 16:16:32 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/ExternalLibraryFunction.st,v 1.75 2009/12/04 20:00:53 cg Exp §'
 ! !
 
 ExternalLibraryFunction initialize!
 
+