From 40785cad487daf4df6418b07f28bdd03d1ca3f03 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Fri, 20 Jul 2007 14:22:54 +0000 Subject: [PATCH] Make stream_Peek take a const pointer as it should (This introduces a lot of warnings) --- include/vlc_stream.h | 2 +- src/input/demux.c | 6 +++--- src/input/input_internal.h | 2 +- src/input/mem_stream.c | 4 ++-- src/input/stream.c | 16 ++++++++-------- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/vlc_stream.h b/include/vlc_stream.h index 81f0f50c77..bdb480d05b 100644 --- a/include/vlc_stream.h +++ b/include/vlc_stream.h @@ -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, ... ) ); diff --git a/src/input/demux.c b/src/input/demux.c index 62706566fc..2712f96d00 100644 --- a/src/input/demux.c +++ b/src/input/demux.c @@ -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; diff --git a/src/input/input_internal.h b/src/input/input_internal.h index 07a8609a5d..7c8d366fac 100644 --- a/src/input/input_internal.h +++ b/src/input/input_internal.h @@ -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 *); diff --git a/src/input/mem_stream.c b/src/input/mem_stream.c index 950ff3b29b..d6f747c475 100644 --- a/src/input/mem_stream.c +++ b/src/input/mem_stream.c @@ -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 ); diff --git a/src/input/stream.c b/src/input/stream.c index 72f1bab348..ab77a9fafe 100644 --- a/src/input/stream.c +++ b/src/input/stream.c @@ -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 ); } -- 2.39.2