[MPlayer-dev-eng] [PATCH] input.c cruft

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Wed Mar 8 12:14:52 CET 2006


Hi,
the whole binds variable in the mp_input_parse_config looks like pure
cruft to me. Okay to remove (see attached patch)?

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: input/input.c
===================================================================
RCS file: /cvsroot/mplayer/main/input/input.c,v
retrieving revision 1.129
diff -u -r1.129 input.c
--- input/input.c	25 Dec 2005 19:22:48 -0000	1.129
+++ input/input.c	8 Mar 2006 11:13:12 -0000
@@ -1404,7 +1407,6 @@
   char *iter,*end;
   char buffer[BS_MAX];
   int n_binds = 0, keys[MP_MAX_KEY_DOWN+1] = { 0 };
-  mp_cmd_bind_t* binds = NULL;
 
   fd = open(file,O_RDONLY);
 
@@ -1423,7 +1425,6 @@
 	if(errno == EINTR)
 	  continue;
 	mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrReadingInputConfig,file,strerror(errno));
-	mp_input_free_binds(binds);
 	close(fd);
 	return 0;
       } else if(r == 0) {
@@ -1436,8 +1437,6 @@
     // Empty buffer : return
     if(bs <= 1) {
       mp_msg(MSGT_INPUT,MSGL_V,"Input config file %s parsed: %d binds\n",file,n_binds);
-      if(binds)
-	cmd_binds = binds;
       close(fd);
       return 1;
     }
@@ -1483,7 +1482,6 @@
 	    mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrUnfinishedBinding,iter);
 	  else
 	    mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrBuffer2SmallForKeyName,iter);
-	  mp_input_free_binds(binds);
 	  return 0;
 	}
 	memmove(buffer,iter,end-iter);
@@ -1496,7 +1494,6 @@
 	name[end-iter] = '\0';
 	if(! mp_input_get_input_from_name(name,keys)) {
 	  mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrUnknownKey,name);
-	  mp_input_free_binds(binds);
 	  close(fd);
 	  return 0;
 	}
@@ -1526,7 +1523,6 @@
       if(end[0] == '\0' && ! (eof && ((end+1) - buffer) == bs)) {
 	if(iter == buffer) {
 	  mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrBuffer2SmallForCmd,buffer);
-	  mp_input_free_binds(binds);
 	  close(fd);
 	  return 0;
 	}


More information about the MPlayer-dev-eng mailing list