[MPlayer-cvslog] r33608 - in trunk: playtree.c playtree.h

reimar subversion at mplayerhq.hu
Mon Jun 13 21:39:18 CEST 2011


Author: reimar
Date: Mon Jun 13 21:39:18 2011
New Revision: 33608

Log:
Mark some char * arguments that are strdup'd const,
makes the API slightly clearer.

Modified:
   trunk/playtree.c
   trunk/playtree.h

Modified: trunk/playtree.c
==============================================================================
--- trunk/playtree.c	Mon Jun 13 21:33:17 2011	(r33607)
+++ trunk/playtree.c	Mon Jun 13 21:39:18 2011	(r33608)
@@ -279,7 +279,7 @@ play_tree_set_parent(play_tree_t* pt, pl
 
 
 void
-play_tree_add_file(play_tree_t* pt,char* file) {
+play_tree_add_file(play_tree_t* pt,const char* file) {
   int n = 0;
 
 #ifdef MP_DEBUG
@@ -310,7 +310,7 @@ play_tree_add_file(play_tree_t* pt,char*
 }
 
 int
-play_tree_remove_file(play_tree_t* pt,char* file) {
+play_tree_remove_file(play_tree_t* pt,const char* file) {
   int n,f = -1;
 
 #ifdef MP_DEBUG
@@ -349,7 +349,7 @@ play_tree_remove_file(play_tree_t* pt,ch
 }
 
 void
-play_tree_set_param(play_tree_t* pt, char* name, char* val) {
+play_tree_set_param(play_tree_t* pt, const char* name, const char* val) {
   int n = 0;
 
 #ifdef MP_DEBUG
@@ -373,7 +373,7 @@ play_tree_set_param(play_tree_t* pt, cha
 }
 
 int
-play_tree_unset_param(play_tree_t* pt, char* name) {
+play_tree_unset_param(play_tree_t* pt, const char* name) {
   int n,ni = -1;
 
 #ifdef MP_DEBUG
@@ -931,7 +931,7 @@ void pt_iter_replace_entry(play_tree_ite
 }
 
 //Add a new file as a new entry
-void pt_add_file(play_tree_t** ppt, char* filename)
+void pt_add_file(play_tree_t** ppt, const char* filename)
 {
   play_tree_t *pt = *ppt, *entry = play_tree_new();
 #ifdef MP_DEBUG

Modified: trunk/playtree.h
==============================================================================
--- trunk/playtree.h	Mon Jun 13 21:33:17 2011	(r33607)
+++ trunk/playtree.h	Mon Jun 13 21:39:18 2011	(r33608)
@@ -179,20 +179,20 @@ play_tree_remove(play_tree_t* pt, int fr
 
 /// Add a file to an item.
 void
-play_tree_add_file(play_tree_t* pt,char* file);
+play_tree_add_file(play_tree_t* pt,const char* file);
 
 /// Remove a file from an item.
 int
-play_tree_remove_file(play_tree_t* pt,char* file);
+play_tree_remove_file(play_tree_t* pt,const char* file);
 
 
 /// Add a config paramter to an item.
 void
-play_tree_set_param(play_tree_t* pt, char* name, char* val);
+play_tree_set_param(play_tree_t* pt, const char* name, const char* val);
 
 /// Remove a config parameter from an item.
 int
-play_tree_unset_param(play_tree_t* pt, char* name);
+play_tree_unset_param(play_tree_t* pt, const char* name);
 
 /// Copy the config parameters from one item to another.
 void
@@ -284,7 +284,7 @@ void pt_iter_insert_entry(play_tree_iter
 void pt_iter_replace_entry(play_tree_iter_t* iter, play_tree_t* entry);
 
 /// Adds a new file to the playtree, if it is not valid it is created.
-void pt_add_file(play_tree_t** ppt, char* filename);
+void pt_add_file(play_tree_t** ppt, const char* filename);
 
 // Macro to use only the iter and not the other things.
 #define pt_iter_add_file(iter, filename) pt_add_file(&iter->tree, filename)


More information about the MPlayer-cvslog mailing list