Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
9a973a00
Commit
9a973a00
authored
Jan 02, 2019
by
Uwe Schulzweida
Browse files
timecache_t: changed type of variable from int to size_t.
parent
5b5eb7b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/basetime.h
View file @
9a973a00
...
...
@@ -7,9 +7,9 @@
#define MAX_TIMECACHE_SIZE 1024
typedef
struct
{
in
t
size
;
in
t
startid
;
in
t
maxvals
;
size_
t
size
;
size_
t
startid
;
size_
t
maxvals
;
double
cache
[
MAX_TIMECACHE_SIZE
];
}
timecache_t
;
...
...
src/stream_cdf_i.c
View file @
9a973a00
...
...
@@ -4128,13 +4128,14 @@ double get_timevalue(int fileID, int nctimevarid, int tsID, timecache_t *tcache)
{
if
(
tcache
->
size
==
0
||
(
tsID
<
tcache
->
startid
||
tsID
>
(
tcache
->
startid
+
tcache
->
size
-
1
))
)
{
in
t
maxvals
=
MAX_TIMECACHE_SIZE
;
size_
t
maxvals
=
MAX_TIMECACHE_SIZE
;
tcache
->
startid
=
(
tsID
/
MAX_TIMECACHE_SIZE
)
*
MAX_TIMECACHE_SIZE
;
if
(
(
tcache
->
startid
+
maxvals
)
>
tcache
->
maxvals
)
maxvals
=
(
tcache
->
maxvals
)
%
MAX_TIMECACHE_SIZE
;
tcache
->
size
=
maxvals
;
size_t
index
=
(
size_t
)
tcache
->
startid
;
// fprintf(stderr, "fill time cache: %d %d %d %d %d\n", tcache->maxvals, tsID, tcache->startid, tcache->startid+maxvals-1, maxvals);
for
(
int
ival
=
0
;
ival
<
maxvals
;
++
ival
)
//fprintf(stderr, "fill time cache: %d %d %d %d %d\n", tcache->maxvals, tsID, tcache->startid, tcache->startid+maxvals-1, maxvals);
//cdf_get_vara_double(fileID, nctimevarid, &tcache->startid, &maxvals, tcache->cache);
size_t
index
=
tcache
->
startid
;
for
(
size_t
ival
=
0
;
ival
<
maxvals
;
++
ival
)
{
cdf_get_var1_double
(
fileID
,
nctimevarid
,
&
index
,
&
timevalue
);
tcache
->
cache
[
ival
]
=
timevalue
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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