[MPlayer-cvslog] r30739 - in trunk/stream: open.c stream.c stream.h

reimar subversion at mplayerhq.hu
Thu Feb 25 23:47:04 CET 2010


Author: reimar
Date: Thu Feb 25 23:47:04 2010
New Revision: 30739

Log:
Mark stream open filename parameter as const, the filename string is not
modified by these functions.

Modified:
   trunk/stream/open.c
   trunk/stream/stream.c
   trunk/stream/stream.h

Modified: trunk/stream/open.c
==============================================================================
--- trunk/stream/open.c	Thu Feb 25 23:44:02 2010	(r30738)
+++ trunk/stream/open.c	Thu Feb 25 23:47:04 2010	(r30739)
@@ -47,7 +47,7 @@ int dvd_title=0;
 
 // Open a new stream  (stdin/file/vcd/url)
 
-stream_t* open_stream(char* filename,char** options, int* file_format){
+stream_t* open_stream(const char* filename,char** options, int* file_format){
   // Check if playlist or unknown
   if (*file_format != DEMUXER_TYPE_PLAYLIST){
     *file_format=DEMUXER_TYPE_UNKNOWN;

Modified: trunk/stream/stream.c
==============================================================================
--- trunk/stream/stream.c	Thu Feb 25 23:44:02 2010	(r30738)
+++ trunk/stream/stream.c	Thu Feb 25 23:47:04 2010	(r30739)
@@ -140,7 +140,7 @@ static const stream_info_t* const auto_o
   NULL
 };
 
-static stream_t* open_stream_plugin(const stream_info_t* sinfo, char* filename,
+static stream_t* open_stream_plugin(const stream_info_t* sinfo, const char* filename,
                                     int mode, char** options, int* file_format,
                                     int* ret, char** redirected_url)
 {
@@ -208,7 +208,7 @@ static stream_t* open_stream_plugin(cons
 }
 
 
-stream_t* open_stream_full(char* filename,int mode, char** options, int* file_format) {
+stream_t* open_stream_full(const char* filename,int mode, char** options, int* file_format) {
   int i,j,l,r;
   const stream_info_t* sinfo;
   stream_t* s;
@@ -250,7 +250,7 @@ stream_t* open_stream_full(char* filenam
   return NULL;
 }
 
-stream_t* open_output_stream(char* filename,char** options) {
+stream_t* open_output_stream(const char* filename, char** options) {
   int file_format; //unused
   if(!filename) {
     mp_msg(MSGT_OPEN,MSGL_ERR,"open_output_stream(), NULL filename, report this bug\n");

Modified: trunk/stream/stream.h
==============================================================================
--- trunk/stream/stream.h	Thu Feb 25 23:44:02 2010	(r30738)
+++ trunk/stream/stream.h	Thu Feb 25 23:47:04 2010	(r30739)
@@ -339,9 +339,9 @@ int stream_control(stream_t *s, int cmd,
 stream_t* new_stream(int fd,int type);
 void free_stream(stream_t *s);
 stream_t* new_memory_stream(unsigned char* data,int len);
-stream_t* open_stream(char* filename,char** options,int* file_format);
-stream_t* open_stream_full(char* filename,int mode, char** options, int* file_format);
-stream_t* open_output_stream(char* filename,char** options);
+stream_t* open_stream(const char* filename,char** options,int* file_format);
+stream_t* open_stream_full(const char* filename,int mode, char** options, int* file_format);
+stream_t* open_output_stream(const char* filename,char** options);
 /// Set the callback to be used by libstream to check for user
 /// interruption during long blocking operations (cache filling, etc).
 void stream_set_interrupt_callback(int (*cb)(int));


More information about the MPlayer-cvslog mailing list