props: improve unset mask

Add support for more than 32 properties
This commit is contained in:
Wim Taymans 2016-08-29 10:44:41 +02:00
parent c8830adaa3
commit 80ed927885
2 changed files with 19 additions and 4 deletions

View file

@ -46,7 +46,7 @@ spa_props_set_prop (SpaProps *props,
memcpy (SPA_MEMBER (props, info->offset, void), value->value, value->size);
props->unset_mask &= ~(1u << index);
SPA_PROPS_INDEX_SET (props, index);
return SPA_RESULT_OK;
}
@ -68,7 +68,7 @@ spa_props_get_prop (const SpaProps *props,
if ((info->flags & SPA_PROP_FLAG_READABLE) == 0)
return SPA_RESULT_INVALID_PROPERTY_ACCESS;
if (props->unset_mask & (1u << index))
if (SPA_PROPS_INDEX_IS_UNSET (props, index))
return SPA_RESULT_PROPERTY_UNSET;
value->type = info->type;
@ -103,7 +103,7 @@ spa_props_copy (const SpaProps *src,
memcpy (SPA_MEMBER (dest, info->offset, void), value.value, value.size);
dest->unset_mask &= ~(1u << i);
SPA_PROPS_INDEX_SET (dest, i);
}
return SPA_RESULT_OK;
}