treewide: replace !strcmp() 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:40:50 +10:00
parent 7697ed0757
commit 95a84e797a
28 changed files with 239 additions and 221 deletions

View file

@ -28,6 +28,7 @@
#include <pipewire/pipewire.h>
#include <extensions/session-manager.h>
#include <spa/utils/string.h>
#include <spa/pod/builder.h>
#include <spa/pod/parser.h>
#include <spa/pod/filter.h>
@ -274,8 +275,8 @@ endpoint_event_info(void *object, const struct pw_endpoint_info *info)
spa_assert(info->id == pw_proxy_get_bound_id(d->bound_proxy));
spa_assert(info->id == pw_proxy_get_bound_id(d->export_proxy));
spa_assert(info->change_mask == PW_ENDPOINT_CHANGE_MASK_ALL);
spa_assert(!strcmp(info->name, "test-endpoint"));
spa_assert(!strcmp(info->media_class, "Audio/Sink"));
spa_assert(spa_streq(info->name, "test-endpoint"));
spa_assert(spa_streq(info->media_class, "Audio/Sink"));
spa_assert(info->direction == PW_DIRECTION_OUTPUT);
spa_assert(info->n_streams == 0);
spa_assert(info->session_id == SPA_ID_INVALID);
@ -287,9 +288,9 @@ endpoint_event_info(void *object, const struct pw_endpoint_info *info)
spa_assert(info->params[1].flags == param_info[1].flags);
spa_assert(info->props != NULL);
val = spa_dict_lookup(info->props, PW_KEY_ENDPOINT_NAME);
spa_assert(val && !strcmp(val, "test-endpoint"));
spa_assert(val && spa_streq(val, "test-endpoint"));
val = spa_dict_lookup(info->props, PW_KEY_MEDIA_CLASS);
spa_assert(val && !strcmp(val, "Audio/Sink"));
spa_assert(val && spa_streq(val, "Audio/Sink"));
d->info_received = true;
pw_main_loop_quit(d->loop);
@ -352,9 +353,9 @@ test_endpoint_global(void *object, uint32_t id,
spa_assert(props != NULL);
val = spa_dict_lookup(props, PW_KEY_ENDPOINT_NAME);
spa_assert(val && !strcmp(val, "test-endpoint"));
spa_assert(val && spa_streq(val, "test-endpoint"));
val = spa_dict_lookup(props, PW_KEY_MEDIA_CLASS);
spa_assert(val && !strcmp(val, "Audio/Sink"));
spa_assert(val && spa_streq(val, "Audio/Sink"));
pw_endpoint_add_listener(d->bound_proxy, &d->object_listener,
&endpoint_events, d);