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
a8e0e58e
Commit
a8e0e58e
authored
Jan 13, 2010
by
Uwe Schulzweida
Browse files
No commit message
No commit message
parent
3cf1606f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/varscan.c
View file @
a8e0e58e
...
...
@@ -338,6 +338,7 @@ typedef struct
{
int
varid
;
int
param
;
int
ltype
;
}
param_t
;
...
...
@@ -349,8 +350,22 @@ int cmpparam(const void *s1, const void *s2)
param_t
*
x
=
(
param_t
*
)
s1
;
param_t
*
y
=
(
param_t
*
)
s2
;
if
(
x
->
param
<
y
->
param
)
cmp
=
1
;
else
if
(
x
->
param
>
y
->
param
)
cmp
=
-
1
;
if
(
x
->
param
>
y
->
param
)
cmp
=
1
;
else
if
(
x
->
param
<
y
->
param
)
cmp
=
-
1
;
return
(
cmp
);
}
static
int
cmpltype
(
const
void
*
s1
,
const
void
*
s2
)
{
int
cmp
=
0
;
param_t
*
x
=
(
param_t
*
)
s1
;
param_t
*
y
=
(
param_t
*
)
s2
;
if
(
x
->
ltype
>
y
->
ltype
)
cmp
=
1
;
else
if
(
x
->
ltype
<
y
->
ltype
)
cmp
=
-
1
;
return
(
cmp
);
}
...
...
@@ -395,7 +410,9 @@ void cdiGenVars(int streamID)
{
varInfo
[
varid
]
->
varid
=
varids
[
varid
];
varInfo
[
varid
]
->
param
=
vartable
[
varid
].
param
;
varInfo
[
varid
]
->
ltype
=
vartable
[
varid
].
ltype
;
}
qsort
(
varInfo
[
0
],
nvars
,
sizeof
(
param_t
),
cmpltype
);
qsort
(
varInfo
[
0
],
nvars
,
sizeof
(
param_t
),
cmpparam
);
for
(
varid
=
0
;
varid
<
nvars
;
varid
++
)
{
...
...
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