Re: [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 #re

2014-09-17 Thread Timo Kreuzer
Am 17.09.2014 11:54, schrieb jgar...@svn.reactos.org:
 Author: jgardou
 Date: Wed Sep 17 09:54:14 2014
 New Revision: 64176

 URL: http://svn.reactos.org/svn/reactos?rev=64176view=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=64176r1=64175r2=64176view=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?


___
Ros-dev mailing list
Ros-dev@reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev


Re: [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 #re

2014-09-17 Thread Jérôme Gardou

Le 17/09/2014 21:32, Timo Kreuzer a écrit :

Am 17.09.2014 11:54, schrieb jgar...@svn.reactos.org:

Author: jgardou
Date: Wed Sep 17 09:54:14 2014
New Revision: 64176

URL: http://svn.reactos.org/svn/reactos?rev=64176view=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=64176r1=64175r2=64176view=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.

Hmm, why not, but we don't use msvcr120.dll.


For the other functions: strange coding style. Is this taken from wine?


Yes, I thought I added the copyright notice, obviously forgot to do so.

___
Ros-dev mailing list
Ros-dev@reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev



___
Ros-dev mailing list
Ros-dev@reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev