kwo pushed a commit to branch master.

commit 3d03033e7f22ffba83e53a623e855b92edfa0f02
Author: Kim Woelders <[email protected]>
Date:   Mon Jul 8 00:05:20 2013 +0200

    Some more double to float.
---
 src/animation.c |  3 ++-
 src/container.c |  2 +-
 src/dialog.c    |  2 +-
 src/ecompmgr.c  |  2 +-
 src/ewins.c     |  4 ++--
 src/fx.c        | 10 +++++-----
 src/icccm.c     |  8 ++++----
 src/menus.c     |  2 +-
 8 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/src/animation.c b/src/animation.c
index 2499458..801076e 100644
--- a/src/animation.c
+++ b/src/animation.c
@@ -228,8 +228,9 @@ AnimatorGetData(Animator * an)
 }
 
 /* Quarter period sinusoidal used in time limited animations */
+#define M_PI_F  ((float)(M_PI))
 #define REMAINING(elapsed, duration) \
-   (int)(1024 * (1. - cos(((M_PI / 2 * (elapsed)) / (duration)))))
+   (int)(1024 * (1.f - cosf(((M_PI_F / 2 * (elapsed)) / (duration)))))
 
 static unsigned int
 _AnimatorsRun(Animator ** head, unsigned int frame_num, unsigned int 
next_frame)
diff --git a/src/container.c b/src/container.c
index dc0417d..2ed7988 100644
--- a/src/container.c
+++ b/src/container.c
@@ -208,7 +208,7 @@ ContainerReconfigure(Container * ct)
      }
 
    ICCCM_SetSizeConstraints(ct->ewin, wmin, hmin, wmax, hmax, 0, 0, 1, 1,
-                           0.0, 65535.0);
+                           0.f, 65535.f);
 }
 
 static void
