Commit d4384d0b authored by Jean-Paul Saman's avatar Jean-Paul Saman

(Forward port of rev 16987) Fix number of compiler warnings

parent 8d840d90
......@@ -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 );
......
......@@ -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;
......
......@@ -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 );
......
......@@ -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 \
{ \
......
......@@ -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 );
......
......@@ -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;
};
......
......@@ -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 )
......
......@@ -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,
......
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment