[vlc-devel] commit: Constify ( Rémi Denis-Courmont )

git version control git at videolan.org
Thu Oct 1 20:47:13 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Oct  1 21:41:52 2009 +0300| [c033b745b72b8878a3d3e018613619c7dccd3dca] | committer: Rémi Denis-Courmont 

Constify

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c033b745b72b8878a3d3e018613619c7dccd3dca
---

 modules/demux/playlist/playlist.c |   10 +++++-----
 modules/demux/playlist/playlist.h |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/demux/playlist/playlist.c b/modules/demux/playlist/playlist.c
index 8e104c0..6799451 100644
--- a/modules/demux/playlist/playlist.c
+++ b/modules/demux/playlist/playlist.c
@@ -202,7 +202,7 @@ char *FindPrefix( demux_t *p_demux )
  * Add the directory part of the playlist file to the start of the
  * mrl, if the mrl is a relative file path
  */
-char *ProcessMRL( char *psz_mrl, char *psz_prefix )
+char *ProcessMRL( const char *psz_mrl, const char *psz_prefix )
 {
     /* Check for a protocol name.
      * for URL, we should look for "://"
@@ -222,8 +222,8 @@ char *ProcessMRL( char *psz_mrl, char *psz_prefix )
     if( strchr( psz_mrl, ':' ) ) return strdup( psz_mrl );
 
     /* This a relative path, prepend the prefix */
-    if( asprintf( &psz_mrl, "%s%s", psz_prefix, psz_mrl ) != -1 )
-        return psz_mrl;
-    else
-        return NULL;
+    char *ret;
+    if( asprintf( &ret, "%s%s", psz_prefix, psz_mrl ) == -1 )
+        ret = NULL;
+    return ret;
 }
diff --git a/modules/demux/playlist/playlist.h b/modules/demux/playlist/playlist.h
index 8b74778..3c3c807 100644
--- a/modules/demux/playlist/playlist.h
+++ b/modules/demux/playlist/playlist.h
@@ -24,7 +24,7 @@
 #include <vlc_input.h>
 #include <vlc_playlist.h>
 
-char *ProcessMRL( char *, char * );
+char *ProcessMRL( const char *, const char * );
 char *FindPrefix( demux_t * );
 
 int Import_Old ( vlc_object_t * );




More information about the vlc-devel mailing list