[61/61] Remove unnecessary "return"s

Message ID 20190704170311.15982-62-tom@tromey.com
State New
Headers show
Series
  • More TUI refactorings
Related show

Commit Message

Tom Tromey July 4, 2019, 5:03 p.m.
The TUI has some "return;" statements at the end of void-returning
functions.  There's no need for these, so this patch removes them.

2019-07-04  Tom Tromey  <tom@tromey.com>

	* tui/tui-winsource.c (tui_update_source_window)
	(tui_update_source_window_as_is)
	(tui_update_source_windows_with_line): Remove return.
	* tui/tui-disasm.c (tui_show_disassem)
	(tui_show_disassem_and_update_source): Remove return.
	* tui/tui.c (tui_reset): Remove return.
	* tui/tui-wingeneral.c
	(tui_check_and_display_highlight_if_needed): Remove return.
---
 gdb/ChangeLog            | 11 +++++++++++
 gdb/tui/tui-disasm.c     |  5 +----
 gdb/tui/tui-wingeneral.c |  1 -
 gdb/tui/tui-winsource.c  |  7 -------
 gdb/tui/tui.c            |  2 --
 5 files changed, 12 insertions(+), 14 deletions(-)

-- 
2.17.2

Comments

Pedro Alves July 17, 2019, 12:37 p.m. | #1
On 7/4/19 6:03 PM, Tom Tromey wrote:
> @@ -293,12 +291,11 @@ tui_show_disassem_and_update_source (struct gdbarch *gdbarch,

>  	{

>  	  set_current_source_symtab_and_line (sal);

>  	  tui_update_locator_fullname (symtab_to_fullname (sal.symtab));

> +


Odd empty line.

>  	}

>        else

>  	tui_update_locator_fullname ("?");

>      }

> -

> -  return;

>  }

>  


Thanks,
Pedro Alves

Patch

diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c
index effe8e74528..17587809bcb 100644
--- a/gdb/tui/tui-disasm.c
+++ b/gdb/tui/tui-disasm.c
@@ -265,8 +265,6 @@  tui_show_disassem (struct gdbarch *gdbarch, CORE_ADDR start_addr)
   if (tui_current_layout () != SRC_DISASSEM_COMMAND 
       && win_with_focus == TUI_SRC_WIN)
     tui_set_win_focus_to (TUI_DISASM_WIN);
-
-  return;
 }
 
 
@@ -293,12 +291,11 @@  tui_show_disassem_and_update_source (struct gdbarch *gdbarch,
 	{
 	  set_current_source_symtab_and_line (sal);
 	  tui_update_locator_fullname (symtab_to_fullname (sal.symtab));
+
 	}
       else
 	tui_update_locator_fullname ("?");
     }
-
-  return;
 }
 
 void
diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c
index a2e48865761..dc556317297 100644
--- a/gdb/tui/tui-wingeneral.c
+++ b/gdb/tui/tui-wingeneral.c
@@ -122,7 +122,6 @@  tui_check_and_display_highlight_if_needed (struct tui_win_info *win_info)
 	tui_unhighlight_win (win_info);
 
     }
-  return;
 }
 
 
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index 71147da2f91..3de2692deea 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -77,8 +77,6 @@  tui_update_source_window (struct tui_source_window_base *win_info,
 {
   win_info->horizontal_offset = 0;
   tui_update_source_window_as_is (win_info, gdbarch, s, line_or_addr, noerror);
-
-  return;
 }
 
 
@@ -125,9 +123,6 @@  tui_update_source_window_as_is (struct tui_source_window_base *win_info,
 	    tui_set_win_focus_to (win_info);
 	}
     }
-
-
-  return;
 }
 
 
@@ -200,8 +195,6 @@  tui_update_source_windows_with_line (struct symtab *s, int line)
 	}
       break;
     }
-
-  return;
 }
 
 void
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index b15eb32af5e..e0eb12fb833 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -630,8 +630,6 @@  tui_reset (void)
 #endif /* CBREAK */
 		     | VTDELAY | ALLDELAY);
   mode.sg_flags |= XTABS | ECHO | CRMOD | ANYP;
-
-  return;
 }
 #endif