From 3ee1f6f11637566554fc1d1a0ae2d6367f9509bf Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 30 Nov 2023 13:03:49 +0100 Subject: [PATCH 1/2] issue 923: enable external renderer command-line options in UPPER case letters; under FIX_923_EXTERNAL_REND_COMMAND_LINE --- lib_com/options.h | 1 + lib_util/cmdln_parser.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 94c706fa81..53803e3273 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,6 +155,7 @@ #define FIX_881_REMOVE_LFE_ADDITION_IN_ISM /* VA: issue 881: remove LFE addition in ISM format */ #define FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO /* VA: Fix the definition of buffers/arrays in DFT and MDCT stereo to satisfy gcc v 11.4.0 */ #define FIX_891_PARAMUPMIX_CLEANUP /* Dlb: issue 891: remove unneeded code from ParamUpmix */ +#define FIX_923_EXTERNAL_REND_COMMAND_LINE /* VA: issue 923: enable external renderer command-line options in UPPER case letters */ /* #################### End BE switches ################################## */ diff --git a/lib_util/cmdln_parser.c b/lib_util/cmdln_parser.c index 6ac2b0ec2d..129588400f 100644 --- a/lib_util/cmdln_parser.c +++ b/lib_util/cmdln_parser.c @@ -150,7 +150,11 @@ static int8_t optionMatchesString( const char *optionName = stringToOptionName( str ); +#ifdef FIX_923_EXTERNAL_REND_COMMAND_LINE + if ( strncmp( to_upper( (char *) optionName ), to_upper( (char *) opt.props.match ), MAX_OPTION_LENGTH ) == 0 || strncmp( to_upper( (char *) optionName ), to_upper( (char *) opt.props.matchShort ), MAX_OPTION_LENGTH ) == 0 ) +#else if ( strncmp( optionName, opt.props.match, MAX_OPTION_LENGTH ) == 0 || strncmp( optionName, opt.props.matchShort, MAX_OPTION_LENGTH ) == 0 ) +#endif { return 1; } -- GitLab From c25092ce0b8809b38760f2a4b6e694bf9eb99bb3 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 30 Nov 2023 13:35:24 +0100 Subject: [PATCH 2/2] fix compilation warnings --- lib_util/cmdln_parser.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib_util/cmdln_parser.c b/lib_util/cmdln_parser.c index 129588400f..8211994865 100644 --- a/lib_util/cmdln_parser.c +++ b/lib_util/cmdln_parser.c @@ -151,7 +151,22 @@ static int8_t optionMatchesString( const char *optionName = stringToOptionName( str ); #ifdef FIX_923_EXTERNAL_REND_COMMAND_LINE - if ( strncmp( to_upper( (char *) optionName ), to_upper( (char *) opt.props.match ), MAX_OPTION_LENGTH ) == 0 || strncmp( to_upper( (char *) optionName ), to_upper( (char *) opt.props.matchShort ), MAX_OPTION_LENGTH ) == 0 ) + char optionName_to_upper[FILENAME_MAX]; + strncpy( optionName_to_upper, optionName, sizeof( optionName_to_upper ) - 1 ); + optionName_to_upper[sizeof( optionName_to_upper ) - 1] = '\0'; + to_upper( optionName_to_upper ); + + char match_to_upper[FILENAME_MAX]; + strncpy( match_to_upper, opt.props.match, sizeof( match_to_upper ) - 1 ); + optionName_to_upper[sizeof( match_to_upper ) - 1] = '\0'; + to_upper( match_to_upper ); + + char matchShort_to_upper[FILENAME_MAX]; + strncpy( matchShort_to_upper, opt.props.matchShort, sizeof( matchShort_to_upper ) - 1 ); + optionName_to_upper[sizeof( matchShort_to_upper ) - 1] = '\0'; + to_upper( matchShort_to_upper ); + + if ( strncmp( optionName_to_upper, match_to_upper, MAX_OPTION_LENGTH ) == 0 || strncmp( optionName_to_upper, matchShort_to_upper, MAX_OPTION_LENGTH ) == 0 ) #else if ( strncmp( optionName, opt.props.match, MAX_OPTION_LENGTH ) == 0 || strncmp( optionName, opt.props.matchShort, MAX_OPTION_LENGTH ) == 0 ) #endif -- GitLab