2014-06-24 23:16 GMT+04:00 Roberto E. Vargas Caballero <k...@shike2.com>: >> But who'd specify a scaling factor of 1.99999 or sth.? >> BTW: Casting to int yields the exact same results for both CEIL and >> ceilf in my setup. > > There is an implicit casting because xw.cw and xw.ch are integers, > so the explicit casting is redundant. This macro is used only in one place, > xloadfonts, that is out of the main loop (usually is only called in > the init process), so it is a waste of time try to optimize it for speed. > A macro like: > > CEIL(x) ((int)(x) + ((x) > 0 && (int)(x) != (x))) > > Can take more bytes that the direct call to ceilf because it has > only one parameter, so the calling sequence is short, and in case of > being and inlined function, the compiler version will be better > that our version, so my proposal for the patch is: Greetings, I would vote to drop the macro, because supporting it for future use-cases can be a nightmare. What to use for ceiliing in those calculations is another matter... we could always just add 1 - FLT_EPSILON and call it a day.
- Re: [dev] [st] [PATCH] Explicit cast in CEIL m... FRIGN
- Re: [dev] [st] [PATCH] Explicit cast in CEIL m... Roberto E. Vargas Caballero
- Re: [dev] [st] [PATCH] Explicit cast in CEIL m... FRIGN
- Re: [dev] [st] [PATCH] Explicit cast in CEIL m... FRIGN
- Re: [dev] [st] [PATCH] Explicit cast in CEIL m... Martti Kühne
- Re: [dev] [st] [PATCH] Explicit cast in CEIL m... Martti Kühne
- Re: [dev] [st] [PATCH] Explicit cast in CEIL m... FRIGN
- Re: [dev] [st] [PATCH] Explicit cast in CEIL m... Eric Pruitt
- Re: [dev] [st] [PATCH] Explicit cast in CEIL m... Eric Pruitt
- Re: [dev] [st] [PATCH] Explicit cast in CEIL m... Roberto E. Vargas Caballero
- Re: [dev] [st] [PATCH] Explicit cast in CEIL m... Alexander S.
- Re: [dev] [st] [PATCH] Explicit cast in CEIL m... Roberto E. Vargas Caballero
- Re: [dev] [st] [PATCH] Explicit cast in CEIL m... Markus Teich
- Re: [dev] [st] [PATCH] Explicit cast in CEIL m... Markus Wichmann
- Re: [dev] [st] [PATCH] Explicit cast in CEIL m... stanio
- Re: [dev] [st] [PATCH] Explicit cast in CEIL m... Anders Eurenius
- Re: [dev] [st] [PATCH] Explicit cast in CEIL m... Jakob Kramer
- Re: [dev] [st] [PATCH] Explicit cast in CEIL m... Martti Kühne
- Re: [dev] [st] [PATCH] Explicit cast in CEIL m... Alexander Hof