]> git.sesse.net Git - vlc/commitdiff
Use 64-bits for integers in plugin descriptors
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 11 Jul 2010 11:43:01 +0000 (14:43 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 11 Jul 2010 11:43:34 +0000 (14:43 +0300)
include/vlc_plugin.h
src/config/core.c
src/modules/entry.c

index 3f51b6e71b323bbedfa1b7c9958eb4b38020fddd..2788e4a2b3645f028f1fe7ed53966fdae6a62466 100644 (file)
@@ -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, \
index b6e3f17a0cadd688b3f81e7ed5636a3718efcabc..75907dd20b526586d00086d3afabde63605c826c 100644 (file)
@@ -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);
index 80f2802799fb6f8b0f8d9ce1df2dc73994c9af17..df7277bd5de06c00b510866bb28f74a18decf912 100644 (file)
@@ -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))