diff --git a/spa/examples/adapter-control.c b/spa/examples/adapter-control.c index 87002e54f..af6f41f86 100644 --- a/spa/examples/adapter-control.c +++ b/spa/examples/adapter-control.c @@ -48,6 +48,7 @@ #include #include #include +#include static SPA_LOG_IMPL(default_log); @@ -127,7 +128,7 @@ static int load_handle(struct data *data, struct spa_handle **handle, const char } if (factory->version < 1) continue; - if (strcmp(factory->name, name)) + if (!spa_streq(factory->name, name)) continue; *handle = calloc(1, spa_handle_factory_get_size(factory, NULL)); @@ -239,7 +240,7 @@ static int make_node(struct data *data, struct spa_node **node, const char *lib, } if (factory->version < 1) continue; - if (strcmp(factory->name, name)) + if (!spa_streq(factory->name, name)) continue; handle = calloc(1, spa_handle_factory_get_size(factory, NULL)); diff --git a/spa/examples/example-control.c b/spa/examples/example-control.c index 29052f520..3eedc8710 100644 --- a/spa/examples/example-control.c +++ b/spa/examples/example-control.c @@ -45,6 +45,7 @@ #include #include #include +#include #define M_PI_M2 ( M_PI + M_PI ) @@ -171,7 +172,7 @@ static int make_node(struct data *data, struct spa_node **node, const char *lib, } if (factory->version < 1) continue; - if (strcmp(factory->name, name)) + if (!spa_streq(factory->name, name)) continue; handle = calloc(1, spa_handle_factory_get_size(factory, NULL)); @@ -456,7 +457,7 @@ static int load_handle(struct data *data, struct spa_handle **handle, const char } if (factory->version < 1) continue; - if (strcmp(factory->name, name)) + if (!spa_streq(factory->name, name)) continue; *handle = calloc(1, spa_handle_factory_get_size(factory, NULL)); diff --git a/spa/examples/local-libcamera.c b/spa/examples/local-libcamera.c index 8bd66ff9d..17fed5981 100644 --- a/spa/examples/local-libcamera.c +++ b/spa/examples/local-libcamera.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -129,7 +130,7 @@ static int load_handle(struct data *data, struct spa_handle **handle, const char printf("can't enumerate factories: %s\n", spa_strerror(res)); break; } - if (strcmp(factory->name, name)) + if (!spa_streq(factory->name, name)) continue; *handle = calloc(1, spa_handle_factory_get_size(factory, NULL)); diff --git a/spa/examples/local-v4l2.c b/spa/examples/local-v4l2.c index 7cb6aadc3..6968d3af7 100644 --- a/spa/examples/local-v4l2.c +++ b/spa/examples/local-v4l2.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -122,7 +123,7 @@ static int load_handle(struct data *data, struct spa_handle **handle, const char } if (factory->version < 1) continue; - if (strcmp(factory->name, name)) + if (!spa_streq(factory->name, name)) continue; *handle = calloc(1, spa_handle_factory_get_size(factory, NULL)); diff --git a/spa/plugins/bluez5/bluez5-dbus.c b/spa/plugins/bluez5/bluez5-dbus.c index 0c6cc2de3..04684e20b 100644 --- a/spa/plugins/bluez5/bluez5-dbus.c +++ b/spa/plugins/bluez5/bluez5-dbus.c @@ -514,11 +514,11 @@ static struct spa_bt_adapter *adapter_find(struct spa_bt_monitor *monitor, const static bool check_iter_signature(DBusMessageIter *it, const char *sig) { char *v; - int res; + bool res; v = dbus_message_iter_get_signature(it); - res = strcmp(v, sig); + res = spa_streq(v, sig); dbus_free(v); - return res == 0; + return res; } static int adapter_update_props(struct spa_bt_adapter *adapter, diff --git a/src/examples/media-session/alsa-monitor.c b/src/examples/media-session/alsa-monitor.c index 7a8cc256b..a9f2cbcaa 100644 --- a/src/examples/media-session/alsa-monitor.c +++ b/src/examples/media-session/alsa-monitor.c @@ -395,11 +395,11 @@ static struct node *alsa_create_node(struct device *device, uint32_t id, pw_properties_set(node->props, PW_KEY_NODE_DESCRIPTION, sm_media_session_sanitize_description(tmp, sizeof(tmp), ' ', "%s %s", desc, profile_desc)); - } else if (strcmp(subdev, "0")) { + } else if (!spa_streq(subdev, "0")) { pw_properties_set(node->props, PW_KEY_NODE_DESCRIPTION, sm_media_session_sanitize_description(tmp, sizeof(tmp), ' ', "%s (%s %s)", desc, name, subdev)); - } else if (strcmp(dev, "0")) { + } else if (!spa_streq(dev, "0")) { pw_properties_set(node->props, PW_KEY_NODE_DESCRIPTION, sm_media_session_sanitize_description(tmp, sizeof(tmp), ' ', "%s (%s)", desc, name)); diff --git a/src/tools/pw-cli.c b/src/tools/pw-cli.c index cee33900c..f635ddd38 100644 --- a/src/tools/pw-cli.c +++ b/src/tools/pw-cli.c @@ -1968,7 +1968,7 @@ children_of(struct remote_data *rd, uint32_t parent_id, global = item->data; - if (strcmp(global->type, child_type)) + if (!spa_streq(global->type, child_type)) continue; pd = pw_proxy_get_user_data(global->proxy); @@ -1983,7 +1983,7 @@ children_of(struct remote_data *rd, uint32_t parent_id, } /* match? */ - if (strcmp(parent_value, child_value)) + if (!spa_streq(parent_value, child_value)) continue; if (*children)