8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.146 2005/07/24 04:37:07 momjian Exp $
11
+ * $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.147 2005/07/30 18:20:44 momjian Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -1915,8 +1915,7 @@ interval_justify_hours(PG_FUNCTION_ARGS)
1915
1915
1916
1916
#ifdef HAVE_INT64_TIMESTAMP
1917
1917
result -> time += span -> day * USECS_PER_DAY ;
1918
- result -> day = result -> time / USECS_PER_DAY ;
1919
- result -> time -= result -> day * USECS_PER_DAY ;
1918
+ TMODULO (result -> time , result -> day , USECS_PER_DAY );
1920
1919
#else
1921
1920
result -> time += span -> day * (double )SECS_PER_DAY ;
1922
1921
TMODULO (result -> time , result -> day , (double )SECS_PER_DAY );
@@ -1939,14 +1938,8 @@ interval_justify_days(PG_FUNCTION_ARGS)
1939
1938
result -> day = span -> day ;
1940
1939
result -> time = span -> time ;
1941
1940
1942
- #ifdef HAVE_INT64_TIMESTAMP
1943
- result -> day += span -> month * (double )DAYS_PER_MONTH ;
1944
- result -> month = span -> day / DAYS_PER_MONTH ;
1945
- result -> day -= result -> month * DAYS_PER_MONTH ;
1946
- #else
1947
- result -> day += span -> month * (double )DAYS_PER_MONTH ;
1948
- TMODULO (result -> day , result -> month , (double )DAYS_PER_MONTH );
1949
- #endif
1941
+ result -> day += span -> month * DAYS_PER_MONTH ;
1942
+ TMODULO (result -> day , result -> month , DAYS_PER_MONTH );
1950
1943
1951
1944
PG_RETURN_INTERVAL_P (result );
1952
1945
}
0 commit comments