treewide: replace strcmp() != 0 with !spa_streq

This change is only done in source files for now, header files will be done
separately.
This commit is contained in:
Peter Hutterer 2021-05-18 11:43:49 +10:00
parent 95a84e797a
commit 522f87d5ea
40 changed files with 83 additions and 79 deletions

View file

@ -1735,7 +1735,7 @@ static bool do_permissions(struct data *data, const char *cmd, char *args, char
*error = spa_aprintf("%s: unknown global %d", cmd, id);
return false;
}
if (strcmp(global->type, PW_TYPE_INTERFACE_Client) != 0) {
if (!spa_streq(global->type, PW_TYPE_INTERFACE_Client)) {
*error = spa_aprintf("object %d is not a client", atoi(a[0]));
return false;
}
@ -1775,7 +1775,7 @@ static bool do_get_permissions(struct data *data, const char *cmd, char *args, c
*error = spa_aprintf("%s: unknown global %d", cmd, id);
return false;
}
if (strcmp(global->type, PW_TYPE_INTERFACE_Client) != 0) {
if (!spa_streq(global->type, PW_TYPE_INTERFACE_Client)) {
*error = spa_aprintf("object %d is not a client", atoi(a[0]));
return false;
}

View file

@ -93,11 +93,11 @@ static void registry_event_global(void *data, uint32_t id, uint32_t permissions,
struct data *d = data;
const char *str;
if (strcmp(type, PW_TYPE_INTERFACE_Metadata) != 0)
if (!spa_streq(type, PW_TYPE_INTERFACE_Metadata))
return;
if ((str = spa_dict_lookup(props, PW_KEY_METADATA_NAME)) != NULL &&
strcmp(str, d->opt_name) != 0)
!spa_streq(str, d->opt_name))
return;
if (d->metadata != NULL) {

View file

@ -475,7 +475,7 @@ static void registry_event_global(void *data, uint32_t id,
struct data *d = data;
struct pw_proxy *proxy;
if (strcmp(type, PW_TYPE_INTERFACE_Profiler) != 0)
if (!spa_streq(type, PW_TYPE_INTERFACE_Profiler))
return;
if (d->profiler != NULL) {