treewide: drop strzcmp implementations in favor of spa_streq

This commit is contained in:
Peter Hutterer 2021-05-18 11:50:44 +10:00
parent 92514d57e4
commit 4e70799922
4 changed files with 9 additions and 45 deletions

View file

@ -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++;