public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/3] Remove superfluous function key_is_command_char()
@ 2015-01-08  4:05 Patrick Palka
  2015-01-08  4:05 ` [PATCH 2/3] TUI: Don't print KEY_RESIZE keys Patrick Palka
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Patrick Palka @ 2015-01-08  4:05 UTC (permalink / raw)
  To: gdb-patches; +Cc: Patrick Palka

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/tui/tui-io.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c
index 233e7a6..b0e6c75 100644
--- a/gdb/tui/tui-io.c
+++ b/gdb/tui/tui-io.c
@@ -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) \
@@ -682,10 +671,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;
-- 
2.2.1.212.gc5b9256

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2015-02-17 13:24 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-08  4:05 [PATCH 1/3] Remove superfluous function key_is_command_char() Patrick Palka
2015-01-08  4:05 ` [PATCH 2/3] TUI: Don't print KEY_RESIZE keys Patrick Palka
2015-01-08 11:29   ` Pedro Alves
2015-01-08 12:32     ` Patrick Palka
2015-01-08 13:22       ` Pedro Alves
2015-01-08 13:38         ` Patrick Palka
2015-02-11  0:25         ` Patrick Palka
2015-02-16 22:42           ` Pedro Alves
2015-02-17  0:53             ` Patrick Palka
2015-02-17 10:23               ` Pedro Alves
2015-02-17 13:02                 ` Patrick Palka
2015-02-17 13:24                 ` Patrick Palka
2015-01-08  4:05 ` [PATCH 3/3] Don't flush the prompt when resizing the terminal within TUI Patrick Palka
2015-01-08 11:39   ` Pedro Alves
2015-01-08 11:40 ` [PATCH 1/3] Remove superfluous function key_is_command_char() Pedro Alves
2015-01-08 13:34 ` Eli Zaretskii
2015-01-08 13:48   ` Patrick Palka
2015-01-08 14:58     ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).