Remove superfluous function key_is_command_char()
authorPatrick Palka <patrick@parcs.ath.cx>
Tue, 17 Feb 2015 13:06:10 +0000 (08:06 -0500)
committerPatrick Palka <patrick@parcs.ath.cx>
Tue, 17 Feb 2015 13:06:10 +0000 (08:06 -0500)
The function key_is_command_char() is simply a predicate that determines
whether the function tui_dispatch_ctrl_char() will do anything useful.
Since tui_dispatch_ctrl_char() performs the same checks as
key_is_command_char() it is unnecessary to keep key_is_command_char()
around.  This patch removes this useless function and instead
unconditionally calls tui_dispatch_ctrl_char() inside its only caller,
tui_getc().

gdb/ChangeLog:

* tui/tui-io.c (tui_getc): Don't call key_is_command_char.
(key_is_command_char): Delete.

gdb/ChangeLog
gdb/tui/tui-io.c

index e57600035501fb49229f1478e2e03616b9b8a362..bf98df151dfa590611a3f7c9ea8ddb73c85a8a35 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-17  Patrick Palka  <patrick@parcs.ath.cx>
+
+       * tui/tui-io.c (tui_getc): Don't call key_is_command_char.
+       (key_is_command_char): Delete.
+
 2015-02-17  Pedro Alves  <palves@redhat.com>
 
        * tui/tui.c (tui_enable): Resize windows before anything
index 199f331520fde29851c900a34be678ecc8a55189..12bd29faa2e33107fb3f1e119f4bf745f2ec4172 100644 (file)
@@ -63,17 +63,6 @@ key_is_backspace (int ch)
   return (ch == 8);
 }
 
-int
-key_is_command_char (int ch)
-{
-  return ((ch == KEY_NPAGE) || (ch == KEY_PPAGE)
-         || (ch == KEY_LEFT) || (ch == KEY_RIGHT)
-         || (ch == KEY_UP) || (ch == KEY_DOWN)
-         || (ch == KEY_SF) || (ch == KEY_SR)
-         || (ch == (int)'\f') 
-         || key_is_start_sequence (ch));
-}
-
 /* Use definition from readline 4.3.  */
 #undef CTRL_CHAR
 #define CTRL_CHAR(c) \
@@ -640,10 +629,8 @@ tui_getc (FILE *fp)
         }
     }
   
-  if (key_is_command_char (ch))
-    {                          /* Handle prev/next/up/down here.  */
-      ch = tui_dispatch_ctrl_char (ch);
-    }
+  /* Handle prev/next/up/down here.  */
+  ch = tui_dispatch_ctrl_char (ch);
   
   if (ch == '\n' || ch == '\r' || ch == '\f')
     TUI_CMD_WIN->detail.command_info.curch = 0;
This page took 0.026725 seconds and 4 git commands to generate.