[Mplayer-cvslog] CVS: main parser-mpcmd.c,1.10,1.11

Pierre Lombard p_l at gmx.fr
Thu Aug 7 23:58:22 CEST 2003


Hi,

* Alex Beregszaszi <alex at mplayerhq.hu> [2003-08-03 19:34]:
> Update of /cvsroot/mplayer/main
> In directory mail:/var/tmp.root/cvs-serv526
> 
> Modified Files:
> 	parser-mpcmd.c 
> Log Message:
> c vs c++ syntax

I've just updated my cvs and this update seems to break multiple files
support (some value passing instead of reference passing).

Patch attached (not sure if the variable names should be changed though).


> Index: parser-mpcmd.c
> ===================================================================
> RCS file: /cvsroot/mplayer/main/parser-mpcmd.c,v
> retrieving revision 1.10
> retrieving revision 1.11
> diff -u -r1.10 -r1.11
> --- parser-mpcmd.c	9 Jul 2003 01:29:45 -0000	1.10
> +++ parser-mpcmd.c	3 Aug 2003 17:42:43 -0000	1.11
> @@ -49,6 +49,15 @@
>      return 0;
>  }
>  
> +static inline void add_entry(play_tree_t *last_parent,
> +	play_tree_t *last_entry, play_tree_t *entry) {
> +    if(last_entry == NULL)
> +      play_tree_set_child(last_parent,entry);		      
> +    else 
> +      play_tree_append_entry(last_entry,entry);
> +    last_entry = entry;
       ~~~~~~~~~~~~~~~~~~~
> +}
> +
>  play_tree_t*
>  m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv)
>  {
> @@ -57,13 +66,6 @@
>    char *opt;
>    int no_more_opts = 0;
>    play_tree_t *last_parent, *last_entry = NULL, *root;
> -  void add_entry(play_tree_t *entry) {
> -    if(last_entry == NULL)
> -      play_tree_set_child(last_parent,entry);		      
> -    else 
> -      play_tree_append_entry(last_entry,entry);
> -    last_entry = entry;
> -  }
>  
>  #ifdef MP_DEBUG
>    assert(config != NULL);
> @@ -160,7 +162,7 @@
>  	  tmp = is_entry_option(opt,(i+1<argc) ? argv[i + 1] : NULL,&entry);
>  	  if(tmp > 0)  { // It's an entry
>  	    if(entry) {
> -	      add_entry(entry);
> +	      add_entry(last_parent,last_entry,entry);
>  	      if((last_parent->flags & PLAY_TREE_RND) && entry->child)
>  		entry->flags |= PLAY_TREE_RND;
>  	      UNSET_GLOBAL;
> @@ -201,7 +203,7 @@
>  	// Lock stdin if it will be used as input
>  	if(strcasecmp(argv[i],"-") == 0)
>  	  m_config_set_option(config,"use-stdin",NULL);
> -	add_entry(entry);
> +	add_entry(last_parent,last_entry,entry);
>  	UNSET_GLOBAL; // We start entry specific options
>  
>        }

-- 
Best regards,
  pl
-------------- next part --------------
Index: parser-mpcmd.c
===================================================================
RCS file: /cvsroot/mplayer/main/parser-mpcmd.c,v
retrieving revision 1.11
diff -u -r1.11 parser-mpcmd.c
--- parser-mpcmd.c	3 Aug 2003 17:42:43 -0000	1.11
+++ parser-mpcmd.c	7 Aug 2003 22:03:55 -0000
@@ -49,13 +49,13 @@
     return 0;
 }
 
-static inline void add_entry(play_tree_t *last_parent,
-	play_tree_t *last_entry, play_tree_t *entry) {
-    if(last_entry == NULL)
-      play_tree_set_child(last_parent,entry);		      
+static inline void add_entry(play_tree_t **last_parentp,
+	play_tree_t **last_entryp, play_tree_t *entry) {
+    if(*last_entryp == NULL)
+      play_tree_set_child(*last_parentp,entry);		      
     else 
-      play_tree_append_entry(last_entry,entry);
-    last_entry = entry;
+      play_tree_append_entry(*last_entryp,entry);
+    *last_entryp = entry;
 }
 
 play_tree_t*
@@ -162,7 +162,7 @@
 	  tmp = is_entry_option(opt,(i+1<argc) ? argv[i + 1] : NULL,&entry);
 	  if(tmp > 0)  { // It's an entry
 	    if(entry) {
-	      add_entry(last_parent,last_entry,entry);
+	      add_entry(&last_parent,&last_entry,entry);
 	      if((last_parent->flags & PLAY_TREE_RND) && entry->child)
 		entry->flags |= PLAY_TREE_RND;
 	      UNSET_GLOBAL;
@@ -203,7 +203,7 @@
 	// Lock stdin if it will be used as input
 	if(strcasecmp(argv[i],"-") == 0)
 	  m_config_set_option(config,"use-stdin",NULL);
-	add_entry(last_parent,last_entry,entry);
+	add_entry(&last_parent,&last_entry,entry);
 	UNSET_GLOBAL; // We start entry specific options
 
       }


More information about the MPlayer-cvslog mailing list