]> git.sesse.net Git - vlc/commitdiff
Make vlc_value_t.i_int 64-bits
authorRémi Denis-Courmont <remi@remlab.net>
Fri, 2 Jul 2010 17:54:50 +0000 (20:54 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Fri, 2 Jul 2010 17:56:37 +0000 (20:56 +0300)
The memory usage is already there anyway. However, this increases the
code size a little, especially on 32-bits platforms.

N.B.: helper getter functions are still 32-bits until further change.
So are configuration items.

22 files changed:
include/vlc_common.h
include/vlc_variables.h
modules/audio_output/alsa.c
modules/audio_output/auhal.c
modules/audio_output/oss.c
modules/control/http/mvar.c
modules/control/rc.c
modules/gui/hildon/maemo_menus.c
modules/gui/macosx/controls.m
modules/gui/macosx/vout.m
modules/gui/ncurses.c
modules/gui/qt4/components/extended_panels.cpp
modules/gui/qt4/input_manager.cpp
modules/mux/mpeg/ts.c
modules/video_filter/atmo/atmo.cpp
modules/video_filter/mosaic.c
modules/video_filter/osdmenu.c
modules/video_filter/remoteosd.c
src/input/es_out.c
src/input/input.c
src/misc/objects.c
src/osd/osd.c

index 38ad6fce21efd9a9dee16e4e564764e93038f9f3..38b63645dc610a08fa67c82e0a3dc1e4ec085eb1 100644 (file)
@@ -409,7 +409,7 @@ struct stat;
  */
 typedef union
 {
-    int             i_int;
+    int64_t         i_int;
     bool            b_bool;
     float           f_float;
     char *          psz_string;
index 0a9d7057b20d214f23621cfc3c96b9c752c37c3d..b1c2b394e8614967320ebda2a3f3f47eda39aaf5 100644 (file)
@@ -188,7 +188,8 @@ VLC_EXPORT( int, var_TriggerCallback, ( vlc_object_t *, const char * ) );
  * \param psz_name The name of the variable
  * \param i The new integer value of this variable
  */
-static inline int var_SetInteger( vlc_object_t *p_obj, const char *psz_name, int i )
+static inline int var_SetInteger( vlc_object_t *p_obj, const char *psz_name,
+                                  int64_t i )
 {
     vlc_value_t val;
     val.i_int = i;
index b5168d2f1f2eea0baa0f49dc7865e6db7eb3954e..4aa70fd0e6ad9ce383cd328d9d01af4e0099f3ec 100644 (file)
@@ -438,7 +438,8 @@ static int Open( vlc_object_t *p_this )
     else if( val.i_int != AOUT_VAR_SPDIF )
     {
         /* This should not happen ! */
-        msg_Err( p_aout, "internal: can't find audio-device (%i)", val.i_int );
+        msg_Err( p_aout, "internal: can't find audio-device (%"PRId64")",
+                 val.i_int );
         free( p_sys );
         free( psz_device );
         return VLC_EGENERIC;
index d3f22a72428d3eaf402dc6071e145e6c76ee6d96..216e930b77c8244881cd0f98f457363812c48561 100644 (file)
@@ -1492,7 +1492,7 @@ static int AudioDeviceCallback( vlc_object_t *p_this, const char *psz_variable,
 {
     aout_instance_t *p_aout = (aout_instance_t *)p_this;
     var_Set( p_aout->p_libvlc, "macosx-audio-device", new_val );
-    msg_Dbg( p_aout, "Set Device: %#x", new_val.i_int );
+    msg_Dbg( p_aout, "Set Device: %#"PRIx64, new_val.i_int );
     return aout_ChannelsRestart( p_this, psz_variable, old_val, new_val, param );
 }
 
index 14d91ca1c0efa9a3d196006d4bea70f2742708fe..a05fcf16b6768bf79aad50a3eaf3494ec09685bd 100644 (file)
@@ -353,7 +353,8 @@ static int Open( vlc_object_t *p_this )
     else
     {
         /* This should not happen ! */
-        msg_Err( p_aout, "internal: can't find audio-device (%i)", val.i_int );
+        msg_Err( p_aout, "internal: can't find audio-device (%"PRId64")",
+                 val.i_int );
         close( p_sys->i_fd );
         free( p_sys );
         return VLC_EGENERIC;
index 0e723e018276d0372edaae538d509a71b10f128a..946501985f339bcc6f1a85c7d471aabec311cf25 100644 (file)
@@ -418,7 +418,7 @@ mvar_t *mvar_InputVarSetNew( intf_thread_t *p_intf, char *name,
 
     for( i = 0; i < val_list.p_list->i_count; i++ )
     {
-        char psz_int[16];
+        char psz_int[21];
         mvar_t *itm;
 
         switch( i_type & VLC_VAR_TYPE )
@@ -438,7 +438,7 @@ mvar_t *mvar_InputVarSetNew( intf_thread_t *p_intf, char *name,
         case VLC_VAR_INTEGER:
             itm = mvar_New( name, "set" );
             mvar_AppendNewVar( itm, "name", text_list.p_list->p_values[i].psz_string );
-            snprintf( psz_int, sizeof(psz_int), "%d",
+            snprintf( psz_int, sizeof(psz_int), "%"PRId64,
                       val_list.p_list->p_values[i].i_int );
             mvar_AppendNewVar( itm, "id", psz_int );
             snprintf( psz_int, sizeof(psz_int), "%d",
index 2fbc628fdff9bdccead750724d2e1fff97af9339..93da8472a8de6c27c98d244356d0de18db573892 100644 (file)
@@ -1184,10 +1184,12 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
             for ( i = 0; i < val.p_list->i_count; i++ )
             {
                 if ( i_value == val.p_list->p_values[i].i_int )
-                    msg_rc( "| %i - %s *", val.p_list->p_values[i].i_int,
+                    msg_rc( "| %"PRId64" - %s *",
+                            val.p_list->p_values[i].i_int,
                             text.p_list->p_values[i].psz_string );
                 else
-                    msg_rc( "| %i - %s", val.p_list->p_values[i].i_int,
+                    msg_rc( "| %"PRId64" - %s",
+                            val.p_list->p_values[i].i_int,
                             text.p_list->p_values[i].psz_string );
             }
             var_FreeList( &val, &text );
@@ -1761,10 +1763,10 @@ static int AudioConfig( vlc_object_t *p_this, char const *psz_cmd,
         for ( i = 0; i < val.p_list->i_count; i++ )
         {
             if ( i_value == val.p_list->p_values[i].i_int )
-                msg_rc( "| %i - %s *", val.p_list->p_values[i].i_int,
+                msg_rc( "| %"PRId64" - %s *", val.p_list->p_values[i].i_int,
                         text.p_list->p_values[i].psz_string );
             else
-                msg_rc( "| %i - %s", val.p_list->p_values[i].i_int,
+                msg_rc( "| %"PRId64" - %s", val.p_list->p_values[i].i_int,
                         text.p_list->p_values[i].psz_string );
         }
         var_FreeList( &val, &text );
index 77d2b323bd8bb22cc8912bcba8a603abddd67e8c..71f17fcb147806d374a2b345f5e0ce0218df248a 100644 (file)
@@ -623,7 +623,7 @@ static int CreateChoicesMenu( intf_thread_t *p_intf, GtkMenu *submenu, const cha
             case VLC_VAR_INTEGER:
                 var_Get( p_object, psz_var, &val );
                 if( CURTEXT ) menutext = CURTEXT;
-                else snprintf( menutext, sizeof(string)-1, "%d", CURVAL.i_int );
+                else snprintf( menutext, sizeof(string)-1, "%"PRId64, CURVAL.i_int );
                 CreateAndConnect( p_intf, submenu, psz_var, menutext, "",
                                   ITEM_RADIO, p_object, CURVAL, i_type,
                         ( CURVAL.i_int == val.i_int )
index d25288d779d9c2836b64b53c098385769da9a76e..cad72406ec443f82f6cf808d9196b1cf611a3e99 100644 (file)
 
              o_title = text_list.p_list->p_values[i].psz_string ?
                                  [[VLCMain sharedInstance] localizedString: text_list.p_list->p_values[i].psz_string] :
-                                 [NSString stringWithFormat: @"%d",
+                                 [NSString stringWithFormat: @"%"PRId64,
                                  val_list.p_list->p_values[i].i_int];
 
             o_lmi = [o_menu addItemWithTitle: o_title action: pf_callback keyEquivalent: @""];
index d68c415e3ba0184842b42be6b1a91c60df9b350a..7ba72647b5539b71c209e58a0c5b61d175084f26 100644 (file)
@@ -62,7 +62,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
     vlc_value_t val;
     vout_thread_t *p_vout = (vout_thread_t *)p_this;
 
-    msg_Dbg( p_vout, "set %d", new_val.i_int );
+    msg_Dbg( p_vout, "set %"PRId64, new_val.i_int );
     var_Create( p_vout->p_libvlc, "video-device", VLC_VAR_INTEGER );
     var_Set( p_vout->p_libvlc, "video-device", new_val );
 
index 25967a944223f265e90e7a0a28689556a77c470e..70d8f0f15cdfdaf5e5ee9133e55970d739f787d3 100644 (file)
@@ -1536,7 +1536,8 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
             {
                 int i_title_count = var_CountChoices( p_input, "title" );
                 if( i_title_count > 0 )
-                    mvnprintw( y++, 0, COLS, _(" Title    : %d/%d"), val.i_int, i_title_count );
+                    mvnprintw( y++, 0, COLS, _(" Title    : %"PRId64"/%d"),
+                               val.i_int, i_title_count );
             }
 
             /* Chapter */
@@ -1544,7 +1545,8 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
             {
                 int i_chapter_count = var_CountChoices( p_input, "chapter" );
                 if( i_chapter_count > 0 )
-                    mvnprintw( y++, 0, COLS, _(" Chapter  : %d/%d"), val.i_int, i_chapter_count );
+                    mvnprintw( y++, 0, COLS, _(" Chapter  : %"PRId64"/%d"),
+                               val.i_int, i_chapter_count );
             }
         }
         else
index da4d3403be2d60b5337e15f82e717f6682d20b07..eca75df8947a20e2da68a0837bd64b98cebc9665 100644 (file)
@@ -480,7 +480,7 @@ void ExtVideo::setWidgetValue( QObject *widget )
         else if( lineedit )
         {
             char str[30];
-            snprintf( str, sizeof(str), "%06X", val.i_int );
+            snprintf( str, sizeof(str), "%06"PRIX64, val.i_int );
             lineedit->setText( str );
         }
         else if( combobox ) combobox->setCurrentIndex(
@@ -685,7 +685,7 @@ void ExtV4l2::Refresh( void )
             const char *psz_var = text.p_list->p_values[i].psz_string;
             var_Change( p_obj, psz_var, VLC_VAR_GETTEXT, &name, NULL );
             const char *psz_label = name.psz_string;
-            msg_Dbg( p_intf, "v4l2 control \"%x\": %s (%s)",
+            msg_Dbg( p_intf, "v4l2 control \"%"PRIx64"\": %s (%s)",
                      val.p_list->p_values[i].i_int, psz_var, name.psz_string );
 
             int i_type = var_Type( p_obj, psz_var );
index 7717cd2185c03c7b20fe50a5e92f9c1844bfc43f..d92d7e26f959d653bd9cb5c515cacb883011149b 100644 (file)
@@ -417,11 +417,11 @@ void InputManager::UpdateNavigation()
     if( val.i_int > 0 )
     {
         emit titleChanged( true );
-        msg_Dbg( p_intf, "Title %i", val.i_int );
+        msg_Dbg( p_intf, "Title %"PRId64, val.i_int );
         /* p_input != NULL since val.i_int != 0 */
         var_Change( p_input, "chapter", VLC_VAR_CHOICESCOUNT, &val2, NULL );
         emit chapterChanged( (val2.i_int > 1) || ( val2.i_int > 0 && val.i_int > 1 ) );
-        msg_Dbg( p_intf, "Chapter: %i", val2.i_int );
+        msg_Dbg( p_intf, "Chapter: %"PRId64, val2.i_int );
     }
     else
         emit titleChanged( false );
index 1c0961f9ce281478694b67691b0ef4acc6ca3f11..eb0ce1243aa75823a414a7c191ca0d4a4eabbd0e 100644 (file)
@@ -830,7 +830,8 @@ static int Open( vlc_object_t *p_this )
             var_Get( p_mux, SOUT_CFG_PREFIX "csa-pkt", &pkt_val );
             if( pkt_val.i_int < 12 || pkt_val.i_int > 188 )
             {
-                msg_Err( p_mux, "wrong packet size %d specified.", pkt_val.i_int );
+                msg_Err( p_mux, "wrong packet size %"PRId64" specified.",
+                         pkt_val.i_int );
                 msg_Warn( p_mux, "using default packet size of 188 bytes" );
                 p_sys->i_csa_pkt_size = 188;
             }
index 5f48ca4832bcad1ae6a4025b3410fe1ea3201136..3a1bb955b2581f65a5e54c42fd86f4bd0efa39a0 100644 (file)
@@ -2562,7 +2562,7 @@ static int AtmoSettingsCallback( vlc_object_t *p_this, char const *psz_var,
     if(p_atmo_config)
     {
 
-       msg_Dbg(p_filter, "apply AtmoSettingsCallback %s (int: %d -> %d)",
+       msg_Dbg(p_filter, "apply AtmoSettingsCallback %s (int: %"PRId64" -> %"PRId64")",
              psz_var,
              oldval.i_int,
              newval.i_int
index 41b3a645f4f22749a8f4a2b286b080a2d438818a..82fda8290a45de2057a9ff91690065a8c319699e 100644 (file)
@@ -749,7 +749,7 @@ static int MosaicCallback( vlc_object_t *p_this, char const *psz_var,
     {
         vlc_mutex_lock( &p_sys->lock );
         msg_Dbg( p_this, "changing alpha from %d/255 to %d/255",
-                         p_sys->i_alpha, newval.i_int);
+                         p_sys->i_alpha, (int)newval.i_int);
         p_sys->i_alpha = __MIN( __MAX( newval.i_int, 0 ), 255 );
         vlc_mutex_unlock( &p_sys->lock );
     }
@@ -757,7 +757,7 @@ static int MosaicCallback( vlc_object_t *p_this, char const *psz_var,
     {
         vlc_mutex_lock( &p_sys->lock );
         msg_Dbg( p_this, "changing height from %dpx to %dpx",
-                          p_sys->i_height, newval.i_int );
+                          p_sys->i_height, (int)newval.i_int );
         p_sys->i_height = __MAX( newval.i_int, 0 );
         vlc_mutex_unlock( &p_sys->lock );
     }
@@ -765,15 +765,15 @@ static int MosaicCallback( vlc_object_t *p_this, char const *psz_var,
     {
         vlc_mutex_lock( &p_sys->lock );
         msg_Dbg( p_this, "changing width from %dpx to %dpx",
-                         p_sys->i_width, newval.i_int );
+                         p_sys->i_width, (int)newval.i_int );
         p_sys->i_width = __MAX( newval.i_int, 0 );
         vlc_mutex_unlock( &p_sys->lock );
     }
     else if( VAR_IS( "xoffset" ) )
     {
         vlc_mutex_lock( &p_sys->lock );
-        msg_Dbg( p_this, "changing x offset from %dpx to %dpx",
-                         p_sys->i_xoffset, newval.i_int );
+        msg_Dbg( p_this, "changing x offset from %dpx to %px",
+                         p_sys->i_xoffset, (int)newval.i_int );
         p_sys->i_xoffset = __MAX( newval.i_int, 0 );
         vlc_mutex_unlock( &p_sys->lock );
     }
@@ -781,7 +781,7 @@ static int MosaicCallback( vlc_object_t *p_this, char const *psz_var,
     {
         vlc_mutex_lock( &p_sys->lock );
         msg_Dbg( p_this, "changing y offset from %dpx to %dpx",
-                         p_sys->i_yoffset, newval.i_int );
+                         p_sys->i_yoffset, (int)newval.i_int );
         p_sys->i_yoffset = __MAX( newval.i_int, 0 );
         vlc_mutex_unlock( &p_sys->lock );
     }
@@ -796,7 +796,7 @@ static int MosaicCallback( vlc_object_t *p_this, char const *psz_var,
         while( pi_align_values[i_new] != newval.i_int ) i_new++;
         msg_Dbg( p_this, "changing alignment from %d (%s) to %d (%s)",
                      p_sys->i_align, ppsz_align_descriptions[i_old],
-                     newval.i_int, ppsz_align_descriptions[i_new] );
+                     (int)newval.i_int, ppsz_align_descriptions[i_new] );
         p_sys->i_align = newval.i_int;
         vlc_mutex_unlock( &p_sys->lock );
     }
@@ -804,7 +804,7 @@ static int MosaicCallback( vlc_object_t *p_this, char const *psz_var,
     {
         vlc_mutex_lock( &p_sys->lock );
         msg_Dbg( p_this, "changing border width from %dpx to %dpx",
-                         p_sys->i_borderw, newval.i_int );
+                         p_sys->i_borderw, (int)newval.i_int );
         p_sys->i_borderw = __MAX( newval.i_int, 0 );
         vlc_mutex_unlock( &p_sys->lock );
     }
@@ -812,7 +812,7 @@ static int MosaicCallback( vlc_object_t *p_this, char const *psz_var,
     {
         vlc_mutex_lock( &p_sys->lock );
         msg_Dbg( p_this, "changing border height from %dpx to %dpx",
-                         p_sys->i_borderh, newval.i_int );
+                         p_sys->i_borderh, (int)newval.i_int );
         p_sys->i_borderh = __MAX( newval.i_int, 0 );
         vlc_mutex_unlock( &p_sys->lock );
     }
@@ -831,7 +831,7 @@ static int MosaicCallback( vlc_object_t *p_this, char const *psz_var,
             vlc_mutex_lock( &p_sys->lock );
             msg_Dbg( p_this, "changing position method from %d (%s) to %d (%s)",
                     p_sys->i_position, ppsz_pos_descriptions[p_sys->i_position],
-                    newval.i_int, ppsz_pos_descriptions[newval.i_int]);
+                     (int)newval.i_int, ppsz_pos_descriptions[newval.i_int]);
             p_sys->i_position = newval.i_int;
             vlc_mutex_unlock( &p_sys->lock );
         }
@@ -840,7 +840,7 @@ static int MosaicCallback( vlc_object_t *p_this, char const *psz_var,
     {
         vlc_mutex_lock( &p_sys->lock );
         msg_Dbg( p_this, "changing number of rows from %d to %d",
-                         p_sys->i_rows, newval.i_int );
+                         p_sys->i_rows, (int)newval.i_int );
         p_sys->i_rows = __MAX( newval.i_int, 1 );
         vlc_mutex_unlock( &p_sys->lock );
     }
@@ -848,7 +848,7 @@ static int MosaicCallback( vlc_object_t *p_this, char const *psz_var,
     {
         vlc_mutex_lock( &p_sys->lock );
         msg_Dbg( p_this, "changing number of columns from %d to %d",
-                         p_sys->i_cols, newval.i_int );
+                         p_sys->i_cols, (int)newval.i_int );
         p_sys->i_cols = __MAX( newval.i_int, 1 );
         vlc_mutex_unlock( &p_sys->lock );
     }
index bb88cf069e328f5b8281a1d34aea9235fbfe6259..01560d9b25dbf6e51a55ec6ecee93bbcbf7736d7 100644 (file)
@@ -603,7 +603,7 @@ static int OSDMenuCallback( vlc_object_t *p_this, char const *psz_var,
         }
     }
     else if( !strncmp( psz_var, OSD_CFG"update", 14) )
-        p_sys->i_update =  (mtime_t)(newval.i_int * 1000);
+        p_sys->i_update =  newval.i_int * INT64_C(1000);
     else if( !strncmp( psz_var, OSD_CFG"timeout", 15) )
         p_sys->i_update = newval.i_int % 1000;
     else if( !strncmp( psz_var, OSD_CFG"alpha", 13) )
index f11ec0798acdfa21ecc3551bd4758d367c0b4816..817eb495e82ebf435e33a7c082534633481df333 100644 (file)
@@ -1385,11 +1385,11 @@ static int KeyEvent( vlc_object_t *p_this, char const *psz_var,
     if( !p_sys->b_vnc_key_events )
         return VLC_SUCCESS;
 
-    msg_Dbg( p_this, "key pressed (%d) ", newval.i_int );
+    msg_Dbg( p_this, "key pressed (%"PRId64") ", newval.i_int );
 
     if ( !newval.i_int )
     {
-        msg_Err( p_this, "Received invalid key event %d", newval.i_int );
+        msg_Err( p_this, "Received invalid key event 0" );
         return VLC_EGENERIC;
     }
 
index 37c6304d928f482640f3734ae95d18a0db51aefc..0fc7176070b7af7480acb8d4b7367841e39446e4 100644 (file)
@@ -951,12 +951,12 @@ static void EsOutESVarUpdateGeneric( es_out_t *out, int i_id,
     {
         if( psz_language && *psz_language )
         {
-            if( asprintf( &text.psz_string, "%s %i - [%s]", _( "Track" ), val.i_int, psz_language ) == -1 )
+            if( asprintf( &text.psz_string, "%s %"PRId64" - [%s]", _( "Track" ), val.i_int, psz_language ) == -1 )
                 text.psz_string = NULL;
         }
         else
         {
-            if( asprintf( &text.psz_string, "%s %i", _( "Track" ), val.i_int ) == -1 )
+            if( asprintf( &text.psz_string, "%s %"PRId64, _( "Track" ), val.i_int ) == -1 )
                 text.psz_string = NULL;
         }
     }
index 6e4ad9ba36d52b473affa5612dbac3d274d84874..af7137fa230d490c1a4629aba5d91ed99fc465df 100644 (file)
@@ -2135,7 +2135,7 @@ static bool Control( input_thread_t *p_input,
 
             if( bookmark.i_time_offset < 0 && bookmark.i_byte_offset < 0 )
             {
-                msg_Err( p_input, "invalid bookmark %d", val.i_int );
+                msg_Err( p_input, "invalid bookmark %"PRId64, val.i_int );
                 break;
             }
 
index 352acb3b8e35aa96d1a39034979c51f843dc7473..65802c77c74cb3d89bc5e3e96acfaf90ac5149c1 100644 (file)
@@ -719,7 +719,7 @@ static void DumpVariable (const void *data, const VISIT which, const int depth)
             printf( ": %s", p_var->val.b_bool ? "true" : "false" );
             break;
         case VLC_VAR_INTEGER:
-            printf( ": %d", p_var->val.i_int );
+            printf( ": %"PRId64, p_var->val.i_int );
             break;
         case VLC_VAR_STRING:
             printf( ": \"%s\"", p_var->val.psz_string );
index 7c1f74934e6ec921d2260f2542a7c017e4b7f0a7..7c5046de1158d82811e8b878a55e7aa72c29960c 100644 (file)
@@ -550,7 +550,7 @@ void osd_MenuUp( vlc_object_t *p_this )
             osd_SetKeyPressed( VLC_OBJECT(p_osd->p_libvlc),
                                var_InheritInteger(p_osd, p_button->psz_action) );
 #if defined(OSD_MENU_DEBUG)
-            msg_Dbg( p_osd, "select (%d, %s)", val.i_int, p_button->psz_action );
+            msg_Dbg( p_osd, "select (%"PRId64", %s)", val.i_int, p_button->psz_action );
 #endif
         }
     }
@@ -617,7 +617,7 @@ void osd_MenuDown( vlc_object_t *p_this )
             osd_SetKeyPressed( VLC_OBJECT(p_osd->p_libvlc),
                                var_InheritInteger(p_osd, p_button->psz_action_down) );
 #if defined(OSD_MENU_DEBUG)
-            msg_Dbg( p_osd, "select (%d, %s)", val.i_int, p_button->psz_action_down );
+            msg_Dbg( p_osd, "select (%"PRId64", %s)", val.i_int, p_button->psz_action_down );
 #endif
         }
     }