mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04: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
|
|
@ -175,7 +175,7 @@ impl_cpu_get_vm_type(void *object)
|
|||
continue;
|
||||
|
||||
for (j = 0; j < SPA_N_ELEMENTS(dmi_vendor_table); j++) {
|
||||
if (strstr(s, dmi_vendor_table[j].vendor) == s) {
|
||||
if (spa_strstartswith(s, dmi_vendor_table[j].vendor)) {
|
||||
spa_log_debug(impl->log, "Virtualization %s found in DMI (%s)",
|
||||
s, dmi_vendors[i]);
|
||||
impl->vm_type = dmi_vendor_table[j].id;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue