[squeak-dev] FFI Inbox: FFI-Pools-eem.39.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Sep 12 06:39:00 UTC 2021


Eliot Miranda uploaded a new version of FFI-Pools to project FFI Inbox:
http://source.squeak.org/FFIinbox/FFI-Pools-eem.39.mcz

==================== Summary ====================

Name: FFI-Pools-eem.39
Author: eem
Time: 11 September 2021, 11:37:52.305792 pm
UUID: 1f847d28-2285-4c34-87c9-ca1cd796f09a
Ancestors: FFI-Pools-mt.38

Revised suggestion for adding 16 & 32 bit character types that preserves backwards compatibility.

=============== Diff against FFI-Pools-mt.38 ===============

Item was changed:
  SharedPool subclass: #FFIConstants
  	instanceVariableNames: ''
+ 	classVariableNames: 'FFIAtomicTypeMask FFIAtomicTypeShift FFICallFlagThreaded FFICallTypeApi FFICallTypeCDecl FFICallTypesMask FFIErrorAddressNotFound FFIErrorAttemptToPassVoid FFIErrorBadAddress FFIErrorBadArg FFIErrorBadArgs FFIErrorBadAtomicType FFIErrorBadExternalFunction FFIErrorBadExternalLibrary FFIErrorBadReturn FFIErrorCallFrameTooBig FFIErrorCallType FFIErrorCoercionFailed FFIErrorGenericError FFIErrorIntAsPointer FFIErrorInvalidPointer FFIErrorModuleNotFound FFIErrorNoModule FFIErrorNotFunction FFIErrorStructSize FFIErrorWrongType FFIFlagAtomic FFIFlagPointer FFIFlagStructure FFINoCalloutAvailable FFIStructSizeMask FFITypeBool FFITypeDoubleFloat FFITypeOLDSignedChar8 FFITypeOLDUnsignedChar8 FFITypeSignedChar16 FFITypeSignedChar32 FFITypeSignedChar8 FFITypeSignedInt16 FFITypeSignedInt32 FFITypeSignedInt64 FFITypeSignedInt8 FFITypeSingleFloat FFITypeUnsignedChar16 FFITypeUnsignedChar32 FFITypeUnsignedChar8 FFITypeUnsignedInt16 FFITypeUnsignedInt32 FFITypeUnsignedInt64 FFI
 TypeUnsignedInt8 FFITypeVoid'
- 	classVariableNames: 'FFIAtomicTypeMask FFIAtomicTypeShift FFICallFlagThreaded FFICallTypeApi FFICallTypeCDecl FFICallTypesMask FFIErrorAddressNotFound FFIErrorAttemptToPassVoid FFIErrorBadAddress FFIErrorBadArg FFIErrorBadArgs FFIErrorBadAtomicType FFIErrorBadExternalFunction FFIErrorBadExternalLibrary FFIErrorBadReturn FFIErrorCallFrameTooBig FFIErrorCallType FFIErrorCoercionFailed FFIErrorGenericError FFIErrorIntAsPointer FFIErrorInvalidPointer FFIErrorModuleNotFound FFIErrorNoModule FFIErrorNotFunction FFIErrorStructSize FFIErrorWrongType FFIFlagAtomic FFIFlagPointer FFIFlagStructure FFINoCalloutAvailable FFIStructSizeMask FFITypeBool FFITypeDoubleFloat FFITypeSignedChar16 FFITypeSignedChar32 FFITypeSignedChar8 FFITypeSignedInt16 FFITypeSignedInt32 FFITypeSignedInt64 FFITypeSignedInt8 FFITypeSingleFloat FFITypeUnsignedChar16 FFITypeUnsignedChar32 FFITypeUnsignedChar8 FFITypeUnsignedInt16 FFITypeUnsignedInt32 FFITypeUnsignedInt64 FFITypeUnsignedInt8 FFITypeVoid'
  	poolDictionaries: ''
  	category: 'FFI-Pools'!
  
  !FFIConstants commentStamp: 'TorstenBergmann 4/27/2017 11:02' prior: 0!
  Constants definitions for FFI!

Item was changed:
  ----- Method: FFIConstants class>>initializeTypeConstants_v2 (in category 'pool initialization') -----
  initializeTypeConstants_v2
+ 	<pluginVersion: 1>
+ 
- 	<pluginVersion: 2>
- 	
- 	self halt. "Not fully specified and still to be discussed."
- 	
  	"type void"
  	FFITypeVoid := 0.
  
  	"type bool"
  	FFITypeBool := 1.
  
  	"basic integer types.
  	note: (integerType anyMask: 1) = integerType isSigned"
  
  	FFITypeUnsignedInt8 := 2.
  	FFITypeSignedInt8 := 3.
  	FFITypeUnsignedInt16 := 4.
  	FFITypeSignedInt16 := 5.
  	FFITypeUnsignedInt32 := 6.
  	FFITypeSignedInt32 := 7.
  	FFITypeUnsignedInt64 := 8.
  	FFITypeSignedInt64 := 9.
  
+ 	"original character types
+ 	 note: isCharacterType ^type >> 1 >= 5 and: [(type >> 1) odd]"
- 	"special integer types"
  	FFITypeUnsignedChar8 := 10.
+ 	FFITypeSignedChar8 := 11. "N.B. misnomer!!"
- 	FFITypeSignedChar8 := 11.
- 	FFITypeUnsignedChar16 := 12.
- 	FFITypeSignedChar16 := 13.
- 	FFITypeUnsignedChar32 := 14.
- 	FFITypeSignedChar32 := 15.
  
+ 	"float types
+ 	 note: isFloatType ^type >> 1 = 6"
+ 	FFITypeSingleFloat := 12.
+ 	FFITypeDoubleFloat := 13.
- 	"float types"
- 	FFITypeSingleFloat := 16.
- 	FFITypeDoubleFloat := 17.
  
+ 	"new character types
+ 	 note: isCharacterType ^type >> 1 >= 5 and: [(type >> 1) odd]"
+ 	FFITypeUnsignedChar16 := 14.
+ 	FFITypeUnsignedChar32 := 15.
+ 
  	"type flags"
  	FFIFlagAtomic := 16r40000. "type is atomic"
  	FFIFlagPointer := 16r20000. "type is pointer to base type"
  	FFIFlagStructure := 16r10000. "baseType is structure of 64k length"
  	FFIStructSizeMask := 16rFFFF. "mask for max size of structure"
  	FFIAtomicTypeMask := 16r0F000000. "mask for atomic type spec"
  	FFIAtomicTypeShift := 24. "shift for atomic type"
  !



More information about the Squeak-dev mailing list