Commit b64491fa authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cdi_key_compare: completed.

parent 15c7ddaf
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment