Enlightenment CVS committal Author : xcomputerman Project : e17 Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_x Modified Files: ecore_x_window_prop.c Log Message: Thanks to Brett Nash for pointing out that this integer division will not work. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_window_prop.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- ecore_x_window_prop.c 6 Jan 2004 03:42:05 -0000 1.18 +++ ecore_x_window_prop.c 6 Jan 2004 16:45:31 -0000 1.19 @@ -1094,8 +1094,10 @@ void ecore_x_window_prop_window_opacity_set(Ecore_X_Window win, int opacity) { unsigned long o_val; + double tmp; - o_val = (unsigned long) opacity / 100UL * 0xffffffff; + tmp = (double) opacity/100. * 4294967295.; + o_val = (unsigned long) tmp; ecore_x_window_prop_property_set(win, _ecore_x_atom_net_wm_window_opacity, XA_CARDINAL, 32, &o_val, 1); } @@ -1110,7 +1112,7 @@ int ecore_x_window_prop_window_opacity_get(Ecore_X_Window win) { unsigned char *data = NULL; - unsigned long tmp; + unsigned long lval; int ret_val = -1; int num; @@ -1119,8 +1121,8 @@ { if (data && num) { - tmp = *(unsigned long *) data; - ret_val = (int) (tmp / 0xffffffff * 100UL); + lval = *(unsigned long *) data; + ret_val = (int) ((double) lval / 4294967295. * 100.); } } ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ enlightenment-cvs mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs