Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Commit

Permalink
added FFIBoolean32 type
Browse files Browse the repository at this point in the history
  • Loading branch information
estebanlm committed Jun 4, 2020
1 parent 9989980 commit b4a2fac
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
49 changes: 49 additions & 0 deletions src/ThreadedFFI/FFIBoolean32.class.st
@@ -0,0 +1,49 @@
Class {
#name : #FFIBoolean32,
#superclass : #FFIExternalType,
#category : #'ThreadedFFI-Types'
}

{ #category : #accessing }
FFIBoolean32 class >> externalType [
^ ExternalType bool
]

{ #category : #accessing }
FFIBoolean32 class >> externalTypeAlignment [
^ 1
]

{ #category : #accessing }
FFIBoolean32 class >> externalTypeSize [
^ 1
]

{ #category : #private }
FFIBoolean32 >> basicHandle: aHandle at: index [

^ (aHandle signedLongAt: index) ~~ 0
]

{ #category : #private }
FFIBoolean32 >> basicHandle: aHandle at: index put: value [

^ aHandle signedLongAt: index put: value asBit
]

{ #category : #accessing }
FFIBoolean32 >> defaultReturnOnError [

^ false
]

{ #category : #'stack parameter classification' }
FFIBoolean32 >> stackValueParameterClass [
^ #integer
]

{ #category : #accessing }
FFIBoolean32 >> tfExternalType [

^ TFDerivedType boolean32
]
11 changes: 11 additions & 0 deletions src/ThreadedFFI/TFBoolean32Type.class.st
@@ -0,0 +1,11 @@
Class {
#name : #TFBoolean32Type,
#superclass : #TFBooleanType,
#category : #'ThreadedFFI-Types'
}

{ #category : #accessing }
TFBoolean32Type >> basicType [

^ TFBasicType uint32
]
7 changes: 7 additions & 0 deletions src/ThreadedFFI/TFDerivedType.class.st
Expand Up @@ -3,6 +3,7 @@ Class {
#superclass : #Object,
#classVars : [
'BOOLEAN',
'BOOLEAN32',
'OOP',
'STRING'
],
Expand All @@ -15,6 +16,12 @@ TFDerivedType class >> boolean [
^ BOOLEAN ifNil: [ BOOLEAN := TFBooleanType new ]
]

{ #category : #accessing }
TFDerivedType class >> boolean32 [

^ BOOLEAN32 ifNil: [ BOOLEAN32 := TFBoolean32Type new ]
]

{ #category : #accessing }
TFDerivedType class >> objectPointer [

Expand Down

0 comments on commit b4a2fac

Please sign in to comment.