diff --git a/src/dialog.c b/src/dialog.c
index 75dd14d..411d766 100644
--- a/src/dialog.c
+++ b/src/dialog.c
@@ -408,7 +408,7 @@ DialogArrange(Dialog * d, int resize)
      }
 
    ICCCM_SetSizeConstraints(d->ewin, d->w, d->h, d->w, d->h, 0, 0, 1, 1,
-                           0.0, 65535.0);
+                           0.f, 65535.f);
 
    if (resize)
      {
diff --git a/src/ecompmgr.c b/src/ecompmgr.c
index f82b93b..19b8c5b 100644
--- a/src/ecompmgr.c
+++ b/src/ecompmgr.c
@@ -440,7 +440,7 @@ static conv        *
 make_gaussian_map(float r)
 {
    conv               *c;
-   int                 size = ((int)ceil((r * 3)) + 1) & ~1;
+   int                 size = ((int)ceilf((r * 3)) + 1) & ~1;
    int                 center = size / 2;
    int                 x, y;
    float               t, g;
diff --git a/src/ewins.c b/src/ewins.c
index 848498f..7ccb726 100644
--- a/src/ewins.c
+++ b/src/ewins.c
@@ -107,8 +107,8 @@ EwinCreate(int type)
    ewin->icccm.base_h = 0;
    ewin->icccm.w_inc = 1;
    ewin->icccm.h_inc = 1;
-   ewin->icccm.aspect_min = 0.0;
-   ewin->icccm.aspect_max = 65535.0;
+   ewin->icccm.aspect_min = 0.f;
+   ewin->icccm.aspect_max = 65535.f;
    ewin->icccm.grav = NorthWestGravity;
 
    ewin->area_x = -1;
diff --git a/src/fx.c b/src/fx.c
index 263d62d..71a8749 100644
--- a/src/fx.c
+++ b/src/fx.c
@@ -115,10 +115,10 @@ FX_ripple_timeout(EObj * eo __UNUSED__, int run 
__UNUSED__, void *state)
 
        p = (((float)(FX_RIPPLE_WATERH - y)) / ((float)FX_RIPPLE_WATERH));
        a = p * p * 48 + d->incv;
-       yoff = y + (int)(sin(a) * 7) + 1;
+       yoff = y + (int)(sinf(a) * 7) + 1;
        yy = (FX_RIPPLE_WATERH * 2) - yoff;
        aa = p * p * 64 + d->inch;
-       off = (int)(sin(aa) * 10 * (1 - p));
+       off = (int)(sinf(aa) * 10 * (1 - p));
        XCopyArea(disp, d->above, WinGetXwin(d->win), d->gc1, 0, yy,
                  WinGetW(VROOT), 1, off,
                  WinGetH(VROOT) - FX_RIPPLE_WATERH + y);
@@ -248,10 +248,10 @@ FX_Wave_timeout(EObj * eo __UNUSED__, int run __UNUSED__, 
void *state)
        /* Figure out the side-to-side movement */
        p = (((float)(FX_WAVE_WATERH - y)) / ((float)FX_WAVE_WATERH));
        a = p * p * 48 + d->incv;
-       yoff = y + (int)(sin(a) * 7) + 1;
+       yoff = y + (int)(sinf(a) * 7) + 1;
        yy = (FX_WAVE_WATERH * 2) - yoff;
        aa = p * p * FX_WAVE_WATERH + d->inch;
-       off = (int)(sin(aa) * 10 * (1 - p));
+       off = (int)(sinf(aa) * 10 * (1 - p));
 
        /* Set up the next part */
        incx2 = d->incx;
@@ -269,7 +269,7 @@ FX_Wave_timeout(EObj * eo __UNUSED__, int run __UNUSED__, 
void *state)
                incx2 = 0;
 
             /* Figure it out */
-            sx = (int)(sin(incx2) * FX_WAVE_DEPTH);
+            sx = (int)(sinf(incx2) * FX_WAVE_DEPTH);
 
             /* Display this block */
             XCopyArea(disp, d->above, WinGetXwin(d->win), d->gc1, x, yy,       
/* x, y */
diff --git a/src/icccm.c b/src/icccm.c
index 13c5d6d..88f7dfd 100644
--- a/src/icccm.c
+++ b/src/icccm.c
@@ -176,8 +176,8 @@ ICCCM_SizeMatch(const EWin * ewin, int wi, int hi, int 
*pwo, int *pho)
        if (!ewin->state.fullscreen)
          {
             aspect = ((float)w) / ((float)h);
-            dw = ewin->icccm.w_inc / 4.;
-            dh = ewin->icccm.h_inc / 4.;
+            dw = ewin->icccm.w_inc / 4.f;
+            dh = ewin->icccm.h_inc / 4.f;
             if (Mode.mode == MODE_RESIZE_H)
               {
                  if (aspect < ewin->icccm.aspect_min)
@@ -196,14 +196,14 @@ ICCCM_SizeMatch(const EWin * ewin, int wi, int hi, int 
*pwo, int *pho)
               {
                  if (aspect < ewin->icccm.aspect_min)
                    {
-                      if (ewin->icccm.aspect_min >= 1.)
+                      if (ewin->icccm.aspect_min >= 1.f)
                          h = (int)((float)w / ewin->icccm.aspect_min + dh);
                       else
                          w = (int)((float)h * ewin->icccm.aspect_min + dw);
                    }
                  else if (aspect > ewin->icccm.aspect_max)
                    {
-                      if (ewin->icccm.aspect_max >= 1.)
+                      if (ewin->icccm.aspect_max >= 1.f)
                          h = (int)((float)w / ewin->icccm.aspect_max + dh);
                       else
                          w = (int)((float)h * ewin->icccm.aspect_max + dw);
diff --git a/src/menus.c b/src/menus.c
index f96204a..ff7eeb5 100644
--- a/src/menus.c
+++ b/src/menus.c
@@ -211,7 +211,7 @@ _MenuEwinInit(EWin * ewin)
    EwinInhSetWM(ewin, focus, 1);
 
    ICCCM_SetSizeConstraints(ewin, m->w, m->h, m->w, m->h, 0, 0, 1, 1,
-                           0.0, 65535.0);
+                           0.f, 65535.f);
    ewin->icccm.grav = StaticGravity;
 
    EoSetLayer(ewin, 12);

-- 

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

Reply via email to