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

@ -26,6 +26,8 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <spa/utils/string.h>
#define MAX_BUFFER 4096
static char *get_cpuinfo_line(char *cpuinfo, const char *tag)
@ -98,16 +100,16 @@ arm_init(struct impl *impl)
do {
#if defined (__aarch64__)
if (!strcmp(current, "asimd"))
if (spa_streq(current, "asimd"))
flags |= SPA_CPU_FLAG_NEON;
else if (!strcmp(current, "fp"))
else if (spa_streq(current, "fp"))
flags |= SPA_CPU_FLAG_VFPV3 | SPA_CPU_FLAG_VFP;
#else
if (!strcmp(current, "vfp"))
if (spa_streq(current, "vfp"))
flags |= SPA_CPU_FLAG_VFP;
else if (!strcmp(current, "neon"))
else if (spa_streq(current, "neon"))
flags |= SPA_CPU_FLAG_NEON;
else if (!strcmp(current, "vfpv3"))
else if (spa_streq(current, "vfpv3"))
flags |= SPA_CPU_FLAG_VFPV3;
#endif
} while ((current = strtok_r(NULL, " ", &state)));

View file

@ -829,11 +829,11 @@ impl_init(const struct spa_handle_factory *factory,
for (i = 0; info && i < info->n_items; i++) {
const char *k = info->items[i].key;
const char *s = info->items[i].value;
if (!strcmp(k, SPA_KEY_AUDIO_CHANNELS)) {
if (spa_streq(k, SPA_KEY_AUDIO_CHANNELS)) {
this->props.channels = atoi(s);
} else if (!strcmp(k, SPA_KEY_AUDIO_RATE)) {
} else if (spa_streq(k, SPA_KEY_AUDIO_RATE)) {
this->props.rate = atoi(s);
} else if (!strcmp(k, SPA_KEY_AUDIO_POSITION)) {
} else if (spa_streq(k, SPA_KEY_AUDIO_POSITION)) {
parse_position(this, s, strlen(s));
}
}