spa: add spa_pod_memcmp

Add a helper to memcmp two pods and use it in some places.
This commit is contained in:
Wim Taymans 2025-11-13 18:13:02 +01:00
parent b9a895f825
commit 18ff08243b
3 changed files with 11 additions and 10 deletions

View file

@ -11,6 +11,7 @@
#include <spa/pod/builder.h>
#include <spa/pod/iter.h>
#include <spa/pod/parser.h>
#include <spa/pod/compare.h>
#include <spa/param/tag.h>
#ifdef __cplusplus
@ -33,8 +34,7 @@ extern "C" {
SPA_API_TAG_UTILS int
spa_tag_compare(const struct spa_pod *a, const struct spa_pod *b)
{
return ((a == b) || (a && b && SPA_POD_SIZE(a) == SPA_POD_SIZE(b) &&
memcmp(a, b, SPA_POD_SIZE(b)) == 0)) ? 0 : 1;
return spa_pod_memcmp(a, b);
}
SPA_API_TAG_UTILS int