Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        fx.c startup.c 


Log Message:
Fixes, cleanups.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/fx.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -3 -r1.50 -r1.51
--- fx.c        19 Jul 2005 22:33:19 -0000      1.50
+++ fx.c        22 Jul 2005 17:00:09 -0000      1.51
@@ -53,8 +53,8 @@
 /****************************** RIPPLES *************************************/
 
 #define fx_ripple_waterh 64
-static Pixmap       fx_ripple_above = 0;
-static Window       fx_ripple_win = 0;
+static Pixmap       fx_ripple_above = None;
+static Window       fx_ripple_win = None;
 static int          fx_ripple_count = 0;
 
 static void
@@ -78,13 +78,13 @@
 }
 
 static void
-FX_ripple_timeout(int val, void *data)
+FX_ripple_timeout(int val __UNUSED__, void *data __UNUSED__)
 {
    static double       incv = 0, inch = 0;
    static GC           gc1 = 0, gc = 0;
    int                 y;
 
-   if (!fx_ripple_above)
+   if (fx_ripple_above == None)
      {
        XGCValues           gcv;
 
@@ -135,26 +135,22 @@
                  off, VRoot.h - fx_ripple_waterh + y);
      }
    DoIn("FX_RIPPLE_TIMEOUT", 0.066, FX_ripple_timeout, 0, NULL);
-   return;
-   val = 0;
-   data = NULL;
 }
 
 static void
-FX_Ripple_Init(const char *name)
+FX_Ripple_Init(const char *name __UNUSED__)
 {
    fx_ripple_count = 0;
    DoIn("FX_RIPPLE_TIMEOUT", 0.066, FX_ripple_timeout, 0, NULL);
-   return;
-   name = NULL;
 }
 
 static void
 FX_Ripple_Desk(void)
 {
-   EFreePixmap(fx_ripple_above);
+   if (fx_ripple_above != None)
+      EFreePixmap(fx_ripple_above);
    fx_ripple_count = 0;
-   fx_ripple_above = 0;
+   fx_ripple_above = None;
 }
 
 static void
@@ -192,7 +188,7 @@
 #define fx_raindrop_duration 32
 #define fx_frequency 4
 #define fx_amplitude 48
-static Window       fx_raindrops_win = 0;
+static Window       fx_raindrops_win = None;
 static int          fx_raindrops_number = 4;
 static PixImg      *fx_raindrops_draw = NULL;
 
@@ -228,7 +224,7 @@
 }
 
 static void
-FX_raindrops_timeout(int val, void *data)
+FX_raindrops_timeout(int val __UNUSED__, void *data __UNUSED__)
 {
    static GC           gc1 = 0, gc = 0;
    int                 i, x, y, xx, yy;
@@ -237,7 +233,7 @@
    static char         sintab[256];
    static unsigned char disttab[fx_raindrop_size][fx_raindrop_size];
 
-   if (!fx_raindrops_win)
+   if (fx_raindrops_win == None)
      {
        XGCValues           gcv;
 
@@ -417,17 +413,14 @@
      }
    DoIn("FX_RAINDROPS_TIMEOUT", (0.066 /*/ (float)fx_raindrops_number */ ),
        FX_raindrops_timeout, 0, NULL);
-   return;
-   val = 0;
-   data = NULL;
 }
 
 static void
-FX_Raindrops_Init(const char *name)
+FX_Raindrops_Init(const char *name __UNUSED__)
 {
    int                 i;
 
-   fx_raindrops_win = 0;
+   fx_raindrops_win = None;
    for (i = 0; i < fx_raindrops_number; i++)
      {
        fx_raindrops[i].count = rand() % fx_raindrop_duration;
@@ -435,14 +428,12 @@
        fx_raindrops[i].y = rand() % (VRoot.h - fx_raindrop_size);
      }
    DoIn("FX_RAINDROPS_TIMEOUT", 0.066, FX_raindrops_timeout, 0, NULL);
-   return;
-   name = NULL;
 }
 
 static void
 FX_Raindrops_Desk(void)
 {
-   fx_raindrops_win = 0;
+   fx_raindrops_win = None;
 }
 
 static void
