mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-11 13:30:07 -05:00
treewide: drop strzcmp implementations in favor of spa_streq
This commit is contained in:
parent
92514d57e4
commit
4e70799922
4 changed files with 9 additions and 45 deletions
|
|
@ -62,24 +62,15 @@ static void set_item(struct item *item, uint32_t subject, const char *key, const
|
|||
item->value = strdup(value);
|
||||
}
|
||||
|
||||
static inline int strzcmp(const char *s1, const char *s2)
|
||||
{
|
||||
if (s1 == s2)
|
||||
return 0;
|
||||
if (s1 == NULL || s2 == NULL)
|
||||
return 1;
|
||||
return strcmp(s1, s2);
|
||||
}
|
||||
|
||||
static int change_item(struct item *item, const char *type, const char *value)
|
||||
{
|
||||
int changed = 0;
|
||||
if (strzcmp(item->type, type) != 0) {
|
||||
if (!spa_streq(item->type, type)) {
|
||||
free((char*)item->type);
|
||||
item->type = type ? strdup(type) : NULL;
|
||||
changed++;
|
||||
}
|
||||
if (strzcmp(item->value, value) != 0) {
|
||||
if (!spa_streq(item->value, value)) {
|
||||
free((char*)item->value);
|
||||
item->value = value ? strdup(value) : NULL;
|
||||
changed++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue