Skip to content
GitLab
Menu
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
e4a93678
Commit
e4a93678
authored
Apr 08, 2016
by
Thomas Jahns
🤸
Browse files
Clarify assignments.
parent
2d904613
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/stream_cdf.c
View file @
e4a93678
...
...
@@ -177,19 +177,16 @@ bool isTimeUnits(const char *timeunits)
static
bool
isTimeAxisUnits
(
const
char
*
timeunits
)
{
char
*
ptu
,
*
tu
;
int
timetype
=
-
1
;
int
timeunit
;
bool
status
=
false
;
size_t
len
=
strlen
(
timeunits
);
tu
=
(
char
*
)
Malloc
((
len
+
1
)
*
sizeof
(
char
));
char
*
tu
=
(
char
*
)
Malloc
((
len
+
1
)
*
sizeof
(
char
));
memcpy
(
tu
,
timeunits
,
(
len
+
1
)
*
sizeof
(
char
));
ptu
=
tu
;
char
*
ptu
=
tu
;
for
(
size_t
i
=
0
;
i
<
len
;
i
++
)
ptu
[
i
]
=
(
char
)
tolower
((
int
)
ptu
[
i
]);
timeunit
=
get_timeunit
(
len
,
ptu
);
int
timeunit
=
get_timeunit
(
len
,
ptu
);
if
(
timeunit
!=
-
1
)
{
...
...
@@ -198,12 +195,10 @@ bool isTimeAxisUnits(const char *timeunits)
{
while
(
isspace
(
*
ptu
)
)
ptu
++
;
if
(
memcmp
(
ptu
,
"as"
,
2
)
==
0
)
timetype
=
TAXIS_ABSOLUTE
;
else
if
(
memcmp
(
ptu
,
"since"
,
5
)
==
0
)
timetype
=
TAXIS_RELATIVE
;
int
timetype
=
memcmp
(
ptu
,
"as"
,
2
)
==
0
?
TAXIS_ABSOLUTE
:
memcmp
(
ptu
,
"since"
,
5
)
==
0
?
TAXIS_RELATIVE
:
-
1
;
if
(
timetype
!=
-
1
)
status
=
true
;
status
=
timetype
!=
-
1
;
}
}
...
...
Write
Preview
Supports
Markdown
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