Fix some cast warnings
authorRémi Denis-Courmont <rem@videolan.org>
Tue, 4 Sep 2007 19:21:53 +0000 (19:21 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Tue, 4 Sep 2007 19:21:53 +0000 (19:21 +0000)
modules/audio_output/alsa.c
modules/stream_out/bridge.c
modules/stream_out/mosaic_bridge.c
modules/stream_out/transcode.c
modules/video_filter/blend.c
modules/video_filter/mosaic.c
modules/video_filter/mosaic.h

index c13cb36..2a7f8a8 100644 (file)
@@ -94,8 +94,8 @@ static int FindDevicesCallback( vlc_object_t *p_this, char const *psz_name,
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
-static char *ppsz_devices[] = { "default" };
-static char *ppsz_devices_text[] = { N_("Default") };
+static const char *ppsz_devices[] = { "default" };
+static const char *ppsz_devices_text[] = { N_("Default") };
 vlc_module_begin();
     set_shortname( "ALSA" );
     set_description( _("ALSA audio output") );
@@ -905,8 +905,8 @@ static int FindDevicesCallback( vlc_object_t *p_this, char const *psz_name,
         /* Keep the first entrie */
         for( i = 1; i < p_item->i_list; i++ )
         {
-            free( p_item->ppsz_list[i] );
-            free( p_item->ppsz_list_text[i] );
+            free( (char *)p_item->ppsz_list[i] );
+            free( (char *)p_item->ppsz_list_text[i] );
         }
         /* TODO: Remove when no more needed */
         p_item->ppsz_list[i] = NULL;
@@ -978,10 +978,10 @@ static void GetDevicesForCard(module_config_t *p_item, int i_card)
                   snd_pcm_info_get_name(p_pcm_info), psz_device );
 
         p_item->ppsz_list =
-            (char **)realloc( p_item->ppsz_list,
+            (const char **)realloc( p_item->ppsz_list,
                               (p_item->i_list + 2) * sizeof(char *) );
         p_item->ppsz_list_text =
-            (char **)realloc( p_item->ppsz_list_text,
+            (const char **)realloc( p_item->ppsz_list_text,
                               (p_item->i_list + 2) * sizeof(char *) );
         p_item->ppsz_list[ p_item->i_list ] = psz_device;
         p_item->ppsz_list_text[ p_item->i_list ] = psz_descr;
index 8b20b8d..719b544 100644 (file)
@@ -216,7 +216,7 @@ static sout_stream_id_t * AddOut( sout_stream_t *p_stream, es_format_t *p_fmt )
     p_bridge = GetBridge( p_stream );
     if ( p_bridge == NULL )
     {
-        vlc_object_t *p_libvlc = p_stream->p_libvlc;
+        vlc_object_t *p_libvlc = VLC_OBJECT( p_stream->p_libvlc );
         vlc_value_t val;
 
         p_bridge = malloc( sizeof( bridge_t ) );
@@ -517,7 +517,7 @@ static int SendIn( sout_stream_t *p_stream, sout_stream_id_t *id,
 
     if( b_no_es )
     {
-        vlc_object_t *p_libvlc = p_stream->p_libvlc;
+        vlc_object_t *p_libvlc = VLC_OBJECT( p_stream->p_libvlc );
         for ( i = 0; i < p_bridge->i_es_num; i++ )
             free( p_bridge->pp_es[i] );
         free( p_bridge->pp_es );
index 5a9d705..09e37ee 100644 (file)
@@ -173,7 +173,7 @@ static int Open( vlc_object_t *p_this )
 {
     sout_stream_t        *p_stream = (sout_stream_t *)p_this;
     sout_stream_sys_t    *p_sys;
-    vlc_object_t         *p_libvlc = p_this->p_libvlc;
+    vlc_object_t         *p_libvlc = VLC_OBJECT( p_this->p_libvlc );
     vlc_value_t           val;
 
     config_ChainParse( p_stream, CFG_PREFIX, ppsz_sout_options,
@@ -314,7 +314,7 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, es_format_t *p_fmt )
     p_bridge = GetBridge( p_stream );
     if ( p_bridge == NULL )
     {
-        vlc_object_t *p_libvlc = p_stream->p_libvlc;
+        vlc_object_t *p_libvlc = VLC_OBJECT( p_stream->p_libvlc );
         vlc_value_t val;
 
         p_bridge = malloc( sizeof( bridge_t ) );
@@ -493,7 +493,7 @@ static int Del( sout_stream_t *p_stream, sout_stream_id_t *id )
 
     if ( b_last_es )
     {
-        vlc_object_t *p_libvlc = p_stream->p_libvlc;
+        vlc_object_t *p_libvlc = VLC_OBJECT( p_stream->p_libvlc );
         for ( i = 0; i < p_bridge->i_es_num; i++ )
             free( p_bridge->pp_es[i] );
         free( p_bridge->pp_es );
index 9deeea3..cfbab4c 100644 (file)
 #define HURRYUP_LONGTEXT N_( "The transcoder will drop frames if your CPU " \
                 "can't keep up with the encoding rate." )
 
-static char *ppsz_deinterlace_type[] =
+static const char *ppsz_deinterlace_type[] =
 {
     "deinterlace", "ffmpeg-deinterlace"
 };
index 9681378..1ef1454 100644 (file)
@@ -591,11 +591,12 @@ static void BlendR24( filter_t *p_filter, picture_t *p_dst_pic,
 #define TRANS_BITS  8
 
     if( (i_pix_pitch == 4)
-     && (((((int)p_dst)|((int)p_src1)|i_dst_pitch|i_src1_pitch) & 3) == 0) )
+     && (((((intptr_t)p_dst)|((intptr_t)p_src1)|i_dst_pitch|i_src1_pitch)
+          & 3) == 0) )
     {
         /*
-        ** if picture pixels are 32 bits long and lines addresses are 32 bit aligned,
-        ** optimize rendering
+        ** if picture pixels are 32 bits long and lines addresses are 32 bit
+        ** aligned, optimize rendering
         */
         uint32_t *p32_dst = (uint32_t *)p_dst;
         uint32_t i32_dst_pitch = (uint32_t)(i_dst_pitch>>2);
index 003759f..6eeb90f 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <math.h>
-
 #include <vlc/vlc.h>
 #include <vlc_vout.h>
 
+#include <math.h>
+
 #ifdef HAVE_LIMITS_H
 #   include <limits.h> /* INT_MAX */
 #endif
@@ -281,7 +281,7 @@ static int CreateFilter( vlc_object_t *p_this )
 {
     filter_t *p_filter = (filter_t *)p_this;
     filter_sys_t *p_sys;
-    vlc_object_t *p_libvlc = p_filter->p_libvlc;
+    vlc_object_t *p_libvlc = VLC_OBJECT( p_filter->p_libvlc );
     char *psz_order;
     char *psz_offsets;
     int i_index;
index ac8107c..f17d28d 100644 (file)
@@ -40,7 +40,7 @@ typedef struct bridge_t
 #define GetBridge(a) __GetBridge( VLC_OBJECT(a) )
 static bridge_t *__GetBridge( vlc_object_t *p_object )
 {
-    vlc_object_t *p_libvlc = p_object->p_libvlc;
+    vlc_object_t *p_libvlc = VLC_OBJECT( p_object->p_libvlc );
     bridge_t *p_bridge;
     vlc_value_t val;