[fpc-pascal] FPC Graphics options?

Sven Barth pascaldragon at googlemail.com
Sat May 20 23:15:58 CEST 2017


On 20.05.2017 21:34, Jonas Maebe wrote:
> There's at least one minor twist of the classic "C compiler evaluates
> constant stuff at compile time":
> 1) oy and oz are constant. The "floor" function is a standard C library
> function, and hence C compilers know what it does and can evaluate it at
> compile time. Therefore, the oy-floor(oy) and oz-floor(oz) expressions
> are (equal) constants for C compilers.

Would it help here if we'd declare suitable overloads for Floor() for
the various floating point types instead of only the "Float" one,
declare them as inline and have the inline nodes for Frac() and Trunc()
handle constant values?
At least if the compiler also recognizes that oy and oz are constant...

Regards,
Sven



More information about the fpc-pascal mailing list