Commit d367c2f5 authored by Christophe Massiot's avatar Christophe Massiot
Browse files

* ALL: miscellaneous unsigned/signed warning fixes and pointer/int casts.

parent 363fe691
......@@ -206,7 +206,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_GET_PRIVATE_ID_STATE:
i_int = (int)va_arg( args, int );
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t );
pb_bool = (vlc_bool_t *)va_arg( args, vlc_bool_t * );
if( i_int < 0 || i_int > 127 )
return VLC_EGENERIC;
......@@ -541,7 +541,7 @@ static int Describe( access_t *p_access, char **ppsz_location )
* and bitrate mutual exclusion(optional) */
E_( asf_HeaderParse )( &p_sys->asfh,
p_sys->p_header, p_sys->i_header );
msg_Dbg( p_access, "packet count=%lld packet size=%d",
msg_Dbg( p_access, "packet count="I64Fd" packet size=%d",
p_sys->asfh.i_data_packets_count,
p_sys->asfh.i_min_data_packet_size );
......
......@@ -292,7 +292,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_GET_PRIVATE_ID_STATE:
i_int = (int)va_arg( args, int );
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t );
pb_bool = (vlc_bool_t *)va_arg( args, vlc_bool_t * );
if( i_int < 0 || i_int > 127 )
return VLC_EGENERIC;
......
......@@ -71,7 +71,7 @@ typedef struct msf_s
*****************************************************************************/
typedef struct entries_sect_s
{
uint8_t psz_id[8]; /* "ENTRYVCD" */
char psz_id[8]; /* "ENTRYVCD" */
uint8_t i_version; /* 0x02 VCD2.0
0x01 SVCD */
uint8_t i_sys_prof_tag; /* 0x01 if VCD1.1
......
......@@ -77,7 +77,8 @@ static int OpenPacketizer( vlc_object_t * );
static void CloseDecoder ( vlc_object_t * );
static void *DecodeBlock ( decoder_t *, block_t ** );
static int SyncInfo ( const byte_t *, int *, int *, int *,int * );
static int SyncInfo ( const byte_t *, unsigned int *, unsigned int *,
unsigned int *, int * );
static uint8_t *GetOutBuffer ( decoder_t *, void ** );
static aout_buffer_t *GetAoutBuffer( decoder_t * );
......@@ -409,8 +410,9 @@ static block_t *GetSoutBuffer( decoder_t *p_dec )
* their SyncInfo...
*****************************************************************************/
static int SyncInfo( const byte_t * p_buf,
int * pi_channels, int * pi_channels_conf,
int * pi_sample_rate, int * pi_bit_rate )
unsigned int * pi_channels,
unsigned int * pi_channels_conf,
unsigned int * pi_sample_rate, int * pi_bit_rate )
{
static const uint8_t halfrate[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3 };
static const int rate[] = { 32, 40, 48, 56, 64, 80, 96, 112,
......
......@@ -78,7 +78,7 @@ static void *DecodeBlock ( decoder_t *, block_t ** );
static inline int SyncCode( const uint8_t * );
static int SyncInfo ( const uint8_t *, unsigned int *, unsigned int *,
unsigned int *, unsigned int *, unsigned int * );
unsigned int *, int *, unsigned int * );
static uint8_t *GetOutBuffer ( decoder_t *, void ** );
static aout_buffer_t *GetAoutBuffer( decoder_t * );
......@@ -425,7 +425,7 @@ static const unsigned int ppi_dts_bitrate[] =
static int SyncInfo16be( const uint8_t *p_buf,
unsigned int *pi_audio_mode,
unsigned int *pi_sample_rate,
unsigned int *pi_bit_rate,
int *pi_bit_rate,
unsigned int *pi_frame_length )
{
unsigned int i_frame_size;
......@@ -537,7 +537,7 @@ static int SyncInfo( const uint8_t *p_buf,
unsigned int *pi_channels,
unsigned int *pi_channels_conf,
unsigned int *pi_sample_rate,
unsigned int *pi_bit_rate,
int *pi_bit_rate,
unsigned int *pi_frame_length )
{
unsigned int i_audio_mode;
......
......@@ -126,7 +126,8 @@ static aout_buffer_t *DecodeBlock( decoder_t *, block_t ** );
#endif
static block_t *PacketizeBlock( decoder_t *, block_t ** );
static int SyncInfo( decoder_t *, uint8_t *, int *, int *, int *,int * );
static int SyncInfo( decoder_t *, uint8_t *, unsigned int *, unsigned int *,
unsigned int *,int * );
#ifdef USE_LIBFLAC
......@@ -753,8 +754,10 @@ static void decoder_state_error( decoder_t *p_dec,
* SyncInfo: parse FLAC sync info
*****************************************************************************/
static int SyncInfo( decoder_t *p_dec, uint8_t *p_buf,
int * pi_channels, int * pi_channels_conf,
int * pi_sample_rate, int * pi_bits_per_sample )
unsigned int * pi_channels,
unsigned int * pi_channels_conf,
unsigned int * pi_sample_rate,
int * pi_bits_per_sample )
{
decoder_sys_t *p_sys = p_dec->p_sys;
int i_header, i_temp, i_read;
......
......@@ -43,7 +43,7 @@ static void Render ( decoder_t *, subpicture_t *, subpicture_data_t *);
* AddNibble: read a nibble from a source packet and add it to our integer.
*****************************************************************************/
static inline unsigned int AddNibble( unsigned int i_code,
uint8_t *p_src, int *pi_index )
uint8_t *p_src, unsigned int *pi_index )
{
if( *pi_index & 0x1 )
{
......
......@@ -1369,7 +1369,7 @@ typedef struct
char *param2;
} macro_t;
static int FileLoad( FILE *f, uint8_t **pp_data, int *pi_data )
static int FileLoad( FILE *f, char **pp_data, int *pi_data )
{
int i_read;
......@@ -1390,11 +1390,11 @@ static int FileLoad( FILE *f, uint8_t **pp_data, int *pi_data )
return VLC_SUCCESS;
}
static int MacroParse( macro_t *m, uint8_t *psz_src )
static int MacroParse( macro_t *m, char *psz_src )
{
uint8_t *dup = strdup( psz_src );
uint8_t *src = dup;
uint8_t *p;
char *dup = strdup( (char *)psz_src );
char *src = dup;
char *p;
int i_skip;
#define EXTRACT( name, l ) \
......@@ -1604,9 +1604,9 @@ static int StrToMacroType( char *name )
static void MacroDo( httpd_file_sys_t *p_args,
macro_t *m,
uint8_t *p_request, int i_request,
uint8_t **pp_data, int *pi_data,
uint8_t **pp_dst )
char *p_request, int i_request,
char **pp_data, int *pi_data,
char **pp_dst )
{
intf_thread_t *p_intf = p_args->p_intf;
intf_sys_t *p_sys = p_args->p_intf->p_sys;
......@@ -2387,14 +2387,14 @@ static void MacroDo( httpd_file_sys_t *p_args,
#undef ALLOC
}
static uint8_t *MacroSearch( uint8_t *src, uint8_t *end, int i_mvlc, vlc_bool_t b_after )
static char *MacroSearch( char *src, char *end, int i_mvlc, vlc_bool_t b_after )
{
int i_id;
int i_level = 0;
while( src < end )
{
if( src + 4 < end && !strncmp( src, "<vlc", 4 ) )
if( src + 4 < end && !strncmp( (char *)src, "<vlc", 4 ) )
{
int i_skip;
macro_t m;
......@@ -2440,15 +2440,15 @@ static uint8_t *MacroSearch( uint8_t *src, uint8_t *end, int i_mvlc, vlc_bool_t
}
static void Execute( httpd_file_sys_t *p_args,
uint8_t *p_request, int i_request,
uint8_t **pp_data, int *pi_data,
uint8_t **pp_dst,
uint8_t *_src, uint8_t *_end )
char *p_request, int i_request,
char **pp_data, int *pi_data,
char **pp_dst,
char *_src, char *_end )
{
intf_thread_t *p_intf = p_args->p_intf;
uint8_t *src, *dup, *end;
uint8_t *dst = *pp_dst;
char *src, *dup, *end;
char *dst = *pp_dst;
src = dup = malloc( _end - _src + 1 );
end = src +( _end - _src );
......@@ -2459,10 +2459,10 @@ static void Execute( httpd_file_sys_t *p_args,
/* we parse searching <vlc */
while( src < end )
{
uint8_t *p;
char *p;
int i_copy;
p = strstr( src, "<vlc" );
p = (char *)strstr( (char *)src, "<vlc" );
if( p < end && p == src )
{
macro_t m;
......@@ -2476,7 +2476,7 @@ static void Execute( httpd_file_sys_t *p_args,
case MVLC_IF:
{
vlc_bool_t i_test;
uint8_t *endif;
char *endif;
EvaluateRPN( p_args->vars, &p_args->stack, m.param1 );
if( SSPopN( &p_args->stack, p_args->vars ) )
......@@ -2491,11 +2491,11 @@ static void Execute( httpd_file_sys_t *p_args,
if( i_test == 0 )
{
uint8_t *start = MacroSearch( src, endif, MVLC_ELSE, VLC_TRUE );
char *start = MacroSearch( src, endif, MVLC_ELSE, VLC_TRUE );
if( start )
{
uint8_t *stop = MacroSearch( start, endif, MVLC_END, VLC_FALSE );
char *stop = MacroSearch( start, endif, MVLC_END, VLC_FALSE );
if( stop )
{
Execute( p_args, p_request, i_request, pp_data, pi_data, &dst, start, stop );
......@@ -2504,7 +2504,7 @@ static void Execute( httpd_file_sys_t *p_args,
}
else if( i_test == 1 )
{
uint8_t *stop;
char *stop;
if( ( stop = MacroSearch( src, endif, MVLC_ELSE, VLC_FALSE ) ) == NULL )
{
stop = MacroSearch( src, endif, MVLC_END, VLC_FALSE );
......@@ -2520,9 +2520,9 @@ static void Execute( httpd_file_sys_t *p_args,
}
case MVLC_FOREACH:
{
uint8_t *endfor = MacroSearch( src, end, MVLC_END, VLC_TRUE );
uint8_t *start = src;
uint8_t *stop = MacroSearch( src, end, MVLC_END, VLC_FALSE );
char *endfor = MacroSearch( src, end, MVLC_END, VLC_TRUE );
char *start = src;
char *stop = MacroSearch( src, end, MVLC_END, VLC_FALSE );
if( stop )
{
......@@ -2640,9 +2640,11 @@ static void Execute( httpd_file_sys_t *p_args,
****************************************************************************/
static int HttpCallback( httpd_file_sys_t *p_args,
httpd_file_t *p_file,
uint8_t *p_request,
uint8_t **pp_data, int *pi_data )
uint8_t *_p_request,
uint8_t **_pp_data, int *pi_data )
{
char *p_request = (char *)_p_request;
char **pp_data = (char **)_pp_data;
int i_request = p_request ? strlen( p_request ) : 0;
char *p;
FILE *f;
......@@ -2677,8 +2679,8 @@ static int HttpCallback( httpd_file_sys_t *p_args,
else
{
int i_buffer;
uint8_t *p_buffer;
uint8_t *dst;
char *p_buffer;
char *dst;
vlc_value_t val;
char position[4]; /* percentage */
char time[12]; /* in seconds */
......
......@@ -111,10 +111,10 @@ typedef struct
{
int i_mode; /* read or write */
int fd;
uint8_t buffer_read[1000]; // 1000 byte per command should be sufficient
char buffer_read[1000]; // 1000 byte per command should be sufficient
char *buffer_write;
uint8_t *p_buffer_read;
uint8_t *p_buffer_write; // the position in the buffer
char *p_buffer_read;
char *p_buffer_write; // the position in the buffer
int i_buffer_write; // the number of byte we still have to send
int i_tel_cmd; // for specific telnet commands
......@@ -336,7 +336,7 @@ static void Run( intf_thread_t *p_intf )
switch( cl->i_tel_cmd )
{
case 0:
switch( *cl->p_buffer_read )
switch( *(uint8_t *)cl->p_buffer_read )
{
case '\r':
break;
......@@ -354,7 +354,7 @@ static void Run( intf_thread_t *p_intf )
}
break;
case 1:
switch( *cl->p_buffer_read )
switch( *(uint8_t *)cl->p_buffer_read )
{
case TEL_WILL: case TEL_WONT:
case TEL_DO: case TEL_DONT:
......
......@@ -104,7 +104,7 @@ static int Open( vlc_object_t *p_this )
uint8_t *p_peek;
if( stream_Peek( p_demux->s, &p_peek, 12 ) < 12 ) return VLC_EGENERIC;
if( strncmp( &p_peek[0], "FORM", 4 ) || strncmp( &p_peek[8], "AIFF", 4 ) )
if( strncmp( (char *)&p_peek[0], "FORM", 4 ) || strncmp( (char *)&p_peek[8], "AIFF", 4 ) )
{
return VLC_EGENERIC;
}
......@@ -134,7 +134,7 @@ static int Open( vlc_object_t *p_this )
msg_Dbg( p_demux, "chunk fcc=%4.4s size=%d", p_peek, i_size );
if( !strncmp( &p_peek[0], "COMM", 4 ) )
if( !strncmp( (char *)&p_peek[0], "COMM", 4 ) )
{
if( stream_Peek( p_demux->s, &p_peek, 18 + 8 ) < 18 + 8 )
{
......@@ -149,7 +149,7 @@ static int Open( vlc_object_t *p_this )
msg_Dbg( p_demux, "COMM: channels=%d samples_frames=%d bits=%d rate=%d",
GetWBE( &p_peek[8] ), GetDWBE( &p_peek[10] ), GetWBE( &p_peek[14] ), GetF80BE( &p_peek[16] ) );
}
else if( !strncmp( &p_peek[0], "SSND", 4 ) )
else if( !strncmp( (char *)&p_peek[0], "SSND", 4 ) )
{
if( stream_Peek( p_demux->s, &p_peek, 8 + 8 ) < 8 + 8 )
{
......
......@@ -212,8 +212,8 @@ static int Open( vlc_object_t * p_this )
for( i_peeker = 0; i_peeker < 188; i_peeker++ )
{
if( !strncmp( &p_peek[0], "RIFF", 4 ) &&
!strncmp( &p_peek[8], "AVI ", 4 ) ) break;
if( !strncmp( (char *)&p_peek[0], "RIFF", 4 ) &&
!strncmp( (char *)&p_peek[8], "AVI ", 4 ) ) break;
p_peek++;
}
if( i_peeker == 188 )
......
......@@ -126,8 +126,8 @@ static int Activate( vlc_object_t * p_this )
/* We double check for file != m3u as some asx are just m3u file */
if( i_type != TYPE_M3U )
{
uint8_t *p_peek;
int i_size = stream_Peek( p_demux->s, &p_peek, MAX_LINE );
char *p_peek;
int i_size = stream_Peek( p_demux->s, (uint8_t *)&p_peek, MAX_LINE );
i_size -= sizeof("[Reference]") - 1;
if( i_size > 0 )
......
......@@ -188,7 +188,7 @@ static vlc_bool_t CheckMimeHeader( demux_t *p_demux, int *p_header_size )
*p_header_size = -2;
return VLC_FALSE;
}
if( strncmp( p_sys->p_peek, "--", 2 ) )
if( strncmp( (char *)p_sys->p_peek, "--", 2 ) )
{
*p_header_size = 0;
return VLC_FALSE;
......@@ -476,7 +476,7 @@ static int MimeDemux( demux_t *p_demux )
}
}
}
if( !strncmp( p_sys->psz_separator, p_sys->p_peek + i + 2,
if( !strncmp( p_sys->psz_separator, (char *)(p_sys->p_peek + i + 2),
strlen( p_sys->psz_separator ) ) )
{
b_done = VLC_TRUE;
......
......@@ -94,7 +94,7 @@ static int Open( vlc_object_t * p_this )
msg_Err( p_demux, "cannot peek" );
return VLC_EGENERIC;
}
if( !strncmp( p_peek, "ADIF", 4 ) )
if( !strncmp( (char *)p_peek, "ADIF", 4 ) )
{
msg_Err( p_demux, "ADIF file. Not yet supported. (Please report)" );
return VLC_EGENERIC;
......
......@@ -202,7 +202,7 @@ static int Open( vlc_object_t * p_this )
i_skip = MPGA_MODE( header ) != 3 ? 21 : 13;
}
if( i_skip + 8 < i_xing && !strncmp( &p_xing[i_skip], "Xing", 4 ) )
if( i_skip + 8 < i_xing && !strncmp( (char *)&p_xing[i_skip], "Xing", 4 ) )
{
unsigned int i_flags = GetDWBE( &p_xing[i_skip+4] );
......
......@@ -88,9 +88,11 @@ static int Open( vlc_object_t *p_this )
uint8_t *p_peek;
if( stream_Peek( p_demux->s, &p_peek, 8 ) < 8 ) return VLC_EGENERIC;
if( stream_Peek( p_demux->s, &p_peek, 8 ) < 8 )
return VLC_EGENERIC;
if( strncmp( p_peek, "NSVf", 4 ) && strncmp( p_peek, "NSVs", 4 ))
if( strncmp( (char *)p_peek, "NSVf", 4 )
&& strncmp( (char *)p_peek, "NSVs", 4 ))
{
/* In case we had force this demuxer we try to resynch */
if( strcmp( p_demux->psz_demux, "nsv" ) || ReSynch( p_demux ) )
......@@ -153,14 +155,14 @@ static int Demux( demux_t *p_demux )
return 0;
}
if( !strncmp( p_peek, "NSVf", 4 ) )
if( !strncmp( (char *)p_peek, "NSVf", 4 ) )
{
if( ReadNSVf( p_demux ) )
{
return -1;
}
}
else if( !strncmp( p_peek, "NSVs", 4 ) )
else if( !strncmp( (char *)p_peek, "NSVs", 4 ) )
{
if( ReadNSVs( p_demux ) )
{
......@@ -380,7 +382,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
*****************************************************************************/
static int ReSynch( demux_t *p_demux )
{
uint8_t *p_peek;
uint8_t *p_peek;
int i_skip;
int i_peek;
......@@ -394,7 +396,8 @@ static int ReSynch( demux_t *p_demux )
while( i_skip < i_peek - 4 )
{
if( !strncmp( p_peek, "NSVf", 4 ) || !strncmp( p_peek, "NSVs", 4 ) )
if( !strncmp( (char *)p_peek, "NSVf", 4 )
|| !strncmp( (char *)p_peek, "NSVs", 4 ) )
{
if( i_skip > 0 )
{
......
......@@ -198,8 +198,8 @@ static int Open( vlc_object_t * p_this )
/* Check id */
if( stream_Peek( p_demux->s, &p_peek, 12 ) != 12 ||
( strncmp( p_peek, "MythTVVideo", 11 ) &&
strncmp( p_peek, "NuppelVideo", 11 ) ) )
( strncmp( (char *)p_peek, "MythTVVideo", 11 ) &&
strncmp( (char *)p_peek, "NuppelVideo", 11 ) ) )
return VLC_EGENERIC;
p_sys = malloc( sizeof( demux_sys_t ) );
......
......@@ -61,7 +61,7 @@ int E_(Import_M3U)( vlc_object_t *p_this )
}
psz_ext = strrchr ( p_demux->psz_path, '.' );
if( !strncmp( p_peek, "#EXTM3U", 7 ) )
if( !strncmp( (char *)p_peek, "#EXTM3U", 7 ) )
{
;
}
......
......@@ -50,7 +50,7 @@ int E_(Import_Old)( vlc_object_t *p_this )
if( stream_Peek( p_demux->s, &p_peek, 31 ) < 31 ) return VLC_EGENERIC;
if( strncmp( p_peek, PLAYLIST_FILE_HEADER , 31 ) ) return VLC_EGENERIC;
if( strncmp( (char *)p_peek, PLAYLIST_FILE_HEADER , 31 ) ) return VLC_EGENERIC;
msg_Dbg( p_demux, "found valid old playlist file");
......
......@@ -58,7 +58,7 @@ int E_(Import_PLS)( vlc_object_t *p_this )
if( stream_Peek( p_demux->s , &p_peek, 7 ) < 7 ) return VLC_EGENERIC;
psz_ext = strrchr ( p_demux->psz_path, '.' );
if( !strncasecmp( p_peek, "[playlist]", 10 ) )
if( !strncasecmp( (char *)p_peek, "[playlist]", 10 ) )
{
;
}
......
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