tree-wide: use streq() instead of streq_ptr()
This commit is contained in:
parent
dcfbde3a43
commit
403660c508
|
@ -88,7 +88,7 @@ static int same_device(sd_device *a, sd_device *b) {
|
|||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (!streq_ptr(a_val, b_val))
|
||||
if (!streq(a_val, b_val))
|
||||
return false;
|
||||
|
||||
r = sd_device_get_sysname(a, &a_val);
|
||||
|
@ -99,7 +99,7 @@ static int same_device(sd_device *a, sd_device *b) {
|
|||
if (r < 0)
|
||||
return r;
|
||||
|
||||
return streq_ptr(a_val, b_val);
|
||||
return streq(a_val, b_val);
|
||||
}
|
||||
|
||||
static int validate_device(sd_device *device) {
|
||||
|
|
|
@ -218,14 +218,14 @@ int manager_add_button(Manager *m, const char *name, Button **_button) {
|
|||
}
|
||||
|
||||
int manager_process_seat_device(Manager *m, sd_device *d) {
|
||||
const char *action = NULL;
|
||||
const char *action;
|
||||
Device *device;
|
||||
int r;
|
||||
|
||||
assert(m);
|
||||
|
||||
(void) sd_device_get_property_value(d, "ACTION", &action);
|
||||
if (streq_ptr(action, "remove")) {
|
||||
if (sd_device_get_property_value(d, "ACTION", &action) >= 0 &&
|
||||
streq(action, "remove")) {
|
||||
const char *syspath;
|
||||
|
||||
r = sd_device_get_syspath(d, &syspath);
|
||||
|
@ -285,7 +285,7 @@ int manager_process_seat_device(Manager *m, sd_device *d) {
|
|||
}
|
||||
|
||||
int manager_process_button_device(Manager *m, sd_device *d) {
|
||||
const char *action = NULL, *sysname;
|
||||
const char *action, *sysname;
|
||||
Button *b;
|
||||
int r;
|
||||
|
||||
|
@ -295,8 +295,8 @@ int manager_process_button_device(Manager *m, sd_device *d) {
|
|||
if (r < 0)
|
||||
return r;
|
||||
|
||||
(void) sd_device_get_property_value(d, "ACTION", &action);
|
||||
if (streq_ptr(action, "remove")) {
|
||||
if (sd_device_get_property_value(d, "ACTION", &action) >= 0 &&
|
||||
streq(action, "remove")) {
|
||||
|
||||
b = hashmap_get(m->buttons, sysname);
|
||||
if (!b)
|
||||
|
|
|
@ -255,10 +255,10 @@ static DeviceType detect_device_type(sd_device *dev) {
|
|||
sd_device_get_subsystem(dev, &subsystem) < 0)
|
||||
return type;
|
||||
|
||||
if (streq_ptr(subsystem, "drm")) {
|
||||
if (streq(subsystem, "drm")) {
|
||||
if (startswith(sysname, "card"))
|
||||
type = DEVICE_TYPE_DRM;
|
||||
} else if (streq_ptr(subsystem, "input")) {
|
||||
} else if (streq(subsystem, "input")) {
|
||||
if (startswith(sysname, "event"))
|
||||
type = DEVICE_TYPE_EVDEV;
|
||||
}
|
||||
|
|
|
@ -580,7 +580,7 @@ static int manager_dispatch_vcsa_udev(sd_event_source *s, int fd, uint32_t reven
|
|||
if (sd_device_get_sysname(d, &name) >= 0 &&
|
||||
startswith(name, "vcsa") &&
|
||||
sd_device_get_property_value(d, "ACTION", &action) >= 0 &&
|
||||
streq_ptr(action, "remove"))
|
||||
streq(action, "remove"))
|
||||
seat_preallocate_vts(m->seat0);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -149,7 +149,7 @@ static int wait_for_initialized(
|
|||
if (r < 0)
|
||||
continue;
|
||||
|
||||
if (sd_device_get_sysname(t, &name) >= 0 && streq_ptr(name, sysname)) {
|
||||
if (sd_device_get_sysname(t, &name) >= 0 && streq(name, sysname)) {
|
||||
*ret = TAKE_PTR(t);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue