mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-15 08:56:38 -05:00
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:
parent
95a84e797a
commit
522f87d5ea
40 changed files with 83 additions and 79 deletions
|
|
@ -869,7 +869,7 @@ static int hdmi_eld_changed(snd_mixer_elem_t *melem, unsigned int mask)
|
|||
changed |= old_monitor_name != NULL;
|
||||
pa_proplist_unset(p->proplist, PA_PROP_DEVICE_PRODUCT_NAME);
|
||||
} else {
|
||||
changed |= (old_monitor_name == NULL) || (strcmp(old_monitor_name, eld.monitor_name) != 0);
|
||||
changed |= (old_monitor_name == NULL) || (!spa_streq(old_monitor_name, eld.monitor_name));
|
||||
pa_proplist_sets(p->proplist, PA_PROP_DEVICE_PRODUCT_NAME, eld.monitor_name);
|
||||
}
|
||||
pa_proplist_as_dict(p->proplist, &p->port.props);
|
||||
|
|
|
|||
|
|
@ -477,10 +477,10 @@ static DBusHandlerResult audio_agent_get_property(DBusConnection *conn, DBusMess
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if (strcmp(interface, HSPHFPD_AUDIO_AGENT_INTERFACE) != 0)
|
||||
if (!spa_streq(interface, HSPHFPD_AUDIO_AGENT_INTERFACE))
|
||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
|
||||
if (strcmp(property, "AgentCodec") != 0) {
|
||||
if (!spa_streq(property, "AgentCodec")) {
|
||||
r = dbus_message_new_error(m, DBUS_ERROR_INVALID_ARGS, "Invalid property in method call");
|
||||
goto fail;
|
||||
}
|
||||
|
|
@ -536,7 +536,7 @@ static DBusHandlerResult audio_agent_getall_properties(DBusConnection *conn, DBu
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if (strcmp(interface, HSPHFPD_AUDIO_AGENT_INTERFACE) != 0)
|
||||
if (!spa_streq(interface, HSPHFPD_AUDIO_AGENT_INTERFACE))
|
||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
|
||||
if ((r = dbus_message_new_method_return(m)) == NULL)
|
||||
|
|
@ -593,7 +593,7 @@ static DBusHandlerResult hsphfpd_new_audio_connection(DBusConnection *conn, DBus
|
|||
spa_log_debug(backend->log, NAME": NewConnection %s, fd %d", transport_path, fd);
|
||||
|
||||
sender = dbus_message_get_sender(m);
|
||||
if (strcmp(sender, backend->hsphfpd_service_id) != 0) {
|
||||
if (!spa_streq(sender, backend->hsphfpd_service_id)) {
|
||||
close(fd);
|
||||
spa_log_error(backend->log, NAME": Sender '%s' is not authorized", sender);
|
||||
r = dbus_message_new_error_printf(m, HSPHFPD_ERROR_REJECTED, "Sender '%s' is not authorized", sender);
|
||||
|
|
@ -872,7 +872,7 @@ static void hsphfpd_audio_acquire_reply(DBusPendingCall *pending, void *user_dat
|
|||
goto finish;
|
||||
}
|
||||
|
||||
if (strcmp(dbus_message_get_sender(r), backend->hsphfpd_service_id) != 0) {
|
||||
if (!spa_streq(dbus_message_get_sender(r), backend->hsphfpd_service_id)) {
|
||||
spa_log_error(backend->log, NAME": Reply for " HSPHFPD_ENDPOINT_INTERFACE ".ConnectAudio() from invalid sender");
|
||||
goto finish;
|
||||
}
|
||||
|
|
@ -891,7 +891,7 @@ static void hsphfpd_audio_acquire_reply(DBusPendingCall *pending, void *user_dat
|
|||
goto finish;
|
||||
}
|
||||
|
||||
if (strcmp(service_id, dbus_bus_get_unique_name(backend->conn)) != 0) {
|
||||
if (!spa_streq(service_id, dbus_bus_get_unique_name(backend->conn))) {
|
||||
spa_log_warn(backend->log, HSPHFPD_ENDPOINT_INTERFACE ".ConnectAudio() failed: Other audio application took audio socket");
|
||||
goto finish;
|
||||
}
|
||||
|
|
@ -1200,7 +1200,7 @@ static void hsphfpd_get_endpoints_reply(DBusPendingCall *pending, void *user_dat
|
|||
goto finish;
|
||||
}
|
||||
|
||||
if (strcmp(dbus_message_get_sender(r), backend->hsphfpd_service_id) != 0) {
|
||||
if (!spa_streq(dbus_message_get_sender(r), backend->hsphfpd_service_id)) {
|
||||
spa_log_error(backend->log, NAME": Reply for GetManagedObjects() from invalid sender");
|
||||
goto finish;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -559,7 +559,7 @@ static void ofono_getcards_reply(DBusPendingCall *pending, void *user_data)
|
|||
goto finish;
|
||||
}
|
||||
|
||||
if (!dbus_message_iter_init(r, &i) || strcmp(dbus_message_get_signature(r), "a(oa{sv})") != 0) {
|
||||
if (!dbus_message_iter_init(r, &i) || !spa_streq(dbus_message_get_signature(r), "a(oa{sv})")) {
|
||||
spa_log_error(backend->log, NAME": Invalid arguments in GetCards() reply");
|
||||
goto finish;
|
||||
}
|
||||
|
|
@ -682,7 +682,7 @@ static DBusHandlerResult ofono_filter_cb(DBusConnection *bus, DBusMessage *m, vo
|
|||
char *p;
|
||||
DBusMessageIter arg_i, props_i;
|
||||
|
||||
if (!dbus_message_iter_init(m, &arg_i) || strcmp(dbus_message_get_signature(m), "oa{sv}") != 0) {
|
||||
if (!dbus_message_iter_init(m, &arg_i) || !spa_streq(dbus_message_get_signature(m), "oa{sv}")) {
|
||||
spa_log_error(backend->log, NAME": Failed to parse org.ofono.HandsfreeAudioManager.CardAdded");
|
||||
goto fail;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3281,7 +3281,7 @@ static void get_managed_objects_reply(DBusPendingCall *pending, void *user_data)
|
|||
}
|
||||
|
||||
if (!dbus_message_iter_init(r, &it[0]) ||
|
||||
strcmp(dbus_message_get_signature(r), "a{oa{sa{sv}}}") != 0) {
|
||||
!spa_streq(dbus_message_get_signature(r), "a{oa{sa{sv}}}")) {
|
||||
spa_log_error(monitor->log, "Invalid reply signature for GetManagedObjects()");
|
||||
goto finish;
|
||||
}
|
||||
|
|
@ -3427,7 +3427,7 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *m, void *us
|
|||
if (!monitor->objects_listed)
|
||||
goto finish;
|
||||
|
||||
if (!dbus_message_iter_init(m, &it) || strcmp(dbus_message_get_signature(m), "oa{sa{sv}}") != 0) {
|
||||
if (!dbus_message_iter_init(m, &it) || !spa_streq(dbus_message_get_signature(m), "oa{sa{sv}}")) {
|
||||
spa_log_error(monitor->log, NAME": Invalid signature found in InterfacesAdded");
|
||||
goto finish;
|
||||
}
|
||||
|
|
@ -3441,7 +3441,7 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *m, void *us
|
|||
if (!monitor->objects_listed)
|
||||
goto finish;
|
||||
|
||||
if (!dbus_message_iter_init(m, &it) || strcmp(dbus_message_get_signature(m), "oas") != 0) {
|
||||
if (!dbus_message_iter_init(m, &it) || !spa_streq(dbus_message_get_signature(m), "oas")) {
|
||||
spa_log_error(monitor->log, NAME": Invalid signature found in InterfacesRemoved");
|
||||
goto finish;
|
||||
}
|
||||
|
|
@ -3455,7 +3455,7 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *m, void *us
|
|||
goto finish;
|
||||
|
||||
if (!dbus_message_iter_init(m, &it[0]) ||
|
||||
strcmp(dbus_message_get_signature(m), "sa{sv}as") != 0) {
|
||||
!spa_streq(dbus_message_get_signature(m), "sa{sv}as")) {
|
||||
spa_log_error(monitor->log, "Invalid signature found in PropertiesChanged");
|
||||
goto finish;
|
||||
}
|
||||
|
|
@ -3779,7 +3779,7 @@ static int parse_codec_array(struct spa_bt_monitor *this, const struct spa_dict
|
|||
for (i = 0; a2dp_codecs[i]; ++i) {
|
||||
const struct a2dp_codec *codec = a2dp_codecs[i];
|
||||
|
||||
if (strcmp(codec->name, codec_name) != 0)
|
||||
if (!spa_streq(codec->name, codec_name))
|
||||
continue;
|
||||
|
||||
if (spa_dict_lookup_item(&this->enabled_codecs, codec->name) != NULL)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue