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

Use bool for predicates #407

Merged
merged 4 commits into from
Jun 8, 2024
Merged

Use bool for predicates #407

merged 4 commits into from
Jun 8, 2024

Conversation

bettio
Copy link
Collaborator

@bettio bettio commented Nov 14, 2022

Signed-off-by: Davide Bettio [email protected]

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

Copy link
Collaborator

@pguyot pguyot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are also missing term_is_float

src/libAtomVM/term.h Show resolved Hide resolved
src/libAtomVM/term.h Show resolved Hide resolved
src/libAtomVM/term.h Show resolved Hide resolved
src/libAtomVM/term.h Show resolved Hide resolved
src/libAtomVM/term.h Show resolved Hide resolved
src/libAtomVM/term.h Outdated Show resolved Hide resolved
src/libAtomVM/term.h Outdated Show resolved Hide resolved
src/libAtomVM/term.h Show resolved Hide resolved
src/libAtomVM/term.h Show resolved Hide resolved
@bettio bettio force-pushed the use-bools branch 2 times, most recently from 0a39ab3 to 5259fb4 Compare November 15, 2022 00:04
@pguyot
Copy link
Collaborator

pguyot commented Nov 15, 2022

Also term_is_number (can't comment on the line)

@bettio bettio marked this pull request as ready for review December 12, 2022 22:38
@bettio bettio marked this pull request as draft December 13, 2022 00:36
@bettio bettio marked this pull request as ready for review December 16, 2022 23:51
@bettio
Copy link
Collaborator Author

bettio commented Dec 16, 2022

This changes make sense from a theoretical point of view, from an empirical point of view they might slow down the generated binary.

term.h wasn't using stdbool so predicate functions were returning int
instead of bool.
So change them to use instead bool.

Signed-off-by: Davide Bettio <[email protected]>
Use bool instead of int for predicates.

Signed-off-by: Davide Bettio <[email protected]>
Use bool for predicates instead of int.

Signed-off-by: Davide Bettio <[email protected]>
Use bool for predicates instead of int.

Signed-off-by: Davide Bettio <[email protected]>
@bettio bettio merged commit 11f587b into atomvm:main Jun 8, 2024
90 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants