[1/10] gdiplus: moved two helpers to gdiplus.c

Evan Stade estade at gmail.com
Tue Jul 10 20:39:23 CDT 2007


Hi,

Changelog:
*made two helper functions available to the whole dll

 dlls/gdiplus/gdiplus.c         |   11 +++++++++++
 dlls/gdiplus/gdiplus_private.h |    4 +++-
 dlls/gdiplus/graphics.c        |   10 ----------
 3 files changed, 14 insertions(+), 11 deletions(-)
-- 
Evan Stade
-------------- next part --------------
diff --git a/dlls/gdiplus/gdiplus.c b/dlls/gdiplus/gdiplus.c
index 959bcb0..97136a1 100644
--- a/dlls/gdiplus/gdiplus.c
+++ b/dlls/gdiplus/gdiplus.c
@@ -17,6 +17,7 @@
  */
 
 #include <stdarg.h>
+#include <math.h>
 
 #include "windef.h"
 #include "winbase.h"
@@ -105,3 +106,13 @@ COLORREF ARGB2COLORREF(ARGB color)
          (color & 0x00ff00) +
         ((color & 0xff0000) >> 16);
 }
+
+inline INT roundr(REAL x)
+{
+    return (INT) floorf(x + 0.5);
+}
+
+inline REAL deg2rad(REAL degrees)
+{
+    return M_PI * degrees / 180.0;
+}
diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h
index d036057..2bf3b5b 100644
--- a/dlls/gdiplus/gdiplus_private.h
+++ b/dlls/gdiplus/gdiplus_private.h
@@ -24,7 +24,9 @@ #include "gdiplus.h"
 
 #define GP_DEFAULT_PENSTYLE (PS_GEOMETRIC | PS_ENDCAP_FLAT | PS_JOIN_MITER)
 
-COLORREF ARGB2COLORREF(ARGB color);
+extern COLORREF ARGB2COLORREF(ARGB color);
+extern INT roundr(REAL x);
+extern REAL deg2rad(REAL degrees);
 
 struct GpPen{
     UINT style;
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 3a88295..ae19110 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -34,16 +34,6 @@ #define TENSION_CONST (0.3)
 #define ANCHOR_WIDTH (2.0)
 #define MAX_ITERS (50)
 
-static inline INT roundr(REAL x)
-{
-    return (INT) floor(x+0.5);
-}
-
-static inline REAL deg2rad(REAL degrees)
-{
-    return (M_PI*2.0) * degrees / 360.0;
-}
-
 /* Converts angle (in degrees) to x/y coordinates */
 static void deg2xy(REAL angle, REAL x_0, REAL y_0, REAL *x, REAL *y)
 {
-- 
1.4.1


More information about the wine-patches mailing list