Skip to content

Conversation

@kblaschke
Copy link
Member

@kblaschke kblaschke commented Nov 6, 2025

One fix in the scanner to parse integers (literal numbers without a decimal point) with atoi, which is what ns-eel2 does. The other fix uses fixed-size int types for type conversions within a few expression operators like bitwise and/or and modulo. Now, the floating-point numbers are converted into the same-size int, depending on the whether float or double is used during compilation. Most builds will use 64-bit numbers for both. This prevents further overflows and also more closely resembles what ns-eel2 does internally.

The third commit only moves an #include from a header where it wasn't needed to the files which actually use the header's single function declaration.

Additionally fixed a warning with Clang as -Ofast is deprecated.

ns-eel2 parses numbers without decimal point with atoi(), which causes overflows as it has a lower value range than double. We now mimic this behavior.
@kblaschke kblaschke self-assigned this Nov 6, 2025
@kblaschke kblaschke added the enhancement New feature or request label Nov 6, 2025
Also convert integers in bitwise and modulo operators to the same bit-width as PRJM_EVAL_F to prevent overflows.
Instead, directly include it where it's actually being used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant