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:36:13 +10:00
parent d8a9534a9a
commit 7697ed0757
130 changed files with 817 additions and 675 deletions

View file

@ -41,6 +41,7 @@
#include <spa/debug/types.h>
#include <spa/param/props.h>
#include <spa/utils/result.h>
#include <spa/utils/string.h>
#include <pipewire/pipewire.h>
@ -1105,30 +1106,30 @@ SND_PCM_PLUGIN_DEFINE_FUNC(pipewire)
const char *id;
if (snd_config_get_id(n, &id) < 0)
continue;
if (strcmp(id, "comment") == 0 || strcmp(id, "type") == 0 || strcmp(id, "hint") == 0)
if (spa_streq(id, "comment") || spa_streq(id, "type") || spa_streq(id, "hint"))
continue;
if (strcmp(id, "name") == 0) {
if (spa_streq(id, "name")) {
snd_config_get_string(n, &node_name);
continue;
}
if (strcmp(id, "server") == 0) {
if (spa_streq(id, "server")) {
snd_config_get_string(n, &server_name);
continue;
}
if (strcmp(id, "playback_node") == 0) {
if (spa_streq(id, "playback_node")) {
snd_config_get_string(n, &playback_node);
continue;
}
if (strcmp(id, "capture_node") == 0) {
if (spa_streq(id, "capture_node")) {
snd_config_get_string(n, &capture_node);
continue;
}
if (strcmp(id, "exclusive") == 0) {
if (spa_streq(id, "exclusive")) {
if (snd_config_get_bool(n))
flags |= PW_STREAM_FLAG_EXCLUSIVE;
continue;
}
if (strcmp(id, "rate") == 0) {
if (spa_streq(id, "rate")) {
long val;
if (snd_config_get_integer(n, &val) == 0)
@ -1137,7 +1138,7 @@ SND_PCM_PLUGIN_DEFINE_FUNC(pipewire)
SNDERR("%s: invalid type", id);
continue;
}
if (strcmp(id, "format") == 0) {
if (spa_streq(id, "format")) {
const char *str;
if (snd_config_get_string(n, &str) == 0) {
@ -1149,7 +1150,7 @@ SND_PCM_PLUGIN_DEFINE_FUNC(pipewire)
}
continue;
}
if (strcmp(id, "channels") == 0) {
if (spa_streq(id, "channels")) {
long val;
if (snd_config_get_integer(n, &val) == 0)
@ -1158,7 +1159,7 @@ SND_PCM_PLUGIN_DEFINE_FUNC(pipewire)
SNDERR("%s: invalid type", id);
continue;
}
if (strcmp(id, "period_bytes") == 0) {
if (spa_streq(id, "period_bytes")) {
long val;
if (snd_config_get_integer(n, &val) == 0)