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
b64491fa
Commit
b64491fa
authored
Nov 12, 2019
by
Uwe Schulzweida
Browse files
cdi_key_compare: completed.
parent
15c7ddaf
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cdi_key.c
View file @
b64491fa
...
...
@@ -100,9 +100,23 @@ int cdi_key_compare(cdi_keys_t *keyspa, cdi_keys_t *keyspb, int keynum)
cdi_key_t
*
keypa
=
keyspa
->
value
+
keynum
,
*
keypb
=
keyspb
->
value
+
keynum
;
if
(
keypa
->
key
!=
keypb
->
key
)
return
1
;
if
(
keypa
->
key
!=
keypb
->
key
)
return
1
;
if
(
keypa
->
v
.
i
!=
keypb
->
v
.
i
)
return
1
;
if
(
keypa
->
type
!=
keypb
->
type
)
return
1
;
if
(
keypa
->
type
==
KEY_BYTES
)
{
if
(
keypa
->
length
!=
keypb
->
length
)
return
1
;
return
memcmp
(
keypa
->
v
.
s
,
keypb
->
v
.
s
,
keypa
->
length
);
}
else
if
(
keypa
->
type
==
KEY_FLOAT
)
{
if
(
IS_NOT_EQUAL
(
keypa
->
v
.
d
,
keypb
->
v
.
d
))
return
1
;
}
else
if
(
keypa
->
type
==
KEY_INT
)
{
if
(
keypa
->
v
.
i
!=
keypb
->
v
.
i
)
return
1
;
}
return
0
;
}
...
...
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