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
b5d252af
Commit
b5d252af
authored
Dec 02, 2014
by
Thomas Jahns
🤸
Browse files
Simplify cgribexVarCompare.
parent
3c37b410
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/stream_cgribex.c
View file @
b5d252af
...
...
@@ -521,25 +521,19 @@ compvar_t cgribexVarSet(int param, int level1, int level2, int leveltype, int tr
return
(
compVar
);
}
static
int
cgribexVarCompare
(
compvar_t
compVar
,
record_t
record
,
int
flag
)
static
inline
int
cgribexVarCompare
(
compvar_t
compVar
,
record_t
record
,
int
flag
)
{
compvar_t
compVar0
;
compVar0
.
param
=
record
.
param
;
compVar0
.
level1
=
record
.
ilevel
;
compVar0
.
level2
=
record
.
ilevel2
;
compVar0
.
ltype
=
record
.
ltype
;
compVar0
.
tsteptype
=
record
.
tsteptype
;
if
(
flag
==
0
)
{
if
(
compVar0
.
tsteptype
==
TSTEP_INSTANT
&&
compVar
.
tsteptype
==
TSTEP_INSTANT3
)
compVar0
.
tsteptype
=
TSTEP_INSTANT3
;
if
(
compVar0
.
tsteptype
==
TSTEP_INSTANT3
&&
compVar
.
tsteptype
==
TSTEP_INSTANT
)
compVar0
.
tsteptype
=
TSTEP_INSTANT
;
}
int
rstatus
=
memcmp
(
&
compVar0
,
&
compVar
,
sizeof
(
compvar_t
));
int
tstepDiff
=
!
(
flag
==
0
&
(((
compVar
.
tsteptype
==
TSTEP_INSTANT
)
&
(
record
.
tsteptype
==
TSTEP_INSTANT3
))
|
((
compVar
.
tsteptype
==
TSTEP_INSTANT3
)
&
(
record
.
tsteptype
==
TSTEP_INSTANT
))))
&
(
compVar
.
tsteptype
!=
record
.
tsteptype
);
int
rstatus
=
(
compVar
.
param
!=
record
.
param
)
|
(
compVar
.
level1
!=
record
.
ilevel
)
|
(
compVar
.
level2
!=
record
.
ilevel2
)
|
(
compVar
.
ltype
!=
record
.
ltype
)
|
tstepDiff
;
return
(
rstatus
);
}
#endif
...
...
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