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/support/dbus.h>
#include <spa/utils/result.h>
#include <spa/utils/string.h>
#include <pipewire/impl.h>
@ -181,13 +182,13 @@ static int translate_error(const char *name)
{
pw_log_warn("RTKit error: %s", name);
if (0 == strcmp(name, DBUS_ERROR_NO_MEMORY))
if (spa_streq(name, DBUS_ERROR_NO_MEMORY))
return -ENOMEM;
if (0 == strcmp(name, DBUS_ERROR_SERVICE_UNKNOWN) ||
0 == strcmp(name, DBUS_ERROR_NAME_HAS_NO_OWNER))
if (spa_streq(name, DBUS_ERROR_SERVICE_UNKNOWN) ||
spa_streq(name, DBUS_ERROR_NAME_HAS_NO_OWNER))
return -ENOENT;
if (0 == strcmp(name, DBUS_ERROR_ACCESS_DENIED) ||
0 == strcmp(name, DBUS_ERROR_AUTH_FAILED))
if (spa_streq(name, DBUS_ERROR_ACCESS_DENIED) ||
spa_streq(name, DBUS_ERROR_AUTH_FAILED))
return -EACCES;
return -EIO;