2007-08-14 Michael Snyder <msnyder@access-company.com>

* tui-command.c, tui-data.c, tui-disasm.c, tui-layout.c,
	tui-regs.c, tui-win.c, tui-windata.c, tui-winsource.c, tui.c:
	Reformat block comments to GNU standard.
This commit is contained in:
Michael Snyder
2007-08-14 21:39:22 +00:00
parent 1cc6d956c1
commit ef5eab5a0f
10 changed files with 137 additions and 189 deletions

View File

@ -1,5 +1,9 @@
2007-08-14 Michael Snyder <msnyder@access-company.com> 2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-disasm.c, tui-layout.c,
tui-regs.c, tui-win.c, tui-windata.c, tui-winsource.c, tui.c:
Reformat block comments to GNU standard.
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c, * tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c, tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c, tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,

View File

@ -65,10 +65,9 @@ tui_dispatch_ctrl_char (unsigned int ch)
int i; int i;
char *term; char *term;
/* If this is an xterm, page next/prev keys aren't returned /* If this is an xterm, page next/prev keys aren't returned by
** by keypad as a single char, so we must handle them here. keypad as a single char, so we must handle them here. Seems
** Seems like a bug in the curses library? like a bug in the curses library? */
*/
term = (char *) getenv ("TERM"); term = (char *) getenv ("TERM");
if (term) if (term)
{ {

View File

@ -474,8 +474,7 @@ tui_init_generic_part (struct tui_gen_win_info *win)
} }
/* /* init_content_element().
** init_content_element().
*/ */
void void
init_content_element (struct tui_win_element *element, enum tui_win_type type) init_content_element (struct tui_win_element *element, enum tui_win_type type)
@ -814,11 +813,9 @@ tui_del_data_windows (tui_win_content content, int content_size)
{ {
int i; int i;
/* /* Remember that data window content elements are of type struct
** Remember that data window content elements are of type tui_gen_win_info *, each of which whose single element is a data
** struct tui_gen_win_info *, each of which whose single element. */
** element is a data element.
*/
for (i = 0; i < content_size; i++) for (i = 0; i < content_size; i++)
{ {
struct tui_gen_win_info *generic_win = &content[i]->which_element.data_window; struct tui_gen_win_info *generic_win = &content[i]->which_element.data_window;
@ -838,11 +835,9 @@ tui_free_data_content (tui_win_content content, int content_size)
{ {
int i; int i;
/* /* Remember that data window content elements are of type struct
** Remember that data window content elements are of type tui_gen_win_info *, each of which whose single element is a data
** struct tui_gen_win_info *, each of which whose single element. */
** element is a data element.
*/
for (i = 0; i < content_size; i++) for (i = 0; i < content_size; i++)
{ {
struct tui_gen_win_info *generic_win = &content[i]->which_element.data_window; struct tui_gen_win_info *generic_win = &content[i]->which_element.data_window;
@ -876,8 +871,7 @@ free_content (tui_win_content content, int content_size, enum tui_win_type win_t
} }
/* /* free_content_elements().
** free_content_elements().
*/ */
static void static void
free_content_elements (tui_win_content content, int content_size, enum tui_win_type type) free_content_elements (tui_win_content content, int content_size, enum tui_win_type type)
@ -906,11 +900,9 @@ free_content_elements (tui_win_content content, int content_size, enum tui_win_t
xfree (element); xfree (element);
break; break;
case DATA_ITEM_WIN: case DATA_ITEM_WIN:
/* /* Note that data elements are not allocated in
** Note that data elements are not allocated a single block, but individually, as
** in a single block, but individually, as needed. */
** needed.
*/
if (element->which_element.data.type != TUI_REGISTER) if (element->which_element.data.type != TUI_REGISTER)
xfree ((void *)element->which_element.data.name); xfree ((void *)element->which_element.data.name);
xfree (element->which_element.data.value); xfree (element->which_element.data.value);

View File

@ -279,10 +279,9 @@ tui_show_disassem (CORE_ADDR start_addr)
val.u.addr = start_addr; val.u.addr = start_addr;
tui_add_win_to_layout (DISASSEM_WIN); tui_add_win_to_layout (DISASSEM_WIN);
tui_update_source_window (TUI_DISASM_WIN, s, val, FALSE); tui_update_source_window (TUI_DISASM_WIN, s, val, FALSE);
/*
** If the focus was in the src win, put it in the asm win, if /* If the focus was in the src win, put it in the asm win, if the
** the source view isn't split. source view isn't split. */
*/
if (tui_current_layout () != SRC_DISASSEM_COMMAND && win_with_focus == TUI_SRC_WIN) if (tui_current_layout () != SRC_DISASSEM_COMMAND && win_with_focus == TUI_SRC_WIN)
tui_set_win_focus_to (TUI_DISASM_WIN); tui_set_win_focus_to (TUI_DISASM_WIN);
@ -301,11 +300,9 @@ tui_show_disassem_and_update_source (CORE_ADDR start_addr)
{ {
struct tui_line_or_address val; struct tui_line_or_address val;
/* /* Update what is in the source window if it is displayed too,
** Update what is in the source window if it is displayed too, note that it follows what is in the disassembly window and
** note that it follows what is in the disassembly window and visa-versa. */
** visa-versa.
*/
sal = find_pc_line (start_addr, 0); sal = find_pc_line (start_addr, 0);
val.loa = LOA_LINE; val.loa = LOA_LINE;
val.u.line_no = sal.line; val.u.line_no = sal.line;

View File

@ -81,11 +81,9 @@ show_layout (enum tui_layout_type layout)
if (layout != cur_layout) if (layout != cur_layout)
{ {
/* /* Since the new layout may cause changes in window size, we
** Since the new layout may cause changes in window size, we should free the content and reallocate on next display of
** should free the content and reallocate on next display of source/asm. */
** source/asm.
*/
tui_free_all_source_wins_content (); tui_free_all_source_wins_content ();
tui_clear_source_windows (); tui_clear_source_windows ();
if (layout == SRC_DATA_COMMAND || layout == DISASSEM_DATA_COMMAND) if (layout == SRC_DATA_COMMAND || layout == DISASSEM_DATA_COMMAND)
@ -165,9 +163,8 @@ tui_set_layout (enum tui_layout_type layout_type,
if (new_layout != cur_layout) if (new_layout != cur_layout)
{ {
show_layout (new_layout); show_layout (new_layout);
/*
** Now determine where focus should be. /* Now determine where focus should be. */
*/
if (win_with_focus != TUI_CMD_WIN) if (win_with_focus != TUI_CMD_WIN)
{ {
switch (new_layout) switch (new_layout)
@ -178,26 +175,28 @@ tui_set_layout (enum tui_layout_type layout_type,
layout_def->split = FALSE; layout_def->split = FALSE;
break; break;
case DISASSEM_COMMAND: case DISASSEM_COMMAND:
/* The previous layout was not showing /* The previous layout was not showing code.
** code. this can happen if there is no This can happen if there is no source
** source available: available:
** 1. if the source file is in another dir OR
** 2. if target was compiled without -g 1. if the source file is in another dir OR
** We still want to show the assembly though! 2. if target was compiled without -g
*/ We still want to show the assembly though! */
addr = tui_get_begin_asm_address (); addr = tui_get_begin_asm_address ();
tui_set_win_focus_to (TUI_DISASM_WIN); tui_set_win_focus_to (TUI_DISASM_WIN);
layout_def->display_mode = DISASSEM_WIN; layout_def->display_mode = DISASSEM_WIN;
layout_def->split = FALSE; layout_def->split = FALSE;
break; break;
case SRC_DISASSEM_COMMAND: case SRC_DISASSEM_COMMAND:
/* The previous layout was not showing /* The previous layout was not showing code.
** code. this can happen if there is no This can happen if there is no source
** source available: available:
** 1. if the source file is in another dir OR
** 2. if target was compiled without -g 1. if the source file is in another dir OR
** We still want to show the assembly though! 2. if target was compiled without -g
*/ We still want to show the assembly though! */
addr = tui_get_begin_asm_address (); addr = tui_get_begin_asm_address ();
if (win_with_focus == TUI_SRC_WIN) if (win_with_focus == TUI_SRC_WIN)
tui_set_win_focus_to (TUI_SRC_WIN); tui_set_win_focus_to (TUI_SRC_WIN);
@ -214,13 +213,14 @@ tui_set_layout (enum tui_layout_type layout_type,
layout_def->split = FALSE; layout_def->split = FALSE;
break; break;
case DISASSEM_DATA_COMMAND: case DISASSEM_DATA_COMMAND:
/* The previous layout was not showing /* The previous layout was not showing code.
** code. this can happen if there is no This can happen if there is no source
** source available: available:
** 1. if the source file is in another dir OR
** 2. if target was compiled without -g 1. if the source file is in another dir OR
** We still want to show the assembly though! 2. if target was compiled without -g
*/ We still want to show the assembly though! */
addr = tui_get_begin_asm_address (); addr = tui_get_begin_asm_address ();
if (win_with_focus != TUI_DATA_WIN) if (win_with_focus != TUI_DATA_WIN)
tui_set_win_focus_to (TUI_DISASM_WIN); tui_set_win_focus_to (TUI_DISASM_WIN);
@ -648,8 +648,7 @@ make_command_window (struct tui_win_info **win_info_ptr, int height, int origin_
} }
/* /* make_source_window().
** make_source_window().
*/ */
static void static void
make_source_window (struct tui_win_info **win_info_ptr, int height, int origin_y) make_source_window (struct tui_win_info **win_info_ptr, int height, int origin_y)
@ -660,8 +659,7 @@ make_source_window (struct tui_win_info **win_info_ptr, int height, int origin_y
} /* make_source_window */ } /* make_source_window */
/* /* make_disasm_window().
** make_disasm_window().
*/ */
static void static void
make_disasm_window (struct tui_win_info **win_info_ptr, int height, int origin_y) make_disasm_window (struct tui_win_info **win_info_ptr, int height, int origin_y)
@ -878,8 +876,7 @@ show_data (enum tui_layout_type new_layout)
tui_set_current_layout_to (new_layout); tui_set_current_layout_to (new_layout);
} }
/* /* init_gen_win_info().
** init_gen_win_info().
*/ */
static void static void
init_gen_win_info (struct tui_gen_win_info *win_info, enum tui_win_type type, init_gen_win_info (struct tui_gen_win_info *win_info, enum tui_win_type type,
@ -904,8 +901,7 @@ init_gen_win_info (struct tui_gen_win_info *win_info, enum tui_win_type type,
return; return;
} /* init_gen_win_info */ } /* init_gen_win_info */
/* /* init_and_make_win().
** init_and_make_win().
*/ */
static void * static void *
init_and_make_win (void *opaque_win_info, enum tui_win_type win_type, init_and_make_win (void *opaque_win_info, enum tui_win_type win_type,
@ -948,9 +944,7 @@ make_source_or_disasm_window (struct tui_win_info **win_info_ptr, enum tui_win_t
{ {
struct tui_gen_win_info *execution_info = (struct tui_gen_win_info *) NULL; struct tui_gen_win_info *execution_info = (struct tui_gen_win_info *) NULL;
/* /* Create the exeuction info window. */
** Create the exeuction info window.
*/
if (type == SRC_WIN) if (type == SRC_WIN)
execution_info = tui_source_exec_info_win_ptr (); execution_info = tui_source_exec_info_win_ptr ();
else else
@ -962,9 +956,8 @@ make_source_or_disasm_window (struct tui_win_info **win_info_ptr, enum tui_win_t
0, 0,
origin_y, origin_y,
DONT_BOX_WINDOW); DONT_BOX_WINDOW);
/*
** Now create the source window. /* Now create the source window. */
*/
*win_info_ptr = init_and_make_win (*win_info_ptr, *win_info_ptr = init_and_make_win (*win_info_ptr,
type, type,
height, height,

View File

@ -354,10 +354,8 @@ tui_display_registers_from (int start_element_no)
item_win_width = item_win_width =
(TUI_DATA_WIN->generic.width - 2) / display_info->regs_column_count; (TUI_DATA_WIN->generic.width - 2) / display_info->regs_column_count;
/* /* Now create each data "sub" window, and write the display into
** Now create each data "sub" window, and write the display it. */
** into it.
*/
cur_y = 1; cur_y = 1;
while (i < display_info->regs_content_count && while (i < display_info->regs_content_count &&
cur_y <= TUI_DATA_WIN->generic.viewport_height) cur_y <= TUI_DATA_WIN->generic.viewport_height)
@ -426,12 +424,11 @@ tui_display_reg_element_at_line (int start_element_no, int start_line_no)
first_line_on_last_page = last_line_no - (TUI_DATA_WIN->generic.height - 2); first_line_on_last_page = last_line_no - (TUI_DATA_WIN->generic.height - 2);
if (first_line_on_last_page < 0) if (first_line_on_last_page < 0)
first_line_on_last_page = 0; first_line_on_last_page = 0;
/*
** If there is no other data displayed except registers, /* If there is no other data displayed except registers, and
** and the element_no causes us to scroll past the end of the element_no causes us to scroll past the end of the
** the registers, adjust what element to really start the registers, adjust what element to really start the
** display at. display at. */
*/
if (TUI_DATA_WIN->detail.data_display_info.data_content_count <= 0 && if (TUI_DATA_WIN->detail.data_display_info.data_content_count <= 0 &&
start_line_no > first_line_on_last_page) start_line_no > first_line_on_last_page)
element_no = tui_first_reg_element_no_inline (first_line_on_last_page); element_no = tui_first_reg_element_no_inline (first_line_on_last_page);
@ -455,10 +452,9 @@ tui_display_registers_from_line (int line_no, int force_display)
if (line_no < 0) if (line_no < 0)
line = 0; line = 0;
else if (force_display) else if (force_display)
{ /* { /* If we must display regs (force_display is true), then
** If we must display regs (force_display is true), then make make sure that we don't display off the end of the
** sure that we don't display off the end of the registers. registers. */
*/
if (line_no >= tui_last_regs_line_no ()) if (line_no >= tui_last_regs_line_no ())
{ {
if ((line = tui_line_from_reg_element_no ( if ((line = tui_line_from_reg_element_no (

View File

@ -488,12 +488,12 @@ tui_scroll_forward (struct tui_win_info *win_to_scroll, int num_to_scroll)
if (num_to_scroll == 0) if (num_to_scroll == 0)
_num_to_scroll = win_to_scroll->generic.height - 3; _num_to_scroll = win_to_scroll->generic.height - 3;
/*
** If we are scrolling the source or disassembly window, do a /* If we are scrolling the source or disassembly window, do a
** "psuedo" scroll since not all of the source is in memory, "psuedo" scroll since not all of the source is in memory,
** only what is in the viewport. If win_to_scroll is the only what is in the viewport. If win_to_scroll is the
** command window do nothing since the term should handle it. command window do nothing since the term should handle
*/ it. */
if (win_to_scroll == TUI_SRC_WIN) if (win_to_scroll == TUI_SRC_WIN)
tui_vertical_source_scroll (FORWARD_SCROLL, _num_to_scroll); tui_vertical_source_scroll (FORWARD_SCROLL, _num_to_scroll);
else if (win_to_scroll == TUI_DISASM_WIN) else if (win_to_scroll == TUI_DISASM_WIN)
@ -512,12 +512,12 @@ tui_scroll_backward (struct tui_win_info *win_to_scroll, int num_to_scroll)
if (num_to_scroll == 0) if (num_to_scroll == 0)
_num_to_scroll = win_to_scroll->generic.height - 3; _num_to_scroll = win_to_scroll->generic.height - 3;
/*
** If we are scrolling the source or disassembly window, do a /* If we are scrolling the source or disassembly window, do a
** "psuedo" scroll since not all of the source is in memory, "psuedo" scroll since not all of the source is in memory,
** only what is in the viewport. If win_to_scroll is the only what is in the viewport. If win_to_scroll is the
** command window do nothing since the term should handle it. command window do nothing since the term should handle
*/ it. */
if (win_to_scroll == TUI_SRC_WIN) if (win_to_scroll == TUI_SRC_WIN)
tui_vertical_source_scroll (BACKWARD_SCROLL, _num_to_scroll); tui_vertical_source_scroll (BACKWARD_SCROLL, _num_to_scroll);
else if (win_to_scroll == TUI_DISASM_WIN) else if (win_to_scroll == TUI_DISASM_WIN)
@ -537,12 +537,11 @@ tui_scroll_left (struct tui_win_info *win_to_scroll, int num_to_scroll)
if (_num_to_scroll == 0) if (_num_to_scroll == 0)
_num_to_scroll = 1; _num_to_scroll = 1;
/*
** If we are scrolling the source or disassembly window, do a /* If we are scrolling the source or disassembly window, do a
** "psuedo" scroll since not all of the source is in memory, "psuedo" scroll since not all of the source is in memory,
** only what is in the viewport. If win_to_scroll is the only what is in the viewport. If win_to_scroll is the command
** command window do nothing since the term should handle it. window do nothing since the term should handle it. */
*/
if (win_to_scroll == TUI_SRC_WIN || win_to_scroll == TUI_DISASM_WIN) if (win_to_scroll == TUI_SRC_WIN || win_to_scroll == TUI_DISASM_WIN)
tui_horizontal_source_scroll (win_to_scroll, LEFT_SCROLL, _num_to_scroll); tui_horizontal_source_scroll (win_to_scroll, LEFT_SCROLL, _num_to_scroll);
} }
@ -558,12 +557,11 @@ tui_scroll_right (struct tui_win_info *win_to_scroll, int num_to_scroll)
if (_num_to_scroll == 0) if (_num_to_scroll == 0)
_num_to_scroll = 1; _num_to_scroll = 1;
/*
** If we are scrolling the source or disassembly window, do a /* If we are scrolling the source or disassembly window, do a
** "psuedo" scroll since not all of the source is in memory, "psuedo" scroll since not all of the source is in memory,
** only what is in the viewport. If win_to_scroll is the only what is in the viewport. If win_to_scroll is the command
** command window do nothing since the term should handle it. window do nothing since the term should handle it. */
*/
if (win_to_scroll == TUI_SRC_WIN || win_to_scroll == TUI_DISASM_WIN) if (win_to_scroll == TUI_SRC_WIN || win_to_scroll == TUI_DISASM_WIN)
tui_horizontal_source_scroll (win_to_scroll, RIGHT_SCROLL, _num_to_scroll); tui_horizontal_source_scroll (win_to_scroll, RIGHT_SCROLL, _num_to_scroll);
} }
@ -766,10 +764,8 @@ tui_resize_all (void)
tui_erase_source_content (second_win, EMPTY_SOURCE_PROMPT); tui_erase_source_content (second_win, EMPTY_SOURCE_PROMPT);
break; break;
} }
/* /* Now remove all invisible windows, and their content so that
** Now remove all invisible windows, and their content so that they get created again when called for with the new size. */
** they get created again when called for with the new size.
*/
for (win_type = SRC_WIN; (win_type < MAX_MAJOR_WINDOWS); win_type++) for (win_type = SRC_WIN; (win_type < MAX_MAJOR_WINDOWS); win_type++)
{ {
if (win_type != CMD_WIN && (tui_win_list[win_type] != NULL) if (win_type != CMD_WIN && (tui_win_list[win_type] != NULL)
@ -794,10 +790,8 @@ tui_resize_all (void)
void void
tui_sigwinch_handler (int signal) tui_sigwinch_handler (int signal)
{ {
/* /* Say that a resize was done so that the readline can do it later
** Say that a resize was done so that the readline can do it when appropriate. */
** later when appropriate.
*/
tui_set_win_resized_to (TRUE); tui_set_win_resized_to (TRUE);
} }
@ -984,9 +978,7 @@ tui_set_win_height (char *arg, int from_tty)
{ {
*buf_ptr = (char) 0; *buf_ptr = (char) 0;
/* /* Validate the window name. */
** Validate the window name.
*/
for (i = 0; i < strlen (wname); i++) for (i = 0; i < strlen (wname); i++)
wname[i] = toupper (wname[i]); wname[i] = toupper (wname[i]);
win_info = tui_partial_win_by_name (wname); win_info = tui_partial_win_by_name (wname);
@ -1022,10 +1014,9 @@ The window name specified must be valid and visible.\n"));
new_height = input_no; new_height = input_no;
else else
new_height = win_info->generic.height + input_no; new_height = win_info->generic.height + input_no;
/*
** Now change the window's height, and adjust all /* Now change the window's height, and adjust
** other windows around it. all other windows around it. */
*/
if (tui_adjust_win_heights (win_info, if (tui_adjust_win_heights (win_info,
new_height) == TUI_FAILURE) new_height) == TUI_FAILURE)
warning (_("Invalid window height specified.\n%s"), warning (_("Invalid window height specified.\n%s"),
@ -1153,11 +1144,10 @@ tui_adjust_win_heights (struct tui_win_info *primary_win_info, int new_height)
second_win = (tui_source_windows ())->list[0]; second_win = (tui_source_windows ())->list[0];
} }
if (primary_win_info == TUI_CMD_WIN) if (primary_win_info == TUI_CMD_WIN)
{ /* { /* Split the change in height accross the 1st & 2nd
** Split the change in height accross the 1st & 2nd windows, adjusting them as well. */
** windows, adjusting them as well. /* Subtract the locator. */
*/ int first_split_diff = diff / 2;
int first_split_diff = diff / 2; /* Subtract the locator. */
int second_split_diff = first_split_diff; int second_split_diff = first_split_diff;
if (diff % 2) if (diff % 2)
@ -1200,10 +1190,9 @@ tui_adjust_win_heights (struct tui_win_info *primary_win_info, int new_height)
else else
{ {
if ((TUI_CMD_WIN->generic.height + diff) < 1) if ((TUI_CMD_WIN->generic.height + diff) < 1)
{ /* { /* If there is no way to increase the command
** If there is no way to increase the command window window take real estate from the 1st or 2nd
** take real estate from the 1st or 2nd window. window. */
*/
if ((TUI_CMD_WIN->generic.height + diff) < 1) if ((TUI_CMD_WIN->generic.height + diff) < 1)
{ {
int i; int i;
@ -1420,12 +1409,10 @@ new_height_ok (struct tui_win_info *primary_win_info, int new_height)
first_win = TUI_DATA_WIN; first_win = TUI_DATA_WIN;
second_win = (tui_source_windows ())->list[0]; second_win = (tui_source_windows ())->list[0];
} }
/* /* We could simply add all the heights to obtain the same
** We could simply add all the heights to obtain the same result result but below is more explicit since we subtract 1 for
** but below is more explicit since we subtract 1 for the the line that the first and second windows share, and add
** line that the first and second windows share, and add one one for the locator. */
** for the locator.
*/
total_height = cur_total_height = total_height = cur_total_height =
(first_win->generic.height + second_win->generic.height - 1) (first_win->generic.height + second_win->generic.height - 1)
+ TUI_CMD_WIN->generic.height + 1; /* Locator. */ + TUI_CMD_WIN->generic.height + 1; /* Locator. */
@ -1446,17 +1433,14 @@ new_height_ok (struct tui_win_info *primary_win_info, int new_height)
else else
{ {
min_height = MIN_WIN_HEIGHT; min_height = MIN_WIN_HEIGHT;
/*
** First see if we can increase/decrease the command /* First see if we can increase/decrease the command
** window. And make sure that the command window is window. And make sure that the command window is at
** at least 1 line. least 1 line. */
*/
ok = ((TUI_CMD_WIN->generic.height + diff) > 0); ok = ((TUI_CMD_WIN->generic.height + diff) > 0);
if (!ok) if (!ok)
{ /* { /* Looks like we have to increase/decrease one of
** Looks like we have to increase/decrease one of the other windows. */
** the other windows.
*/
if (primary_win_info == first_win) if (primary_win_info == first_win)
ok = (second_win->generic.height + diff) >= min_height; ok = (second_win->generic.height + diff) >= min_height;
else else
@ -1474,10 +1458,8 @@ new_height_ok (struct tui_win_info *primary_win_info, int new_height)
TUI_CMD_WIN->generic.height + diff; TUI_CMD_WIN->generic.height + diff;
} }
} }
/* /* Now make sure that the proposed total height doesn't
** Now make sure that the proposed total height doesn't exceed exceed the old total height. */
** the old total height.
*/
if (ok) if (ok)
ok = (new_height >= min_height && total_height <= cur_total_height); ok = (new_height >= min_height && total_height <= cur_total_height);
} }
@ -1495,10 +1477,8 @@ parse_scrolling_args (char *arg, struct tui_win_info **win_to_scroll,
*num_to_scroll = 0; *num_to_scroll = 0;
*win_to_scroll = tui_win_with_focus (); *win_to_scroll = tui_win_with_focus ();
/* /* First set up the default window to scroll, in case there is no
** First set up the default window to scroll, in case there is no window name arg. */
** window name arg.
*/
if (arg != (char *) NULL) if (arg != (char *) NULL)
{ {
char *buf, *buf_ptr; char *buf, *buf_ptr;

View File

@ -72,14 +72,10 @@ tui_first_data_element_no_in_line (int line_no)
{ {
int first_element_no = (-1); int first_element_no = (-1);
/* /* First see if there is a register on line_no, and if so, set the
** First see if there is a register on line_no, and if so, set the first element number. */
** first element number.
*/
if ((first_element_no = tui_first_reg_element_no_inline (line_no)) == -1) if ((first_element_no = tui_first_reg_element_no_inline (line_no)) == -1)
{ /* { /* Looking at the general data, the 1st element on line_no. */
** Looking at the general data, the 1st element on line_no.
*/
} }
return first_element_no; return first_element_no;
@ -141,9 +137,8 @@ tui_display_all_data (void)
tui_delete_data_content_windows (); tui_delete_data_content_windows ();
tui_check_and_display_highlight_if_needed (TUI_DATA_WIN); tui_check_and_display_highlight_if_needed (TUI_DATA_WIN);
tui_display_registers_from (0); tui_display_registers_from (0);
/*
** Then display the other data. /* Then display the other data. */
*/
if (TUI_DATA_WIN->detail.data_display_info.data_content != if (TUI_DATA_WIN->detail.data_display_info.data_content !=
(tui_win_content) NULL && (tui_win_content) NULL &&
TUI_DATA_WIN->detail.data_display_info.data_content_count > 0) TUI_DATA_WIN->detail.data_display_info.data_content_count > 0)
@ -177,21 +172,17 @@ tui_display_data_from_line (int line_no)
/* Display regs if we can. */ /* Display regs if we can. */
if (tui_display_registers_from_line (_line_no, FALSE) < 0) if (tui_display_registers_from_line (_line_no, FALSE) < 0)
{ /* { /* _line_no is past the regs display, so calc where the
** _line_no is past the regs display, so calc where the start data element is. */
** start data element is.
*/
if (regs_last_line < _line_no) if (regs_last_line < _line_no)
{ /* Figure out how many lines each element is to obtain { /* Figure out how many lines each element is to obtain
the start element_no. */ the start element_no. */
} }
} }
else else
{ /* { /* Calculate the starting element of the data display, given
** Calculate the starting element of the data display, regs_last_line and how many lines each element is, up to
** given regs_last_line and how many lines each element _line_no. */
** is, up to _line_no.
*/
} }
/* Now display the data , starting at element_no. */ /* Now display the data , starting at element_no. */
} }

View File

@ -112,10 +112,8 @@ tui_update_source_window_as_is (struct tui_win_info *win_info, struct symtab *s,
(win_info->generic.content_size - 2); (win_info->generic.content_size - 2);
sal.symtab = s; sal.symtab = s;
set_current_source_symtab_and_line (&sal); set_current_source_symtab_and_line (&sal);
/* /* If the focus was in the asm win, put it in the src win if
** If the focus was in the asm win, put it in the src we don't have a split layout. */
** win if we don't have a split layout.
*/
if (tui_win_with_focus () == TUI_DISASM_WIN && if (tui_win_with_focus () == TUI_DISASM_WIN &&
tui_current_layout () != SRC_DISASSEM_COMMAND) tui_current_layout () != SRC_DISASSEM_COMMAND)
tui_set_win_focus_to (TUI_SRC_WIN); tui_set_win_focus_to (TUI_SRC_WIN);

View File

@ -483,10 +483,8 @@ tui_reset (void)
{ {
struct termio mode; struct termio mode;
/* /* Reset the teletype mode bits to a sensible state.
** Reset the teletype mode bits to a sensible state. Copied tset.c. */
** Copied tset.c
*/
#if defined (TIOCGETC) #if defined (TIOCGETC)
struct tchars tbuf; struct tchars tbuf;
#endif /* TIOCGETC */ #endif /* TIOCGETC */