[ros-dev] [ros-diffs] [jgardou] 64176: [GDI32] - Fix up values got from win32k in GetOutlineTextMetrics and do not fail if the provided buffersize is only sizeof(OUTLINETEXTMETRICW). CORE-8507 #resolve
Timo Kreuzer
timo.kreuzer at web.de
Wed Sep 17 19:32:42 UTC 2014
Am 17.09.2014 11:54, schrieb jgardou at svn.reactos.org:
> Author: jgardou
> Date: Wed Sep 17 09:54:14 2014
> New Revision: 64176
>
> URL: http://svn.reactos.org/svn/reactos?rev=64176&view=rev
> Log:
> [GDI32]
> - Fix up values got from win32k in GetOutlineTextMetrics and do not fail if the provided buffersize is only sizeof(OUTLINETEXTMETRICW).
> CORE-8507 #resolve
>
> Modified:
> trunk/reactos/win32ss/gdi/gdi32/objects/font.c
>
> Modified: trunk/reactos/win32ss/gdi/gdi32/objects/font.c
> URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/font.c?rev=64176&r1=64175&r2=64176&view=diff
> ==============================================================================
> --- trunk/reactos/win32ss/gdi/gdi32/objects/font.c [iso-8859-1] (original)
> +++ trunk/reactos/win32ss/gdi/gdi32/objects/font.c [iso-8859-1] Wed Sep 17 09:54:14 2014
> @@ -9,8 +9,19 @@
>
> #include <precomp.h>
>
> +#include <math.h>
> +
> #define NDEBUG
> #include <debug.h>
> +
> +/* Rounds a floating point number to integer. The world-to-viewport
> + * transformation process is done in floating point internally. This function
> + * is then used to round these coordinates to integer values.
> + */
> +static __inline INT GDI_ROUND(FLOAT val)
> +{
> + return (int)floor(val + 0.5);
> +}
roundf() is the appropriate function here. The older MS crt headers
don't have the *round*() functions, but VS 2013 headers seem to have
them (according MSDN).
I propose adding them inside some #ifdef, instead of reimplementing them
in different places.
For the other functions: strange coding style. Is this taken from wine?
More information about the Ros-dev
mailing list