FFI: FFI-Tools-mt.16.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

FFI: FFI-Tools-mt.16.mcz

commits-2
Marcel Taeumel uploaded a new version of FFI-Tools to project FFI:
http://source.squeak.org/FFI/FFI-Tools-mt.16.mcz

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

Name: FFI-Tools-mt.16
Author: mt
Time: 12 June 2020, 4:14:04.573744 pm
UUID: 10f4bfcc-c8d7-2045-9a7e-7bac630fe09e
Ancestors: FFI-Tools-mt.15

Re-use C type names when printing a typedef for an external type's compiledSpec.

=============== Diff against FFI-Tools-mt.15 ===============

Item was changed:
  ----- Method: ExternalType>>printAtomicType:on: (in category '*FFI-Tools-printing') -----
  printAtomicType: spec on: aStream
+
+ | atomicTypeName atomicType |
+ atomicTypeName := AtomicTypeNames at: ((spec bitAnd: FFIAtomicTypeMask) bitShift: FFIAtomicTypeShift negated).
+ atomicType := AtomicTypes at: atomicTypeName.
+ (spec anyMask: FFIFlagPointer)
+ ifTrue: [atomicType := atomicType asPointerType].
+
+ aStream nextPutAll: (ExternalPoolReadWriter cTypeNameFor: atomicType).
+ atomicType isPointerType
+ ifFalse: [aStream space].!
- self assert: (spec anyMask: FFIFlagAtomic).
- aStream nextPutAll: (#( 'void' 'unsigned char' 'unsigned char' 'signed char'
- 'unsigned short' 'short' 'unsigned long' 'long'
- 'unsigned long long' 'long long' 'char' 'signed char'
- 'float' 'double') at: ((spec bitAnd: FFIAtomicTypeMask) bitShift: FFIAtomicTypeShift negated) + 1).
- aStream space.
- (spec anyMask: FFIFlagPointer) ifTrue:
- [aStream nextPut: $*]!