Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
c1765046
Commit
c1765046
authored
Jan 16, 2015
by
Uwe Schulzweida
Browse files
cdiDecodeTimevalue: round seconds for TUNIT_SECOND (bug fix)
parent
4e583dea
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
c1765046
...
...
@@ -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)
...
...
src/taxis.c
View file @
c1765046
...
...
@@ -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
;
};
/*
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment