mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
tree-wide: replace strstr(a, b) == a with spa_strstartswith()
spa_strstartswith() is more immediately understandable. Coccinelle spatch file: @@ expression E1, E2; @@ - strstr(E1, E2) != E1 + !spa_strstartswith(E1, E2) @@ expression E1, E2; @@ - strstr(E1, E2) == E1 + spa_strstartswith(E1, E2) Applied to the tree except for alsa/acp/compat.h because it looks like that header is still mostly as-is from PA.
This commit is contained in:
parent
60c510d766
commit
51a177eb6d
20 changed files with 48 additions and 48 deletions
|
|
@ -679,7 +679,7 @@ handle_device(struct impl *impl, struct sm_object *obj)
|
|||
|
||||
pw_log_debug(NAME" %p: device "PW_KEY_MEDIA_CLASS":%s api:%s", impl, media_class, str);
|
||||
|
||||
if (strstr(media_class, "Audio/") != media_class)
|
||||
if (!spa_strstartswith(media_class, "Audio/"))
|
||||
return 0;
|
||||
if (!spa_streq(str, "alsa"))
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue