From 9aacd36f37c93c346fb86d6533cef981e1aa8620 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Sat, 26 Jun 2021 21:36:20 +0200 Subject: [PATCH] pipewire: properties: take `const` argument Since these particular methods never modify the lists they receive, make the arguments `const`. --- src/pipewire/properties.c | 8 ++++---- src/pipewire/properties.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pipewire/properties.c b/src/pipewire/properties.c index f68cff91b..ac2c646f7 100644 --- a/src/pipewire/properties.c +++ b/src/pipewire/properties.c @@ -233,7 +233,7 @@ struct pw_properties *pw_properties_copy(const struct pw_properties *properties) */ SPA_EXPORT int pw_properties_update_keys(struct pw_properties *props, - const struct spa_dict *dict, const char *keys[]) + const struct spa_dict *dict, const char * const keys[]) { int i, changed = 0; const char *str; @@ -245,7 +245,7 @@ int pw_properties_update_keys(struct pw_properties *props, return changed; } -static bool has_key(const char *keys[], const char *key) +static bool has_key(const char * const keys[], const char *key) { int i; for (i = 0; keys[i]; i++) { @@ -257,7 +257,7 @@ static bool has_key(const char *keys[], const char *key) SPA_EXPORT int pw_properties_update_ignore(struct pw_properties *props, - const struct spa_dict *dict, const char *ignore[]) + const struct spa_dict *dict, const char * const ignore[]) { const struct spa_dict_item *it; int changed = 0; @@ -341,7 +341,7 @@ int pw_properties_add(struct pw_properties *props, */ SPA_EXPORT int pw_properties_add_keys(struct pw_properties *props, - const struct spa_dict *dict, const char *keys[]) + const struct spa_dict *dict, const char * const keys[]) { uint32_t i; int added = 0; diff --git a/src/pipewire/properties.h b/src/pipewire/properties.h index 7c2632dc3..af8810c2b 100644 --- a/src/pipewire/properties.h +++ b/src/pipewire/properties.h @@ -64,9 +64,9 @@ struct pw_properties * pw_properties_copy(const struct pw_properties *properties); int pw_properties_update_keys(struct pw_properties *props, - const struct spa_dict *dict, const char *keys[]); + const struct spa_dict *dict, const char * const keys[]); int pw_properties_update_ignore(struct pw_properties *props, - const struct spa_dict *dict, const char *ignore[]); + const struct spa_dict *dict, const char * const ignore[]); /* Update props with all key/value pairs from dict */ int pw_properties_update(struct pw_properties *props, @@ -78,7 +78,7 @@ int pw_properties_update_string(struct pw_properties *props, int pw_properties_add(struct pw_properties *oldprops, const struct spa_dict *dict); int pw_properties_add_keys(struct pw_properties *oldprops, - const struct spa_dict *dict, const char *keys[]); + const struct spa_dict *dict, const char * const keys[]); void pw_properties_clear(struct pw_properties *properties);