N_SE-35056 - When ticks is negative, GetAPIs didn't manage this case
authordahyeong.kim <dahyeong.kim@samsung.com>
Fri, 19 Apr 2013 02:21:03 +0000 (11:21 +0900)
committerdahyeong.kim <dahyeong.kim@samsung.com>
Fri, 19 Apr 2013 02:21:03 +0000 (11:21 +0900)
Change-Id: Ieb90473a6c8f18d17187f19a498e5d02faa82819
Signed-off-by: dahyeong.kim <dahyeong.kim@samsung.com>
inc/FBaseTimeSpan.h
src/base/FBaseTimeSpan.cpp

index 76db340..b1a12dc 100644 (file)
@@ -385,28 +385,28 @@ public:
         *
         * @since 2.0
         */
-       static const long long NUM_OF_TICKS_IN_DAY = 86400000;
+       static const long long NUM_OF_TICKS_IN_DAY = 86400000LL;
 
        /**
         * A constant holding the number of ticks in an hour.
         *
         * @since 2.0
         */
-       static const long long NUM_OF_TICKS_IN_HOUR = 3600000;
+       static const long long NUM_OF_TICKS_IN_HOUR = 3600000LL;
 
        /**
         * A constant holding the number of ticks in a minute.
         *
         * @since 2.0
         */
-       static const long long NUM_OF_TICKS_IN_MINUTE = 60000;
+       static const long long NUM_OF_TICKS_IN_MINUTE = 60000LL;
 
        /**
         * A constant holding the number of ticks in a second.
         *
         * @since 2.0
         */
-       static const long long NUM_OF_TICKS_IN_SECOND = 1000;
+       static const long long NUM_OF_TICKS_IN_SECOND = 1000LL;
 
 private:
        //
index 729407f..43066df 100644 (file)
@@ -207,7 +207,7 @@ long long
 TimeSpan::GetHours(void) const
 {
        long long r = __ticks % NUM_OF_TICKS_IN_DAY;
-       if (r > 0)
+       if (r != 0)
        {
                return (long long) (r / NUM_OF_TICKS_IN_HOUR);
        }
@@ -218,10 +218,10 @@ long long
 TimeSpan::GetMinutes(void) const
 {
        long long r = __ticks % NUM_OF_TICKS_IN_DAY;
-       if (r > 0)
+       if (r != 0)
        {
                r = r % NUM_OF_TICKS_IN_HOUR;
-               if (r > 0)
+               if (r != 0)
                {
                        return (long long) (r / NUM_OF_TICKS_IN_MINUTE);
                }
@@ -234,13 +234,13 @@ long long
 TimeSpan::GetSeconds(void) const
 {
        long long r = __ticks % NUM_OF_TICKS_IN_DAY;
-       if (r > 0)
+       if (r != 0)
        {
                r = r % NUM_OF_TICKS_IN_HOUR;
-               if (r > 0)
+               if (r != 0)
                {
                        r = r % NUM_OF_TICKS_IN_MINUTE;
-                       if (r > 0)
+                       if (r != 0)
                        {
                                return (long long) (r / NUM_OF_TICKS_IN_SECOND);
                        }
@@ -255,13 +255,13 @@ long long
 TimeSpan::GetMilliseconds(void) const
 {
        long long r = __ticks % NUM_OF_TICKS_IN_DAY;
-       if (r > 0)
+       if (r != 0)
        {
                r = r % NUM_OF_TICKS_IN_HOUR;
-               if (r > 0)
+               if (r != 0)
                {
                        r = r % NUM_OF_TICKS_IN_MINUTE;
-                       if (r > 0)
+                       if (r != 0)
                        {
                                r = r % NUM_OF_TICKS_IN_SECOND;
                                return(r);