]> git.sesse.net Git - vlc/commitdiff
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 c13cb36d1f3e9a9c34606fc193eaf75141f35954..2a7f8a81a89ff69cea171bd70859df74a300dcf4 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 8b20b8da625755162212498f91ef9b6983240635..719b5447e8b2e6b577cd9a8a45efcc53f2510fe7 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 5a9d705fdbb9b593ed4fbe5dbe479cb567acba9d..09e37eebc1cd38fee3f23044bb92559c14b5d406 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 9deeea3a74e081289239caba3cb0c1fc562c6078..cfbab4c30cbc58b886560b64d02b57b466aaad6a 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 96813781b117cfdcefeaf79fe9ee36f8c92baf6c..1ef1454a134124b2e6f45701517bfeedcdcbe0f0 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 003759facb9cd51675ee7a5c47c81f314426f893..6eeb90faf5131f10d22ef1f10a37bc048858a192 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 ac8107c66cdfcf0399d519d6f009329885f1f28b..f17d28d4ae09038f1546e4e5ffd774748c97b94d 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;