Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue#659 #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions kernel/CObject.st
Original file line number Diff line number Diff line change
Expand Up @@ -1541,6 +1541,13 @@ CByte subclass: CBoolean [
<category: 'Language-C interface'>
<comment: 'I return true if a byte is not zero, false otherwise.'>

CBoolean class >> type [
"Answer a CType for the receiver"

<category: 'conversion'>
^CBooleanType
]

value [
"Get the receiver's value - answer true if it is != 0, false if it is 0."

Expand Down
4 changes: 4 additions & 0 deletions tests/cobjects.ok
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,7 @@ $2
$3
$<0>
returned value is nil

Execution begins...
true
returned value is nil
7 changes: 7 additions & 0 deletions tests/cobjects.st
Original file line number Diff line number Diff line change
Expand Up @@ -238,5 +238,12 @@ Eval [
c free.
]

" Play with conversion for Boolean"
Eval [
c := CBoolean value: true.
c value printNl.
c free.
]

" ### need a lot more!"