FFI: FFI-Kernel-mt.125.mcz

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

FFI: FFI-Kernel-mt.125.mcz

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

==================== 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
  aStream
  nextPut:$<;
  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.
  aStream
  nextPutAll: '~>';
  print: self originalType.
  self isEmpty
  ifTrue: [aStream nextPutAll: ' ???'].
  ^ self].
 
  referentClass == nil
  ifTrue:[aStream nextPutAll: '<unknown struct type>']
  ifFalse:[
  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: $*].
 
  aStream
  space;
  nextPut: $(;
  nextPutAll: self byteSize asString;
  space;
  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: $*]]!