@@ -462,7 +453,7 @@
    if (fx_raindrops_draw)
       EDestroyPixImg(fx_raindrops_draw);
    fx_raindrops_draw = NULL;
-   fx_raindrops_win = 0;
+   fx_raindrops_win = None;
 }
 
 static void
@@ -494,8 +485,8 @@
 #define FX_WAVE_DEPTH  10
 #define FX_WAVE_GRABH  (FX_WAVE_WATERH + FX_WAVE_DEPTH)
 #define FX_WAVE_CROSSPERIOD 0.42
-static Pixmap       fx_wave_above = 0;
-static Window       fx_wave_win = 0;
+static Pixmap       fx_wave_above = None;
+static Window       fx_wave_win = None;
 static int          fx_wave_count = 0;
 
 static void
@@ -519,7 +510,7 @@
 }
 
 static void
-FX_Wave_timeout(int val, void *data)
+FX_Wave_timeout(int val __UNUSED__, void *data __UNUSED__)
 {
    /* Variables */
    static double       incv = 0, inch = 0;
@@ -626,13 +617,6 @@
 
    /* Make noise */
    DoIn("FX_WAVE_TIMEOUT", 0.066, FX_Wave_timeout, 0, NULL);
-
-   /* Return */
-   return;
-
-   /* Never gets here */
-   val = 0;
-   data = NULL;
 }
 
 static void
@@ -679,7 +663,7 @@
 
 /****************************** IMAGESPINNER ********************************/
 
-static Window       fx_imagespinner_win = 0;
+static Window       fx_imagespinner_win = None;
 static int          fx_imagespinner_count = 3;
 static char        *fx_imagespinner_params = NULL;
 
@@ -700,11 +684,11 @@
 }
 
 static void
-FX_imagespinner_timeout(int val, void *data)
+FX_imagespinner_timeout(int val __UNUSED__, void *data __UNUSED__)
 {
    char               *string = NULL;
 
-   if (!fx_imagespinner_win)
+   if (fx_imagespinner_win == None)
      {
        fx_imagespinner_win = DeskGetCurrentRoot();
        FX_imagespinner_info();
@@ -744,9 +728,6 @@
      }
 
    DoIn("FX_IMAGESPINNER_TIMEOUT", 0.066, FX_imagespinner_timeout, 0, NULL);
-   return;
-   val = 0;
-   data = NULL;
 }
 
 static void
@@ -771,7 +752,7 @@
    if (fx_imagespinner_params)
       Efree(fx_imagespinner_params);
    fx_imagespinner_params = NULL;
-   fx_imagespinner_win = 0;
+   fx_imagespinner_win = None;
 }
 
 static void
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/startup.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -3 -r1.55 -r1.56
--- startup.c   16 Jul 2005 16:57:44 -0000      1.55
+++ startup.c   22 Jul 2005 17:00:10 -0000      1.56
@@ -91,13 +91,16 @@
    EMapWindow(win1);
    EMapWindow(win2);
 
-   b1 = ECreateWindow(w1, bx, by, bw, bh, 0);
-   b2 = ECreateWindow(w2, 0, 0, bw, bh, 0);
-   EMapRaised(b1);
-   EMapRaised(b2);
+   if (ic && bw > 0 && bh > 0)
+     {
+       b1 = ECreateWindow(w1, bx, by, bw, bh, 0);
+       b2 = ECreateWindow(w2, 0, 0, bw, bh, 0);
+       EMapRaised(b1);
+       EMapRaised(b2);
 
-   ImageclassApply(ic, b1, bw, bh, 0, 0, 0, 0, ST_UNKNWN);
-   ImageclassApply(ic, b2, bw, bh, 0, 0, 0, 0, ST_UNKNWN);
+       ImageclassApply(ic, b1, bw, bh, 0, 0, 0, 0, ST_UNKNWN);
+       ImageclassApply(ic, b2, bw, bh, 0, 0, 0, 0, ST_UNKNWN);
+     }
 
    BackgroundApply(bg, win1, 1);
    BackgroundApply(bg, win2, 1);




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to