[Mplayer-cvslog] CVS: 0_90/input input.c,1.67,1.68 joystick.c,1.5,1.6

Diego Biurrun CVS diego at mplayerhq.hu
Wed Jul 9 19:44:48 CEST 2003


Update of /cvsroot/mplayer/0_90/input
In directory mail:/var/tmp.root/cvs-serv8001/input

Modified Files:
	input.c joystick.c 
Log Message:
Ported from main:
Output typos fixed.
Spelling and grammar fixes in comments.
Output Cosmetics


Index: input.c
===================================================================
RCS file: /cvsroot/mplayer/0_90/input/input.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -r1.67 -r1.68
--- input.c	12 Jan 2003 18:56:48 -0000	1.67
+++ input.c	9 Jul 2003 17:44:45 -0000	1.68
@@ -33,13 +33,13 @@
 #include "lirc.h"
 #endif
 
-/// This array defines all know commands.
-/// The first field is an id used to recognize the command without too many strcmp
-/// The second is abviously the command name
-/// The third is the minimum number of argument this command need
-/// Then come the definition of each argument, terminated with and arg of type -1
-/// A command can take maximum MP_CMD_MAX_ARGS-1 arguments (-1 because of
-/// the terminal one) wich is actually 9
+/// This array defines all known commands.
+/// The first field is an id used to recognize the command without too many strcmp.
+/// The second is obviously the command name.
+/// The third is the minimum number of arguments this command needs.
+/// Then comes the definition of each argument, terminated with an arg of type -1.
+/// A command can take a maximum of MP_CMD_MAX_ARGS-1 arguments (-1 because of
+/// the last one) which is actually 9.
 
 /// For the args, the first field is the type (actually int, float or string), the second
 /// is the default value wich is used for optional arguments
@@ -116,7 +116,7 @@
   { 0, NULL, 0, {} }
 };
 
-/// The names of the key for input.conf
+/// The names of the keys as used in input.conf
 /// If you add some new keys, you also need to add them here
 
 static mp_key_name_t key_names[] = {
@@ -185,8 +185,8 @@
   { 0, NULL }
 };
 
-// This is the default binding. The content of input.conf override these ones.
-// The first args is a null terminated array of key codes.
+// This is the default binding. The content of input.conf overrides these.
+// The first arg is a null terminated array of key codes.
 // The second is the command
 
 static mp_cmd_bind_t def_cmd_binds[] = {
@@ -308,7 +308,7 @@
   void* read_func;
   mp_close_func_t close_func;
   int flags;
-  // This fields are for the cmd fds
+  // These fields are for the cmd fds.
   char* buffer;
   int pos,size;
 } mp_input_fd_t;
