Commit 40785cad authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Make stream_Peek take a const pointer as it should

(This introduces a lot of warnings)
parent 8b91a2d0
......@@ -65,7 +65,7 @@ enum stream_query_e
};
VLC_EXPORT( int, stream_Read, ( stream_t *s, void *p_read, int i_read ) );
VLC_EXPORT( int, stream_Peek, ( stream_t *s, uint8_t **pp_peek, int i_peek ) );
VLC_EXPORT( int, stream_Peek, ( stream_t *s, const uint8_t **pp_peek, int i_peek ) );
VLC_EXPORT( int, stream_vaControl, ( stream_t *s, int i_query, va_list args ) );
VLC_EXPORT( void, stream_Delete, ( stream_t *s ) );
VLC_EXPORT( int, stream_Control, ( stream_t *s, int i_query, ... ) );
......
......@@ -297,7 +297,7 @@ typedef struct
} d_stream_sys_t;
static int DStreamRead ( stream_t *, void *p_read, int i_read );
static int DStreamPeek ( stream_t *, uint8_t **pp_peek, int i_peek );
static int DStreamPeek ( stream_t *, const uint8_t **pp_peek, int i_peek );
static int DStreamControl( stream_t *, int i_query, va_list );
static int DStreamThread ( stream_t * );
......@@ -419,7 +419,7 @@ static int DStreamRead( stream_t *s, void *p_read, int i_read )
return i_out;
}
static int DStreamPeek( stream_t *s, uint8_t **pp_peek, int i_peek )
static int DStreamPeek( stream_t *s, const uint8_t **pp_peek, int i_peek )
{
d_stream_sys_t *p_sys = (d_stream_sys_t*)s->p_sys;
block_t **pp_block = &p_sys->p_block;
......@@ -545,7 +545,7 @@ static int DStreamThread( stream_t *s )
****************************************************************************/
static void SkipID3Tag( demux_t *p_demux )
{
uint8_t *p_peek;
const uint8_t *p_peek;
uint8_t version, revision;
int i_size;
int b_footer;
......
......@@ -365,7 +365,7 @@ struct stream_t
block_t *(*pf_block) ( stream_t *, int i_size );
int (*pf_read) ( stream_t *, void *p_read, int i_read );
int (*pf_peek) ( stream_t *, uint8_t **pp_peek, int i_peek );
int (*pf_peek) ( stream_t *, const uint8_t **pp_peek, int i_peek );
int (*pf_control)( stream_t *, int i_query, va_list );
void (*pf_destroy)( stream_t *);
......
......@@ -36,7 +36,7 @@ struct stream_sys_t
};
static int Read ( stream_t *, void *p_read, int i_read );
static int Peek ( stream_t *, uint8_t **pp_peek, int i_read );
static int Peek ( stream_t *, const uint8_t **pp_peek, int i_read );
static int Control( stream_t *, int i_query, va_list );
static void Delete ( stream_t * );
......@@ -149,7 +149,7 @@ static int Read( stream_t *s, void *p_read, int i_read )
return i_res;
}
static int Peek( stream_t *s, uint8_t **pp_peek, int i_read )
static int Peek( stream_t *s, const uint8_t **pp_peek, int i_read )
{
stream_sys_t *p_sys = s->p_sys;
int i_res = __MIN( i_read, p_sys->i_size - p_sys->i_pos );
......
......@@ -167,14 +167,14 @@ struct stream_sys_t
/* Method 1: */
static int AStreamReadBlock( stream_t *s, void *p_read, int i_read );
static int AStreamPeekBlock( stream_t *s, uint8_t **p_peek, int i_read );
static int AStreamPeekBlock( stream_t *s, const uint8_t **p_peek, int i_read );
static int AStreamSeekBlock( stream_t *s, int64_t i_pos );
static void AStreamPrebufferBlock( stream_t *s );
static block_t *AReadBlock( stream_t *s, vlc_bool_t *pb_eof );
/* Method 2 */
static int AStreamReadStream( stream_t *s, void *p_read, int i_read );
static int AStreamPeekStream( stream_t *s, uint8_t **pp_peek, int i_read );
static int AStreamPeekStream( stream_t *s, const uint8_t **pp_peek, int i_read );
static int AStreamSeekStream( stream_t *s, int64_t i_pos );
static void AStreamPrebufferStream( stream_t *s );
static int AReadStream( stream_t *s, void *p_read, int i_read );
......@@ -705,7 +705,7 @@ static int AStreamReadBlock( stream_t *s, void *p_read, int i_read )
return i_data;
}
static int AStreamPeekBlock( stream_t *s, uint8_t **pp_peek, int i_read )
static int AStreamPeekBlock( stream_t *s, const uint8_t **pp_peek, int i_read )
{
stream_sys_t *p_sys = s->p_sys;
uint8_t *p_data;
......@@ -1046,7 +1046,7 @@ static int AStreamReadStream( stream_t *s, void *p_read, int i_read )
return i_data;
}
static int AStreamPeekStream( stream_t *s, uint8_t **pp_peek, int i_read )
static int AStreamPeekStream( stream_t *s, const uint8_t **pp_peek, int i_read )
{
stream_sys_t *p_sys = s->p_sys;
stream_track_t *tk = &p_sys->stream.tk[p_sys->stream.i_tk];
......@@ -1401,7 +1401,7 @@ char * stream_ReadLine( stream_t *s )
while( i_read < STREAM_LINE_MAX )
{
char *psz_eol;
uint8_t *p_data;
const uint8_t *p_data;
int i_data;
int64_t i_pos;
......@@ -1504,8 +1504,8 @@ char * stream_ReadLine( stream_t *s )
}
else
{
uint8_t *p = p_data;
uint8_t *p_last = p + i_data - s->i_char_width;
const uint8_t *p = p_data;
const uint8_t *p_last = p + i_data - s->i_char_width;
if( s->i_char_width == 2 )
{
......@@ -1837,7 +1837,7 @@ int stream_Read( stream_t *s, void *p_read, int i_read )
* the end of the stream (but only when you have i_peek >=
* p_input->i_bufsize)
*/
int stream_Peek( stream_t *s, uint8_t **pp_peek, int i_peek )
int stream_Peek( stream_t *s, const uint8_t **pp_peek, int i_peek )
{
return s->pf_peek( s, pp_peek, i_peek );
}
......
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