Commit cafd2e02 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Use 64-bits for integers in plugin descriptors

parent 6767b442
......@@ -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, \
......
......@@ -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);
......
......@@ -28,6 +28,7 @@
#include <vlc_memory.h>
#include <assert.h>
#include <stdarg.h>
#include <limits.h>
#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))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment