Merge branch 'variable_list_match' into 'master'

vlc_plugin: assert when a VLC_CONFIG_LIST has a mismatching amount of values/names

See merge request videolan/vlc!4978
This commit is contained in:
Steve Lhomme 2024-04-28 07:10:37 +00:00
commit 5635ec801f
4 changed files with 7 additions and 11 deletions

View File

@ -25,6 +25,7 @@
# define LIBVLC_MODULES_MACROS_H 1
#include <stdint.h>
#include <assert.h>
/**
* \file
@ -524,13 +525,15 @@ VLC_METADATA_EXPORTS
vlc_config_set (VLC_CONFIG_LIST, \
ARRAY_SIZE(list), \
VLC_CHECKED_TYPE(const char *const *, list), \
VLC_CHECKED_TYPE(const char *const *, list_text));
VLC_CHECKED_TYPE(const char *const *, list_text)); \
static_assert(ARRAY_SIZE(list) == ARRAY_SIZE(list_text), "Mismatched list values/text");
#define change_integer_list( list, list_text ) \
vlc_config_set (VLC_CONFIG_LIST, \
ARRAY_SIZE(list), \
VLC_CHECKED_TYPE(const int *, list), \
VLC_CHECKED_TYPE(const char *const *, list_text));
VLC_CHECKED_TYPE(const char *const *, list_text)); \
static_assert(ARRAY_SIZE(list) == ARRAY_SIZE(list_text), "Mismatched list values/text");
#define change_integer_range( minv, maxv ) \
vlc_config_set (VLC_CONFIG_RANGE, VLC_CHECKED_TYPE(int64_t, minv), \

View File

@ -23,9 +23,6 @@
#include "srt_common.h"
const char * const srt_key_length_names[] = { N_( "16 bytes" ), N_(
"24 bytes" ), N_( "32 bytes" ), };
typedef struct parsed_param {
char *key;
char *val;

View File

@ -60,8 +60,8 @@
#define SRT_KEY_LENGTH_TEXT N_("Crypto key length in bytes")
#define SRT_DEFAULT_KEY_LENGTH 16
static const int srt_key_lengths[] = { 16, 24, 32, };
extern const char * const srt_key_length_names[];
static const char * const srt_key_length_names[] = { N_( "16 bytes" ), N_(
"24 bytes" ), N_( "32 bytes" ), };
typedef struct srt_params {
int latency;

View File

@ -547,10 +547,6 @@ static const char * const filter_text[] = {
"Jinc",
"Sphinx",
"BC spline",
"Catmull-Rom",
"Mitchell-Netravali",
"Robidoux",
"RobidouxSharp",
"Bicubic",
"Spline16",
"Spline36",