]> git.sesse.net Git - vlc/commitdiff
(Forward port of rev 16987) Fix number of compiler warnings
authorJean-Paul Saman <jpsaman@videolan.org>
Sun, 8 Oct 2006 13:15:18 +0000 (13:15 +0000)
committerJean-Paul Saman <jpsaman@videolan.org>
Sun, 8 Oct 2006 13:15:18 +0000 (13:15 +0000)
modules/codec/ffmpeg/demux.c
modules/codec/x264.c
modules/demux/mp4/drms.c
modules/demux/mp4/libmp4.c
modules/misc/freetype.c
modules/stream_out/mosaic_bridge.c
modules/stream_out/switcher.c
modules/video_output/sdl.c
modules/video_output/x11/glx.c

index bb71b93c2c8101b572a1cc2708767603014c911a..9db7a548897a0a519e55129298dbc8613017bf1d 100644 (file)
@@ -239,10 +239,10 @@ int E_(OpenDemux)( vlc_object_t *p_this )
     msg_Dbg( p_demux, "    - format = %s (%s)",
              p_sys->fmt->name, p_sys->fmt->long_name );
     msg_Dbg( p_demux, "    - start time = "I64Fd,
-             ( p_sys->ic->start_time != AV_NOPTS_VALUE ) ?
+             ( p_sys->ic->start_time != (int64_t)AV_NOPTS_VALUE ) ?
              p_sys->ic->start_time * 1000000 / AV_TIME_BASE : -1 );
     msg_Dbg( p_demux, "    - duration = "I64Fd,
-             ( p_sys->ic->duration != AV_NOPTS_VALUE ) ?
+             ( p_sys->ic->duration != (int64_t)AV_NOPTS_VALUE ) ?
              p_sys->ic->duration * 1000000 / AV_TIME_BASE : -1 );
 
     return VLC_SUCCESS;
@@ -289,14 +289,14 @@ static int Demux( demux_t *p_demux )
 
     memcpy( p_frame->p_buffer, pkt.data, pkt.size );
 
-    i_start_time = ( p_sys->ic->start_time != AV_NOPTS_VALUE ) ?
+    i_start_time = ( p_sys->ic->start_time != (int64_t)AV_NOPTS_VALUE ) ?
         p_sys->ic->start_time : 0;
 
-    p_frame->i_dts = ( pkt.dts == AV_NOPTS_VALUE ) ?
+    p_frame->i_dts = ( pkt.dts == (int64_t)AV_NOPTS_VALUE ) ?
         0 : (pkt.dts - i_start_time) * 1000000 *
         p_sys->ic->streams[pkt.stream_index]->time_base.num /
         p_sys->ic->streams[pkt.stream_index]->time_base.den;
-    p_frame->i_pts = ( pkt.pts == AV_NOPTS_VALUE ) ?
+    p_frame->i_pts = ( pkt.pts == (int64_t)AV_NOPTS_VALUE ) ?
         0 : (pkt.pts - i_start_time) * 1000000 *
         p_sys->ic->streams[pkt.stream_index]->time_base.num /
         p_sys->ic->streams[pkt.stream_index]->time_base.den;
@@ -339,7 +339,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
                 *pf = (double)stream_Tell( p_demux->s ) / (double)i64;
             }
 
-            if( (p_sys->ic->duration != AV_NOPTS_VALUE) && (p_sys->i_pcr > 0) )
+            if( (p_sys->ic->duration != (int64_t)AV_NOPTS_VALUE) && (p_sys->i_pcr > 0) )
             {
                 *pf = (double)p_sys->i_pcr / (double)p_sys->ic->duration;
             }
@@ -354,10 +354,10 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
                 int64_t i_size = stream_Size( p_demux->s );
 
                 i64 = p_sys->i_pcr * i_size / i64 * f;
-                if( p_sys->ic->start_time != AV_NOPTS_VALUE )
+                if( p_sys->ic->start_time != (int64_t)AV_NOPTS_VALUE )
                     i64 += p_sys->ic->start_time;
 
-                if( p_sys->ic->duration != AV_NOPTS_VALUE )
+                if( p_sys->ic->duration != (int64_t)AV_NOPTS_VALUE )
                     i64 = p_sys->ic->duration * f;
 
                 msg_Warn( p_demux, "DEMUX_SET_POSITION: "I64Fd, i64 );
@@ -373,7 +373,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
 
         case DEMUX_GET_LENGTH:
             pi64 = (int64_t*)va_arg( args, int64_t * );
-            if( p_sys->ic->duration != AV_NOPTS_VALUE )
+            if( p_sys->ic->duration != (int64_t)AV_NOPTS_VALUE )
             {
                 *pi64 = p_sys->ic->duration;
             }
@@ -387,7 +387,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
 
         case DEMUX_SET_TIME:
             i64 = (int64_t)va_arg( args, int64_t );
-            if( p_sys->ic->start_time != AV_NOPTS_VALUE )
+            if( p_sys->ic->start_time != (int64_t)AV_NOPTS_VALUE )
                 i64 += p_sys->ic->start_time;
 
             msg_Warn( p_demux, "DEMUX_SET_TIME: "I64Fd, i64 );
index 74e9d067f8637cc6deaa5170c799204019a1c643..0ebc78fba6c270e5f48adcf08437ad2121e256bd 100644 (file)
@@ -977,7 +977,7 @@ static int  Open ( vlc_object_t *p_this )
     if( p_enc->fmt_in.video.i_aspect > 0 )
     {
         int64_t i_num, i_den;
-        int i_dst_num, i_dst_den;
+        unsigned int i_dst_num, i_dst_den;
 
         i_num = p_enc->fmt_in.video.i_aspect *
             (int64_t)p_enc->fmt_in.video.i_height;
index e035cca56295300c057c39cb484fc7d170fd43cf..2914c5d9037c1928c8892c261ee62a5ddd832678 100644 (file)
@@ -716,8 +716,8 @@ static void InitShuffle( struct shuffle_s *p_shuffle, uint32_t *p_sys_key,
         int32_t i_hash;
 
         InitMD5( &md5 );
-        AddMD5( &md5, (uint8_t *)p_sys_key, 16 );
-        AddMD5( &md5, (uint8_t *)p_secret1, 4 );
+        AddMD5( &md5, (const uint8_t *)p_sys_key, 16 );
+        AddMD5( &md5, (const uint8_t *)p_secret1, 4 );
         EndMD5( &md5 );
 
         p_secret1[ 3 ]++;
@@ -824,11 +824,11 @@ static void DoShuffle( struct shuffle_s *p_shuffle,
     {
         p_big_bordel[ i ] = U32_AT(p_bordel + i);
     }
-    AddMD5( &md5, (uint8_t *)p_big_bordel, 64 );
+    AddMD5( &md5, (const uint8_t *)p_big_bordel, 64 );
     if( p_shuffle->i_version == 0x01000300 )
     {
-        AddMD5( &md5, (uint8_t *)p_secret3, sizeof(p_secret3) );
-        AddMD5( &md5, (uint8_t *)p_secret4, i_secret );
+        AddMD5( &md5, (const uint8_t *)p_secret3, sizeof(p_secret3) );
+        AddMD5( &md5, (const uint8_t *)p_secret4, i_secret );
     }
     EndMD5( &md5 );
 
@@ -1522,21 +1522,21 @@ static int GetSystemKey( uint32_t *p_sys_key, vlc_bool_t b_ipod )
     /* Combine our system info hash with additional secret data. The resulting
      * MD5 hash will be our system key. */
     InitMD5( &md5 );
-    AddMD5( &md5, (uint8_t*)p_secret5, 8 );
+    AddMD5( &md5, (const uint8_t*)p_secret5, 8 );
 
     if( !b_ipod )
     {
-        AddMD5( &md5, (uint8_t *)p_system_hash, 6 );
-        AddMD5( &md5, (uint8_t *)p_system_hash, 6 );
-        AddMD5( &md5, (uint8_t *)p_system_hash, 6 );
-        AddMD5( &md5, (uint8_t *)p_secret6, 8 );
+        AddMD5( &md5, (const uint8_t *)p_system_hash, 6 );
+        AddMD5( &md5, (const uint8_t *)p_system_hash, 6 );
+        AddMD5( &md5, (const uint8_t *)p_system_hash, 6 );
+        AddMD5( &md5, (const uint8_t *)p_secret6, 8 );
     }
     else
     {
         i_ipod_id = U64_AT(&i_ipod_id);
-        AddMD5( &md5, (uint8_t *)&i_ipod_id, sizeof(i_ipod_id) );
-        AddMD5( &md5, (uint8_t *)&i_ipod_id, sizeof(i_ipod_id) );
-        AddMD5( &md5, (uint8_t *)&i_ipod_id, sizeof(i_ipod_id) );
+        AddMD5( &md5, (const uint8_t *)&i_ipod_id, sizeof(i_ipod_id) );
+        AddMD5( &md5, (const uint8_t *)&i_ipod_id, sizeof(i_ipod_id) );
+        AddMD5( &md5, (const uint8_t *)&i_ipod_id, sizeof(i_ipod_id) );
     }
 
     EndMD5( &md5 );
@@ -1905,7 +1905,7 @@ static int HashSystemInfo( uint32_t *p_system_hash )
 
     GetVolumeInformation( _T("C:\\"), NULL, 0, &i_serial,
                           NULL, NULL, NULL, 0 );
-    AddMD5( &md5, (uint8_t *)&i_serial, 4 );
+    AddMD5( &md5, (const uint8_t *)&i_serial, 4 );
 
     for( i = 0; i < sizeof(p_reg_keys) / sizeof(p_reg_keys[ 0 ]); i++ )
     {
@@ -1930,7 +1930,7 @@ static int HashSystemInfo( uint32_t *p_system_hash )
                                  NULL, NULL, p_reg_buf,
                                  &i_size ) == ERROR_SUCCESS )
             {
-                AddMD5( &md5, (uint8_t *)p_reg_buf, i_size );
+                AddMD5( &md5, (const uint8_t *)p_reg_buf, i_size );
             }
 
             free( p_reg_buf );
index 4bb335f1fda2b2a70ab8f25cf912d01576d6c39b..46cdc45a7cefb6216cb2b7a175ec7eaa41254730 100644 (file)
@@ -72,8 +72,8 @@
         p_str = calloc( sizeof( char ), __MIN( strlen( (char*)p_peek ), i_read )+1);\
         memcpy( p_str, p_peek, __MIN( strlen( (char*)p_peek ), i_read ) ); \
         p_str[__MIN( strlen( (char*)p_peek ), i_read )] = 0; \
-        p_peek += strlen( p_str ) + 1; \
-        i_read -= strlen( p_str ) + 1; \
+        p_peek += strlen( (char *)p_str ) + 1; \
+        i_read -= strlen( (char *)p_str ) + 1; \
     } \
     else \
     { \
index 691c5975130496d3febf0d84950df6e8aa6e3734..89db918d2675cbe871002a9a15f30c90f2a0f4de 100644 (file)
@@ -761,7 +761,7 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
         i_out_bytes = i_in_bytes * sizeof( uint32_t );
         i_out_bytes_left = i_out_bytes;
         p_out_buffer = (char *)psz_unicode;
-        i_ret = vlc_iconv( iconv_handle, &p_in_buffer, &i_in_bytes,
+        i_ret = vlc_iconv( iconv_handle, (const char**)&p_in_buffer, &i_in_bytes,
                            &p_out_buffer, &i_out_bytes_left );
 
         vlc_iconv_close( iconv_handle );
@@ -780,7 +780,7 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
     {
         uint32_t *p_fribidi_string;
         int start_pos, pos = 0;
-        
+
         p_fribidi_string = malloc( (i_string_length + 1) * sizeof(uint32_t) );
 
         /* Do bidi conversion line-by-line */
index 5be43c344c1dd5f7fe0893a0440632ad14c41de0..40329be578deb92db940c23eb59c027cef651035 100644 (file)
@@ -48,7 +48,7 @@ struct sout_stream_sys_t
     decoder_t       *p_decoder;
     image_handler_t *p_image; /* filter for resizing */
     int i_height, i_width;
-    int i_sar_num, i_sar_den;
+    unsigned int i_sar_num, i_sar_den;
     char *psz_id;
     vlc_bool_t b_inited;
 };
index 01c6ab993bbaefb486350ebe973ca5e3c2257dcd..bc1b315e8f36c8a58c8a579431b38f7582c5420b 100644 (file)
@@ -162,7 +162,7 @@ struct sout_stream_id_t
     AVCodec         *ff_enc;
     AVCodecContext  *ff_enc_c;
     AVFrame         *p_frame;
-    char            *p_buffer_out;
+    uint8_t         *p_buffer_out;
     int             i_nb_pred;
     int16_t         *p_samples;
 };
@@ -650,7 +650,7 @@ static void NetCommand( sout_stream_t *p_stream )
 {
     sout_stream_sys_t *p_sys = p_stream->p_sys;
     char psz_buffer[10];
-    int i_len = net_ReadNonBlock( p_stream, p_sys->i_fd, NULL, (char *)&psz_buffer[0],
+    int i_len = net_ReadNonBlock( p_stream, p_sys->i_fd, NULL, (uint8_t *)&psz_buffer[0],
                                   sizeof( psz_buffer ), 0 );
 
     if ( i_len > 0 )
index 9daa2d4f6d4acc91c01055396cfd9815a0cd46c8..810717f50d31a3734e03db370533d9d9b115a5b7 100644 (file)
@@ -327,7 +327,7 @@ static int Manage( vout_thread_t *p_vout )
 {
     SDL_Event event;                                            /* SDL event */
     vlc_value_t val;
-    int i_width, i_height, i_x, i_y;
+    unsigned int i_width, i_height, i_x, i_y;
 
     /* Process events */
     while( SDL_PollEvent(&event) )
@@ -576,7 +576,7 @@ static int Manage( vout_thread_t *p_vout )
  *****************************************************************************/
 static void Display( vout_thread_t *p_vout, picture_t *p_pic )
 {
-    int x, y, w, h;
+    unsigned int x, y, w, h;
     SDL_Rect disp;
 
     vout_PlacePicture( p_vout, p_vout->p_sys->i_width, p_vout->p_sys->i_height,
index 247cab3019734082043fd3f24b788d8797eeb5f5..1061b5e0f84f08a366af376f1156c9ff183b11de 100644 (file)
@@ -339,7 +339,7 @@ int InitGLX13( vout_thread_t *p_vout )
 static void SwapBuffers( vout_thread_t *p_vout )
 {
     vout_sys_t *p_sys = p_vout->p_sys;
-    int i_width, i_height, i_x, i_y;
+    unsigned int i_width, i_height, i_x, i_y;
 
     vout_PlacePicture( p_vout, p_vout->p_sys->p_win->i_width,
                        p_vout->p_sys->p_win->i_height,