[squeak-dev] FFI: FFI-Kernel-mt.125.mcz

commits at source.squeak.org commits at source.squeak.org
Mon May 3 11:52:05 UTC 2021

Marcel Taeumel uploaded a new version of FFI-Kernel to project FFI:

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

Name: FFI-Kernel-mt.125
Author: mt
Time: 3 May 2021, 1:52:04.145757 pm
UUID: 831195f6-e82e-1f4a-9a73-70b0e085459e
Ancestors: FFI-Kernel-mt.124

Fixes a regression in the print-string for external functions. Adds #typeName to reduce some code duplication.

=============== Diff against FFI-Kernel-mt.124 ===============

Item was changed:
  ----- Method: ExternalFunction>>printOn: (in category 'printing') -----
  printOn: aStream
  		nextPutAll: self callingConventionString; nextPutAll:': '.
  	{ 'threaded' } with: { FFICallFlagThreaded } do:
  		[:modifier :flag|
  		(flags anyMask: flag) ifTrue:
  			[aStream nextPutAll: modifier; space]].
+ 	aStream nextPutAll: argTypes first typeName; space.
- 	aStream print: argTypes first; space.
  	self name == nil
  		ifTrue:[aStream nextPutAll:'(*) ']
  		ifFalse:[aStream print: self name asString; space].
  	aStream nextPut:$(.
  	2 to: argTypes size do:[:i|
+ 		aStream nextPutAll: (argTypes at: i) typeName.
- 		aStream print: (argTypes at: i).
  		i < argTypes size ifTrue:[aStream space]].
  	aStream nextPut:$).
  	self module == nil ifFalse:[
  		aStream space; nextPutAll:'module: '; print: self module asString.
  	self errorCodeName == nil ifFalse:[
  		aStream space; nextPutAll:'error: '; nextPutAll: self errorCodeName.
  	aStream nextPut:$>!

Item was changed:
  ----- Method: ExternalStructureType>>printOn: (in category 'printing') -----
  printOn: aStream
  	self isTypeAlias ifTrue: [
+ 		aStream nextPutAll: self typeName.
- 		aStream nextPutAll: referentClass name.
  			nextPutAll: '~>';
  			print: self originalType.
  		self isEmpty
  			ifTrue: [aStream nextPutAll: ' ???'].
  		^ self].
  	referentClass == nil
  		ifTrue:[aStream nextPutAll: '<unknown struct type>']
  			super printOn: aStream.
  			self isEmpty
  				ifTrue: [aStream nextPutAll: ' { void }']].!

Item was changed:
  ----- Method: ExternalType>>printOn: (in category 'printing') -----
  printOn: aStream
+ 	aStream nextPutAll: self typeName.
- 	aStream nextPutAll: (referentClass ifNil: [self atomicTypeName] ifNotNil: [referentClass name]).
- 	self isPointerType ifTrue: [aStream nextPut: $*].
  		nextPut: $(;
  		nextPutAll: self byteSize asString;
  		nextPutAll: self byteAlignment asString;
  		nextPut: $).!

Item was added:
+ ----- Method: ExternalType>>typeName (in category 'accessing') -----
+ typeName
+ 	^ String streamContents: [:stream |
+ 		stream nextPutAll: (referentClass
+ 			ifNil: [self atomicTypeName]
+ 			ifNotNil: [referentClass name]).
+ 		self isPointerType
+ 			ifTrue: [stream nextPut: $*]]!

More information about the Squeak-dev mailing list