From cafd2e02288005f71157bc74cf13b7d1d68fb808 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sun, 11 Jul 2010 14:43:01 +0300 Subject: [PATCH] Use 64-bits for integers in plugin descriptors --- include/vlc_plugin.h | 15 ++++++++------- src/config/core.c | 7 ++----- src/modules/entry.c | 12 +++++++++--- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/include/vlc_plugin.h b/include/vlc_plugin.h index 3f51b6e71b..2788e4a2b3 100644 --- a/include/vlc_plugin.h +++ b/include/vlc_plugin.h @@ -120,8 +120,8 @@ enum vlc_module_properties /** * Current plugin ABI version */ -# define MODULE_SYMBOL 1_2_0c -# define MODULE_SUFFIX "__1_2_0c" +# define MODULE_SYMBOL 1_2_0d +# define MODULE_SUFFIX "__1_2_0d" /***************************************************************************** * Add a few defines. You do not want to read this section. Really. @@ -273,16 +273,16 @@ enum vlc_module_properties #define add_int_inner( type, name, text, longtext, advc, cb, v ) \ add_typename_inner( type, name, text, longtext, advc, cb ) \ - vlc_config_set (p_config, VLC_CONFIG_VALUE, (int)(v)); + vlc_config_set (p_config, VLC_CONFIG_VALUE, (int64_t)(v)); #define set_category( i_id ) \ add_type_inner( CONFIG_CATEGORY ) \ - vlc_config_set (p_config, VLC_CONFIG_VALUE, (int)(i_id)); + vlc_config_set (p_config, VLC_CONFIG_VALUE, (int64_t)(i_id)); #define set_subcategory( i_id ) \ add_type_inner( CONFIG_SUBCATEGORY ) \ - vlc_config_set (p_config, VLC_CONFIG_VALUE, (int)(i_id)); + vlc_config_set (p_config, VLC_CONFIG_VALUE, (int64_t)(i_id)); #define set_section( text, longtext ) \ add_typedesc_inner( CONFIG_SECTION, text, longtext ) @@ -366,7 +366,7 @@ enum vlc_module_properties #define add_bool( name, v, p_callback, text, longtext, advc ) \ add_typename_inner( CONFIG_ITEM_BOOL, name, text, longtext, advc, \ p_callback ) \ - if (v) vlc_config_set (p_config, VLC_CONFIG_VALUE, (int)true); + if (v) vlc_config_set (p_config, VLC_CONFIG_VALUE, (int64_t)true); /* For removed option */ #define add_obsolete_inner( name, type ) \ @@ -410,7 +410,8 @@ enum vlc_module_properties (vlc_callback_t)(list_update_func)); #define change_integer_range( minv, maxv ) \ - vlc_config_set (p_config, VLC_CONFIG_RANGE, (int)(minv), (int)(maxv)); + vlc_config_set (p_config, VLC_CONFIG_RANGE, \ + (int64_t)(minv), (int64_t)(maxv)); #define change_float_range( minv, maxv ) \ vlc_config_set (p_config, VLC_CONFIG_RANGE, \ diff --git a/src/config/core.c b/src/config/core.c index b6e3f17a0c..75907dd20b 100644 --- a/src/config/core.c +++ b/src/config/core.c @@ -327,12 +327,9 @@ void config_PutInt( vlc_object_t *p_this, const char *psz_name, return; } - /* if i_min == i_max == 0, then do not use them */ - if ((p_config->min.i == 0) && (p_config->max.i == 0)) - ; - else if (i_value < p_config->min.i) + if (i_value < p_config->min.i) i_value = p_config->min.i; - else if (i_value > p_config->max.i) + if (i_value > p_config->max.i) i_value = p_config->max.i; vlc_rwlock_wrlock (&config_lock); diff --git a/src/modules/entry.c b/src/modules/entry.c index 80f2802799..df7277bd5d 100644 --- a/src/modules/entry.c +++ b/src/modules/entry.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "modules/modules.h" #include "config/configuration.h" @@ -136,6 +137,11 @@ static module_config_t *vlc_config_create (module_t *module, int type) } memset (tab + confsize, 0, sizeof (tab[confsize])); + if (IsConfigIntegerType (type)) + { + tab[confsize].max.i = INT_MAX; + tab[confsize].min.i = INT_MIN; + } tab[confsize].i_type = type; if (type & CONFIG_ITEM) @@ -263,7 +269,7 @@ int vlc_plugin_set (module_t *module, module_config_t *item, int propid, ...) if (IsConfigIntegerType (item->i_type)) { item->orig.i = item->saved.i = - item->value.i = va_arg (ap, int); + item->value.i = va_arg (ap, int64_t); } else if (IsConfigFloatType (item->i_type)) @@ -288,8 +294,8 @@ int vlc_plugin_set (module_t *module, module_config_t *item, int propid, ...) || item->i_type == CONFIG_ITEM_MODULE_LIST_CAT || item->i_type == CONFIG_ITEM_MODULE_CAT) { - item->min.i = va_arg (ap, int); - item->max.i = va_arg (ap, int); + item->min.i = va_arg (ap, int64_t); + item->max.i = va_arg (ap, int64_t); } else if (IsConfigFloatType (item->i_type)) -- 2.39.2