]> git.sesse.net Git - vlc/commitdiff
Make stream_Peek take a const pointer as it should
authorRémi Denis-Courmont <rem@videolan.org>
Fri, 20 Jul 2007 14:22:54 +0000 (14:22 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Fri, 20 Jul 2007 14:22:54 +0000 (14:22 +0000)
(This introduces a lot of warnings)

include/vlc_stream.h
src/input/demux.c
src/input/input_internal.h
src/input/mem_stream.c
src/input/stream.c

index 81f0f50c772c2b9bc245893688e4a3c6bd693aec..bdb480d05b9e29bd1e9e5c774902ff8c9ea95e20 100644 (file)
@@ -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, ... ) );
index 62706566fc124e8ce03b805eca99a2974681d56e..2712f96d0064706dc6798cde3dfa358a142f56cd 100644 (file)
@@ -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;
index 07a8609a5d51970cc6a02351f85cb1284a81f359..7c8d366faced4d56f5e2c42977712bdd37ac4034 100644 (file)
@@ -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 *);
 
index 950ff3b29b0f910af9c89f9ce27d6745407aecfd..d6f747c475097ef97ed2c6d102064e947fd4a850 100644 (file)
@@ -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 );
index 72f1bab3486cdf7894c1981b73547ecc43c8f590..ab77a9fafed490a01d0a5810805a268619678cd5 100644 (file)
@@ -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 );
 }