lib: Use #define instead of 'static const' for constants

Fixes build errors when using GCC older than v8.1
This commit is contained in:
Julian Bouzas 2021-06-24 09:24:16 -04:00
parent e1c40a567c
commit 892b0dada6
4 changed files with 16 additions and 16 deletions

View file

@ -49,7 +49,7 @@ typedef struct _WpIteratorMethods WpIteratorMethods;
* This allows future expansion of the struct
* \ingroup wpiterator
*/
static const guint32 WP_ITERATOR_METHODS_VERSION = 0;
#define WP_ITERATOR_METHODS_VERSION 0U
struct _WpIteratorMethods
{

View file

@ -74,11 +74,11 @@ typedef enum { /*< flags >*/
* have been matched
* \ingroup wpobjectinterest
*/
static const gint WP_INTEREST_MATCH_ALL =
(WP_INTEREST_MATCH_GTYPE |
WP_INTEREST_MATCH_PW_GLOBAL_PROPERTIES |
WP_INTEREST_MATCH_PW_PROPERTIES |
WP_INTEREST_MATCH_G_PROPERTIES);
#define WP_INTEREST_MATCH_ALL \
(WP_INTEREST_MATCH_GTYPE | \
WP_INTEREST_MATCH_PW_GLOBAL_PROPERTIES | \
WP_INTEREST_MATCH_PW_PROPERTIES | \
WP_INTEREST_MATCH_G_PROPERTIES)
/*!
* \brief Flags to alter the behaviour of wp_object_interest_matches_full()

View file

@ -39,21 +39,21 @@ typedef enum { /*< flags >*/
* This is a subset of \em WP_PIPEWIRE_OBJECT_FEATURES_ALL
* \ingroup wpproxy
*/
static const WpObjectFeatures WP_PIPEWIRE_OBJECT_FEATURES_MINIMAL =
(WP_PROXY_FEATURE_BOUND | WP_PIPEWIRE_OBJECT_FEATURE_INFO);
#define WP_PIPEWIRE_OBJECT_FEATURES_MINIMAL \
(WP_PROXY_FEATURE_BOUND | WP_PIPEWIRE_OBJECT_FEATURE_INFO)
/*!
* \brief The complete common feature set for proxies implementing
* WpPipewireObject. This is a subset of \em WP_OBJECT_FEATURES_ALL
* \ingroup wpproxy
*/
static const WpObjectFeatures WP_PIPEWIRE_OBJECT_FEATURES_ALL =
(WP_PIPEWIRE_OBJECT_FEATURES_MINIMAL |
WP_PIPEWIRE_OBJECT_FEATURE_PARAM_PROPS |
WP_PIPEWIRE_OBJECT_FEATURE_PARAM_FORMAT |
WP_PIPEWIRE_OBJECT_FEATURE_PARAM_PROFILE |
WP_PIPEWIRE_OBJECT_FEATURE_PARAM_PORT_CONFIG |
WP_PIPEWIRE_OBJECT_FEATURE_PARAM_ROUTE);
#define WP_PIPEWIRE_OBJECT_FEATURES_ALL \
(WP_PIPEWIRE_OBJECT_FEATURES_MINIMAL | \
WP_PIPEWIRE_OBJECT_FEATURE_PARAM_PROPS | \
WP_PIPEWIRE_OBJECT_FEATURE_PARAM_FORMAT | \
WP_PIPEWIRE_OBJECT_FEATURE_PARAM_PROFILE | \
WP_PIPEWIRE_OBJECT_FEATURE_PARAM_PORT_CONFIG | \
WP_PIPEWIRE_OBJECT_FEATURE_PARAM_ROUTE)
/*!
* \brief The WpProxy GType

View file

@ -1026,7 +1026,7 @@ test_spa_pod_port_config (void)
"channels", "i", channels,
NULL);
g_autoptr (WpSpaPodBuilder) position_builder = wp_spa_pod_builder_new_array ();
for (guint i = 0; i < channels; i++)
for (gint i = 0; i < channels; i++)
wp_spa_pod_builder_add_id (position_builder, 0);
wp_spa_pod_builder_add_property (builder, "position");
g_autoptr (WpSpaPod) position = wp_spa_pod_builder_end (position_builder);