Commit c1765046 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cdiDecodeTimevalue: round seconds for TUNIT_SECOND (bug fix)

parent 4e583dea
......@@ -2,6 +2,10 @@
* Version 1.6.8 released
2015-01-16 Uwe Schulzweida
* cdiDecodeTimevalue: round seconds for TUNIT_SECOND (bug fix)
2015-01-12 Uwe Schulzweida
* cdfCreateRecords: call cdfCreateRecords(streamptr, 1) if not done before (bug fix)
......
......@@ -533,7 +533,7 @@ void taxisDefForecastPeriod(int taxisID, double fc_period)
{
taxis_t *taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
if (taxisptr->fc_period != fc_period)
if ( IS_NOT_EQUAL(taxisptr->fc_period, fc_period) )
{
taxisptr->fc_period = fc_period;
reshSetStatus(taxisID, &taxisOps, RESH_DESYNC_IN_USE);
......@@ -919,10 +919,14 @@ ptaxisDefLongname(taxis_t *taxisptr, const char *longname)
}
}
void cdiDecodeTimevalue(int timeunit, double timevalue, int *days, int *secs)
{
static int lwarn = TRUE;
*days = 0;
*secs = 0;
if ( timeunit == TUNIT_MINUTE )
{
timevalue *= 60;
......@@ -937,7 +941,7 @@ void cdiDecodeTimevalue(int timeunit, double timevalue, int *days, int *secs)
if ( timeunit == TUNIT_SECOND )
{
*days = (int) (timevalue/86400);
*secs = (int) (timevalue - *days*86400.);
*secs = (int) (timevalue - *days*86400. + 0.5);
if ( *secs < 0 ) { *days -= 1; *secs += 86400; };
/*
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment