Skip to content

transpile: Translate some literals in conditionals as bool directly#1693

Open
Rua wants to merge 4 commits intoimmunant:masterfrom
Rua:bool-literal
Open

transpile: Translate some literals in conditionals as bool directly#1693
Rua wants to merge 4 commits intoimmunant:masterfrom
Rua:bool-literal

Conversation

@Rua
Copy link
Contributor

@Rua Rua commented Mar 25, 2026

Makes things look a little nicer. I've tried to be conservative here and only consider literal 0 and 1 this way. No other literals, and no macros either.

Unfortunately that includes the false and true macros found in the stdbool.h header. There would need to be some way to detect those and treat them differently from other macros. See also #288.

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.

0i32 != 0 vs false

1 participant