Blank line adjustments.
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/nabstime.c,v 1.134 2005/06/29 22:51:56 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/nabstime.c,v 1.135 2005/07/12 16:04:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifdef HAVE_INT64_TIMESTAMP
int64 span;
-
#else
double span;
#endif
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.183 2005/06/29 22:51:56 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.184 2005/07/12 16:04:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifdef HAVE_INT64_TIMESTAMP
if (interval->status != 0)
- return ((interval->data[1] - interval->data[0]) *1000000.0);
+ return ((interval->data[1] - interval->data[0]) * 1000000.0);
#else
if (interval->status != 0)
return interval->data[1] - interval->data[0];
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.131 2005/07/12 15:17:44 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.132 2005/07/12 16:04:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifdef HAVE_INT64_TIMESTAMP
static int64 time2t(const int hour, const int min, const int sec, const fsec_t fsec);
-
#else
static double time2t(const int hour, const int min, const int sec, const fsec_t fsec);
#endif
PG_RETURN_INTERVAL_P(result);
}
-
+/*
+ * Adjust interval for specified precision, in both YEAR to SECOND
+ * range and sub-second precision.
+ */
static void
AdjustIntervalForTypmod(Interval *interval, int32 typmod)
{
{
#ifdef HAVE_INT64_TIMESTAMP
int64 day;
-
#else
double day;
#endif
{
#ifdef HAVE_INT64_TIMESTAMP
int64 hour;
-
#else
double hour;
#endif
else
elog(ERROR, "unrecognized interval typmod: %d", typmod);
- /* Need to adjust precision? If not, don't even try! */
+ /* Need to adjust subsecond precision? */
if (precision != INTERVAL_FULL_PRECISION)
{
if (precision < 0 || precision > MAX_INTERVAL_PRECISION)
{
#ifdef HAVE_INT64_TIMESTAMP
int64 time;
-
#else
double time;
#endif
#ifdef HAVE_INT64_TIMESTAMP
int date;
int64 time;
-
#else
double date,
time;
{
#ifdef HAVE_INT64_TIMESTAMP
int64 time;
-
#else
double time;
#endif
#ifdef HAVE_INT64_TIMESTAMP
int64 span1,
span2;
-
#else
double span1,
span2;
#ifdef HAVE_INT64_TIMESTAMP
int64 months;
-
#else
double months;
#endif
{
#ifdef HAVE_INT64_TIMESTAMP
int64 time;
-
#else
double time;
#endif
sec = (*fsec / USECS_PER_SEC);
*fsec -= (sec * USECS_PER_SEC);
#else
- TMODULO(*fsec, sec, 1e0);
+ TMODULO(*fsec, sec, 1.0);
#endif
tm->tm_sec += sec;
}
{
#ifdef HAVE_INT64_TIMESTAMP
int64 time;
-
#else
double time;
#endif
*fsec = (time - (tm->tm_sec * USECS_PER_SEC));
#else
TMODULO(time, tm->tm_mday, (double)SECS_PER_DAY);
- TMODULO(time, tm->tm_hour, 3600e0);
- TMODULO(time, tm->tm_min, 60e0);
- TMODULO(time, tm->tm_sec, 1e0);
+ TMODULO(time, tm->tm_hour, 3600.0);
+ TMODULO(time, tm->tm_min, 60.0);
+ TMODULO(time, tm->tm_sec, 1.0);
*fsec = time;
#endif
{
#ifdef HAVE_INT64_TIMESTAMP
int64 time;
-
#else
double time;
#endif
int dDate,
date0;
int64 time;
-
#else
double dDate,
date0;
#ifdef HAVE_INT64_TIMESTAMP
int64 noresult = 0;
-
#else
double noresult = 0.0;
#endif
break;
case 's':
#ifdef HAVE_INT64_TIMESTAMP
- replace_val.int64_val = (*ts - SetEpochTimestamp()) / 1000000e0;
+ replace_val.int64_val = (*ts - SetEpochTimestamp()) / 1000000.0;
replace_type = PGTYPES_TYPE_INT64;
#else
replace_val.double_val = *ts - SetEpochTimestamp();