@@ -389,7 +389,7 @@
 int
 mp_input_add_cmd_fd(int fd, int select, mp_cmd_func_t read_func, mp_close_func_t close_func) {
   if(num_cmd_fd == MP_MAX_CMD_FD) {
-    mp_msg(MSGT_INPUT,MSGL_ERR,"Too much command fd, unable to register fd %d\n",fd);
+    mp_msg(MSGT_INPUT,MSGL_ERR,"Too many command fds, unable to register fd %d.\n",fd);
     return 0;
   }
 
@@ -445,7 +445,7 @@
 int
 mp_input_add_key_fd(int fd, int select, mp_key_func_t read_func, mp_close_func_t close_func) {
   if(num_key_fd == MP_MAX_KEY_FD) {
-    mp_msg(MSGT_INPUT,MSGL_ERR,"Too much key fd, unable to register fd %d\n",fd);
+    mp_msg(MSGT_INPUT,MSGL_ERR,"Too many key fds, unable to register fd %d.\n",fd);
     return 0;
   }
 
@@ -509,7 +509,7 @@
       errno = 0;
       cmd->args[i].v.i = atoi(ptr);
       if(errno != 0) {
-	mp_msg(MSGT_INPUT,MSGL_ERR,"Command %s : argument %d isn't an integer\n",cmd_def->name,i+1);
+	mp_msg(MSGT_INPUT,MSGL_ERR,"Command %s: argument %d isn't an integer.\n",cmd_def->name,i+1);
 	ptr = NULL;
       }
       break;
@@ -524,7 +524,7 @@
       setlocale(LC_NUMERIC, "");
 #endif
       if(errno != 0) {
-	mp_msg(MSGT_INPUT,MSGL_ERR,"Command %s : argument %d isn't a float\n",cmd_def->name,i+1);
+	mp_msg(MSGT_INPUT,MSGL_ERR,"Command %s: argument %d isn't a float.\n",cmd_def->name,i+1);
 	ptr = NULL;
       }
       break;
@@ -546,7 +546,7 @@
       }
       
       if(term != ' ' && (!e || e[0] == '\0')) {
-	mp_msg(MSGT_INPUT,MSGL_ERR,"Command %s : argument %d is unterminated\n",cmd_def->name,i+1);
+	mp_msg(MSGT_INPUT,MSGL_ERR,"Command %s: argument %d is unterminated.\n",cmd_def->name,i+1);
 	ptr = NULL;
 	break;
       } else if(!e) e = ptr+strlen(ptr);
@@ -570,7 +570,7 @@
 
   if(cmd_def->nargs > cmd->nargs) {
     mp_msg(MSGT_INPUT,MSGL_ERR,"Got command '%s' but\n",str);
-    mp_msg(MSGT_INPUT,MSGL_ERR,"command %s require at least %d arguments, we found only %d so far\n",cmd_def->name,cmd_def->nargs,cmd->nargs);
+    mp_msg(MSGT_INPUT,MSGL_ERR,"command %s requires at least %d arguments, we found only %d so far.\n",cmd_def->name,cmd_def->nargs,cmd->nargs);
     mp_cmd_free(cmd);
     return NULL;
   }
@@ -608,7 +608,7 @@
   char* end;
   (*ret) = NULL;
 
-  // Allocate the buffer if it dont exist
+  // Allocate the buffer if it doesn't exist
   if(!mp_fd->buffer) {
     mp_fd->buffer = (char*)malloc(MP_CMD_MAX_SIZE*sizeof(char));
     mp_fd->pos = 0;
@@ -623,7 +623,7 @@
       switch(r) {
       case MP_INPUT_ERROR:
       case MP_INPUT_DEAD:
-	mp_msg(MSGT_INPUT,MSGL_ERR,"Error while reading cmd fd %d : %s\n",mp_fd->fd,strerror(errno));
+	mp_msg(MSGT_INPUT,MSGL_ERR,"Error while reading cmd fd %d: %s\n",mp_fd->fd,strerror(errno));
       case MP_INPUT_NOTHING:
 	return r;
       }
@@ -648,13 +648,13 @@
     if(!end) {
       // If buffer is full we must drop all until the next \n
       if(mp_fd->size - mp_fd->pos <= 1) {
-	mp_msg(MSGT_INPUT,MSGL_ERR,"Cmd buffer of fd %d is full : dropping content\n",mp_fd->fd);
+	mp_msg(MSGT_INPUT,MSGL_ERR,"Cmd buffer of fd %d is full: dropping content\n",mp_fd->fd);
 	mp_fd->pos = 0;
 	mp_fd->flags |= MP_FD_DROP;
       }
       break;
     }
-    // We alredy have a cmd : set the got_cmd flag
+    // We already have a cmd : set the got_cmd flag
     else if((*ret)) {
       mp_fd->flags |= MP_FD_GOT_CMD;
       break;
@@ -759,7 +759,7 @@
   }
   ret =  mp_input_parse_cmd(cmd);
   if(!ret) {
-    mp_msg(MSGT_INPUT,MSGL_ERR,"Invalid command for binded key %s",mp_input_get_key_name(key_down[0]));
+    mp_msg(MSGT_INPUT,MSGL_ERR,"Invalid command for bound key %s",mp_input_get_key_name(key_down[0]));
     if(  num_key_down > 1) {
       unsigned int s;
       for(s=1; s < num_key_down; s++)
@@ -809,14 +809,14 @@
     if(select(max_fd+1,&fds,NULL,NULL,time_val) < 0) {
       if(errno == EINTR)
 	continue;
-      mp_msg(MSGT_INPUT,MSGL_ERR,"Select error : %s\n",strerror(errno));
+      mp_msg(MSGT_INPUT,MSGL_ERR,"Select error: %s\n",strerror(errno));
     }
     break;
   }
     
   for(i = last_loop + 1 ; i != last_loop ; i++) {
     int code = -1;
-    // This is to check all fd in turn
+    // This is to check all fds in turn
     if((unsigned int)i >= num_key_fd) {
       i = -1;
       last_loop++;
@@ -867,7 +867,7 @@
     // key pushed
     if(code & MP_KEY_DOWN) {
       if(num_key_down > MP_MAX_KEY_DOWN) {
-	mp_msg(MSGT_INPUT,MSGL_ERR,"Too much key down at the same time\n");
+	mp_msg(MSGT_INPUT,MSGL_ERR,"Too many key down events at the same time\n");
 	continue;
       }
       code &= ~MP_KEY_DOWN;
@@ -893,7 +893,7 @@
     }
     if(j == num_key_down) { // key was not in the down keys : add it
       if(num_key_down > MP_MAX_KEY_DOWN) {
-	mp_msg(MSGT_INPUT,MSGL_ERR,"Too much key down at the same time\n");
+	mp_msg(MSGT_INPUT,MSGL_ERR,"Too many key down events at the same time\n");
 	continue;
       }
       key_down[num_key_down] = code;
@@ -981,7 +981,7 @@
       if(i < 0) {
 	if(errno == EINTR)
 	  continue;
-	mp_msg(MSGT_INPUT,MSGL_ERR,"Select error : %s\n",strerror(errno));
+	mp_msg(MSGT_INPUT,MSGL_ERR,"Select error: %s\n",strerror(errno));
       }
       if(!got_cmd)
 	return NULL;
@@ -1236,7 +1236,7 @@
   fd = open(file,O_RDONLY);
 
   if(fd < 0) {
-    mp_msg(MSGT_INPUT,MSGL_ERR,"Can't open input config file %s : %s\n",file,strerror(errno));
+    mp_msg(MSGT_INPUT,MSGL_ERR,"Can't open input config file %s: %s\n",file,strerror(errno));
     return 0;
   }
 
@@ -1249,7 +1249,7 @@
       if(r < 0) {
 	if(errno == EINTR)
 	  continue;
-	mp_msg(MSGT_INPUT,MSGL_ERR,"Error while reading input config file %s : %s\n",file,strerror(errno));
+	mp_msg(MSGT_INPUT,MSGL_ERR,"Error while reading input config file %s: %s\n",file,strerror(errno));
 	mp_input_free_binds(binds);
 	close(fd);
 	return 0;
@@ -1262,7 +1262,7 @@
     }
     // Empty buffer : return
     if(bs <= 1) {
-      mp_msg(MSGT_INPUT,MSGL_INFO,"Input config file %s parsed : %d binds\n",file,n_binds);
+      mp_msg(MSGT_INPUT,MSGL_INFO,"Input config file %s parsed: %d binds\n",file,n_binds);
       if(binds)
 	cmd_binds = binds;
       close(fd);
@@ -1304,12 +1304,12 @@
       // Find the end of the key code name
       for(end = iter; end[0] != '\0' && strchr(SPACE_CHAR,end[0]) == NULL ; end++)
 	/*NOTHING */;
-      if(end[0] == '\0') { // Key name don't fit in the buffer
+      if(end[0] == '\0') { // Key name doesn't fit in the buffer
 	if(buffer == iter) {
 	  if(eof && (buffer-iter) == bs)
 	    mp_msg(MSGT_INPUT,MSGL_ERR,"Unfinished binding %s\n",iter);
 	  else
-	    mp_msg(MSGT_INPUT,MSGL_ERR,"Buffer is too small for this key name : %s\n",iter);
+	    mp_msg(MSGT_INPUT,MSGL_ERR,"Buffer is too small for this key name: %s\n",iter);
 	  mp_input_free_binds(binds);
 	  return 0;
 	}
@@ -1378,7 +1378,7 @@
       continue;
     }
   }
-  mp_msg(MSGT_INPUT,MSGL_ERR,"What are we doing here ?\n");
+  mp_msg(MSGT_INPUT,MSGL_ERR,"What are we doing here?\n");
   close(fd);
   return 0;
 }

Index: joystick.c
===================================================================
RCS file: /cvsroot/mplayer/0_90/input/joystick.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- joystick.c	23 May 2002 09:47:18 -0000	1.5
+++ joystick.c	9 Jul 2003 17:44:45 -0000	1.6
@@ -139,7 +139,7 @@
     } else
       return MP_INPUT_NOTHING;
   } else {
-    printf("Joystick warning unknow event type %d\n",ev.type);
+    printf("Joystick warning unknown event type %d\n",ev.type);
     return MP_INPUT_ERROR;
   }
 



More information about the MPlayer-cvslog mailing list