Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_media.c 


Log Message:
- fix potential issue

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_media.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ewl_media.c 24 Oct 2005 02:52:07 -0000      1.7
+++ ewl_media.c 25 Oct 2005 02:53:04 -0000      1.8
@@ -196,6 +196,8 @@
 ewl_media_length_time_get(Ewl_Media *m, int *h, int *min, double *s)
 {
        double pos;
+       int mh, mm;
+       double ms;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("m", m);
@@ -204,9 +206,13 @@
        pos = ewl_media_length_get(m);
 
        /* stolen from envision by benr */
-       if (h) *h = (int)pos / (60 * 60);
-       if (min) *min = ((int)pos / 60) - (*h * 60);
-       if (s) *s = pos - (*h * 60 * 60) - (*min * 60);
+       mh = (int)pos / (60 * 60);
+       mm = ((int)pos / 60) - (mh * 60);
+       ms = pos - (mh * 60 * 60) - (mm * 60);
+
+       if (h) *h = mh;
+       if (min) *min = mm;
+       if (s) *s = ms;
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
@@ -280,16 +286,23 @@
 void
 ewl_media_position_time_get(Ewl_Media *m, int *h, int *min, double *s)
 {
-       double pos = ewl_media_position_get(m);
+       double pos;
+       int mh, mm;
+       double ms;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("m", m);
        DCHECK_TYPE("m", m, "media");
-
+ 
+       pos = ewl_media_position_get(m);
        /* stolen from envision by benr */
-       if (h) *h = (int)pos / (60 * 60);
-       if (min) *min = ((int)pos / 60) - (*h * 60);
-       if (s) *s = pos - (*h * 60 * 60) - (*min * 60);
+       mh = (int)pos / (60 * 60);
+       mm = ((int)pos / 60) - (mh * 60);
+       ms = pos - (mh * 60 * 60) - (mm * 60);
+
+       if (h) *h = mh
+       if (min) *min = mm
+       if (s) *s = ms;
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }




-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to