mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-06-06 03:02:54 -04:00
pipewire: properties: rename add_func to add_item
In order to be consistent with `clear_item()` and `remove_item()`, rename `add_func()` to `add_item()`.
This commit is contained in:
parent
71c5fe0af6
commit
be10eb8499
1 changed files with 4 additions and 5 deletions
|
|
@ -39,7 +39,7 @@ struct properties {
|
|||
};
|
||||
/** \endcond */
|
||||
|
||||
static int add_func(struct pw_properties *this, char *key, char *value)
|
||||
static int add_item(struct pw_properties *this, char *key, char *value)
|
||||
{
|
||||
struct spa_dict_item *item;
|
||||
struct properties *impl = SPA_CONTAINER_OF(this, struct properties, this);
|
||||
|
|
@ -125,7 +125,7 @@ struct pw_properties *pw_properties_new(const char *key, ...)
|
|||
while (key != NULL) {
|
||||
value = va_arg(varargs, char *);
|
||||
if (value && key[0])
|
||||
add_func(&impl->this, strdup(key), strdup(value));
|
||||
add_item(&impl->this, strdup(key), strdup(value));
|
||||
key = va_arg(varargs, char *);
|
||||
}
|
||||
va_end(varargs);
|
||||
|
|
@ -152,8 +152,7 @@ struct pw_properties *pw_properties_new_dict(const struct spa_dict *dict)
|
|||
|
||||
spa_dict_for_each(it, dict) {
|
||||
if (it->key != NULL && it->key[0] && it->value != NULL)
|
||||
add_func(&impl->this, strdup(it->key),
|
||||
strdup(it->value));
|
||||
add_item(&impl->this, strdup(it->key), strdup(it->value));
|
||||
}
|
||||
|
||||
SPA_FLAG_UPDATE(impl->this.dict.flags, SPA_DICT_FLAG_SORTED,
|
||||
|
|
@ -406,7 +405,7 @@ static int do_replace(struct pw_properties *properties, const char *key, char *v
|
|||
if (item == NULL) {
|
||||
if (value == NULL)
|
||||
return 0;
|
||||
add_func(properties, strdup(key), copy ? strdup(value) : value);
|
||||
add_item(properties, strdup(key), copy ? strdup(value) : value);
|
||||
SPA_FLAG_CLEAR(properties->dict.flags, SPA_DICT_FLAG_SORTED);
|
||||
} else {
|
||||
if (value && spa_streq(item->value, value))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue