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-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,
int i;
char *term;
- /* If this is an xterm, page next/prev keys aren't returned
- ** by keypad as a single char, so we must handle them here.
- ** Seems like a bug in the curses library?
- */
+ /* If this is an xterm, page next/prev keys aren't returned by
+ keypad as a single char, so we must handle them here. Seems
+ like a bug in the curses library? */
term = (char *) getenv ("TERM");
if (term)
{
}
-/*
- ** init_content_element().
+/* init_content_element().
*/
void
init_content_element (struct tui_win_element *element, enum tui_win_type type)
{
int i;
- /*
- ** Remember that data window content elements are of type
- ** struct tui_gen_win_info *, each of which whose single
- ** element is a data element.
- */
+ /* Remember that data window content elements are of type struct
+ tui_gen_win_info *, each of which whose single element is a data
+ element. */
for (i = 0; i < content_size; i++)
{
struct tui_gen_win_info *generic_win = &content[i]->which_element.data_window;
{
int i;
- /*
- ** Remember that data window content elements are of type
- ** struct tui_gen_win_info *, each of which whose single
- ** element is a data element.
- */
+ /* Remember that data window content elements are of type struct
+ tui_gen_win_info *, each of which whose single element is a data
+ element. */
for (i = 0; i < content_size; i++)
{
struct tui_gen_win_info *generic_win = &content[i]->which_element.data_window;
}
-/*
- ** free_content_elements().
+/* free_content_elements().
*/
static void
free_content_elements (tui_win_content content, int content_size, enum tui_win_type type)
xfree (element);
break;
case DATA_ITEM_WIN:
- /*
- ** Note that data elements are not allocated
- ** in a single block, but individually, as
- ** needed.
- */
+ /* Note that data elements are not allocated in
+ a single block, but individually, as
+ needed. */
if (element->which_element.data.type != TUI_REGISTER)
xfree ((void *)element->which_element.data.name);
xfree (element->which_element.data.value);
val.u.addr = start_addr;
tui_add_win_to_layout (DISASSEM_WIN);
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
- ** the source view isn't split.
- */
+
+ /* If the focus was in the src win, put it in the asm win, if the
+ source view isn't split. */
if (tui_current_layout () != SRC_DISASSEM_COMMAND && win_with_focus == TUI_SRC_WIN)
tui_set_win_focus_to (TUI_DISASM_WIN);
{
struct tui_line_or_address val;
- /*
- ** Update what is in the source window if it is displayed too,
- ** note that it follows what is in the disassembly window and
- ** visa-versa.
- */
+ /* Update what is in the source window if it is displayed too,
+ note that it follows what is in the disassembly window and
+ visa-versa. */
sal = find_pc_line (start_addr, 0);
val.loa = LOA_LINE;
val.u.line_no = sal.line;
if (layout != cur_layout)
{
- /*
- ** Since the new layout may cause changes in window size, we
- ** should free the content and reallocate on next display of
- ** source/asm.
- */
+ /* Since the new layout may cause changes in window size, we
+ should free the content and reallocate on next display of
+ source/asm. */
tui_free_all_source_wins_content ();
tui_clear_source_windows ();
if (layout == SRC_DATA_COMMAND || layout == DISASSEM_DATA_COMMAND)
if (new_layout != cur_layout)
{
show_layout (new_layout);
- /*
- ** Now determine where focus should be.
- */
+
+ /* Now determine where focus should be. */
if (win_with_focus != TUI_CMD_WIN)
{
switch (new_layout)
layout_def->split = FALSE;
break;
case DISASSEM_COMMAND:
- /* The previous layout was not showing
- ** code. this can happen if there is no
- ** source available:
- ** 1. if the source file is in another dir OR
- ** 2. if target was compiled without -g
- ** We still want to show the assembly though!
- */
+ /* The previous layout was not showing code.
+ This can happen if there is no source
+ available:
+
+ 1. if the source file is in another dir OR
+ 2. if target was compiled without -g
+ We still want to show the assembly though! */
+
addr = tui_get_begin_asm_address ();
tui_set_win_focus_to (TUI_DISASM_WIN);
layout_def->display_mode = DISASSEM_WIN;
layout_def->split = FALSE;
break;
case SRC_DISASSEM_COMMAND:
- /* The previous layout was not showing
- ** code. this can happen if there is no
- ** source available:
- ** 1. if the source file is in another dir OR
- ** 2. if target was compiled without -g
- ** We still want to show the assembly though!
- */
+ /* The previous layout was not showing code.
+ This can happen if there is no source
+ available:
+
+ 1. if the source file is in another dir OR
+ 2. if target was compiled without -g
+ We still want to show the assembly though! */
+
addr = tui_get_begin_asm_address ();
if (win_with_focus == TUI_SRC_WIN)
tui_set_win_focus_to (TUI_SRC_WIN);
layout_def->split = FALSE;
break;
case DISASSEM_DATA_COMMAND:
- /* The previous layout was not showing
- ** code. this can happen if there is no
- ** source available:
- ** 1. if the source file is in another dir OR
- ** 2. if target was compiled without -g
- ** We still want to show the assembly though!
- */
+ /* The previous layout was not showing code.
+ This can happen if there is no source
+ available:
+
+ 1. if the source file is in another dir OR
+ 2. if target was compiled without -g
+ We still want to show the assembly though! */
+
addr = tui_get_begin_asm_address ();
if (win_with_focus != TUI_DATA_WIN)
tui_set_win_focus_to (TUI_DISASM_WIN);
}
-/*
- ** make_source_window().
+/* make_source_window().
*/
static void
make_source_window (struct tui_win_info **win_info_ptr, int height, int origin_y)
} /* make_source_window */
-/*
- ** make_disasm_window().
+/* make_disasm_window().
*/
static void
make_disasm_window (struct tui_win_info **win_info_ptr, int height, int origin_y)
tui_set_current_layout_to (new_layout);
}
-/*
- ** init_gen_win_info().
+/* init_gen_win_info().
*/
static void
init_gen_win_info (struct tui_gen_win_info *win_info, enum tui_win_type type,
return;
} /* init_gen_win_info */
-/*
- ** init_and_make_win().
+/* init_and_make_win().
*/
static void *
init_and_make_win (void *opaque_win_info, enum tui_win_type win_type,
{
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)
execution_info = tui_source_exec_info_win_ptr ();
else
0,
origin_y,
DONT_BOX_WINDOW);
- /*
- ** Now create the source window.
- */
+
+ /* Now create the source window. */
*win_info_ptr = init_and_make_win (*win_info_ptr,
type,
height,
item_win_width =
(TUI_DATA_WIN->generic.width - 2) / display_info->regs_column_count;
- /*
- ** Now create each data "sub" window, and write the display
- ** into it.
- */
+ /* Now create each data "sub" window, and write the display into
+ it. */
cur_y = 1;
while (i < display_info->regs_content_count &&
cur_y <= TUI_DATA_WIN->generic.viewport_height)
first_line_on_last_page = last_line_no - (TUI_DATA_WIN->generic.height - 2);
if (first_line_on_last_page < 0)
first_line_on_last_page = 0;
- /*
- ** If there is no other data displayed except registers,
- ** and the element_no causes us to scroll past the end of
- ** the registers, adjust what element to really start the
- ** display at.
- */
+
+ /* If there is no other data displayed except registers, and
+ the element_no causes us to scroll past the end of the
+ registers, adjust what element to really start the
+ display at. */
if (TUI_DATA_WIN->detail.data_display_info.data_content_count <= 0 &&
start_line_no > first_line_on_last_page)
element_no = tui_first_reg_element_no_inline (first_line_on_last_page);
if (line_no < 0)
line = 0;
else if (force_display)
- { /*
- ** If we must display regs (force_display is true), then make
- ** sure that we don't display off the end of the registers.
- */
+ { /* If we must display regs (force_display is true), then
+ make sure that we don't display off the end of the
+ registers. */
if (line_no >= tui_last_regs_line_no ())
{
if ((line = tui_line_from_reg_element_no (
if (num_to_scroll == 0)
_num_to_scroll = win_to_scroll->generic.height - 3;
- /*
- ** If we are scrolling the source or disassembly window, do a
- ** "psuedo" scroll since not all of the source is in memory,
- ** only what is in the viewport. If win_to_scroll is the
- ** command window do nothing since the term should handle it.
- */
+
+ /* If we are scrolling the source or disassembly window, do a
+ "psuedo" scroll since not all of the source is in memory,
+ only what is in the viewport. If win_to_scroll is the
+ command window do nothing since the term should handle
+ it. */
if (win_to_scroll == TUI_SRC_WIN)
tui_vertical_source_scroll (FORWARD_SCROLL, _num_to_scroll);
else if (win_to_scroll == TUI_DISASM_WIN)
if (num_to_scroll == 0)
_num_to_scroll = win_to_scroll->generic.height - 3;
- /*
- ** If we are scrolling the source or disassembly window, do a
- ** "psuedo" scroll since not all of the source is in memory,
- ** only what is in the viewport. If win_to_scroll is the
- ** command window do nothing since the term should handle it.
- */
+
+ /* If we are scrolling the source or disassembly window, do a
+ "psuedo" scroll since not all of the source is in memory,
+ only what is in the viewport. If win_to_scroll is the
+ command window do nothing since the term should handle
+ it. */
if (win_to_scroll == TUI_SRC_WIN)
tui_vertical_source_scroll (BACKWARD_SCROLL, _num_to_scroll);
else if (win_to_scroll == TUI_DISASM_WIN)
if (_num_to_scroll == 0)
_num_to_scroll = 1;
- /*
- ** If we are scrolling the source or disassembly window, do a
- ** "psuedo" scroll since not all of the source is in memory,
- ** only what is in the viewport. If win_to_scroll is the
- ** command window do nothing since the term should handle it.
- */
+
+ /* If we are scrolling the source or disassembly window, do a
+ "psuedo" scroll since not all of the source is in memory,
+ only what is in the viewport. If win_to_scroll is the command
+ window do nothing since the term should handle it. */
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);
}
if (_num_to_scroll == 0)
_num_to_scroll = 1;
- /*
- ** If we are scrolling the source or disassembly window, do a
- ** "psuedo" scroll since not all of the source is in memory,
- ** only what is in the viewport. If win_to_scroll is the
- ** command window do nothing since the term should handle it.
- */
+
+ /* If we are scrolling the source or disassembly window, do a
+ "psuedo" scroll since not all of the source is in memory,
+ only what is in the viewport. If win_to_scroll is the command
+ window do nothing since the term should handle it. */
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_erase_source_content (second_win, EMPTY_SOURCE_PROMPT);
break;
}
- /*
- ** Now remove all invisible windows, and their content so that
- ** they get created again when called for with the new size.
- */
+ /* Now remove all invisible windows, and their content so that
+ they get created again when called for with the new size. */
for (win_type = SRC_WIN; (win_type < MAX_MAJOR_WINDOWS); win_type++)
{
if (win_type != CMD_WIN && (tui_win_list[win_type] != NULL)
void
tui_sigwinch_handler (int signal)
{
- /*
- ** Say that a resize was done so that the readline can do it
- ** later when appropriate.
- */
+ /* Say that a resize was done so that the readline can do it later
+ when appropriate. */
tui_set_win_resized_to (TRUE);
}
{
*buf_ptr = (char) 0;
- /*
- ** Validate the window name.
- */
+ /* Validate the window name. */
for (i = 0; i < strlen (wname); i++)
wname[i] = toupper (wname[i]);
win_info = tui_partial_win_by_name (wname);
new_height = input_no;
else
new_height = win_info->generic.height + input_no;
- /*
- ** Now change the window's height, and adjust all
- ** other windows around it.
- */
+
+ /* Now change the window's height, and adjust
+ all other windows around it. */
if (tui_adjust_win_heights (win_info,
new_height) == TUI_FAILURE)
warning (_("Invalid window height specified.\n%s"),
second_win = (tui_source_windows ())->list[0];
}
if (primary_win_info == TUI_CMD_WIN)
- { /*
- ** Split the change in height accross the 1st & 2nd
- ** windows, adjusting them as well.
- */
- int first_split_diff = diff / 2; /* Subtract the locator. */
+ { /* Split the change in height accross the 1st & 2nd
+ windows, adjusting them as well. */
+ /* Subtract the locator. */
+ int first_split_diff = diff / 2;
int second_split_diff = first_split_diff;
if (diff % 2)
else
{
if ((TUI_CMD_WIN->generic.height + diff) < 1)
- { /*
- ** If there is no way to increase the command window
- ** take real estate from the 1st or 2nd window.
- */
+ { /* If there is no way to increase the command
+ window take real estate from the 1st or 2nd
+ window. */
if ((TUI_CMD_WIN->generic.height + diff) < 1)
{
int i;
first_win = TUI_DATA_WIN;
second_win = (tui_source_windows ())->list[0];
}
- /*
- ** We could simply add all the heights to obtain the same result
- ** but below is more explicit since we subtract 1 for the
- ** line that the first and second windows share, and add one
- ** for the locator.
- */
+ /* We could simply add all the heights to obtain the same
+ result but below is more explicit since we subtract 1 for
+ the line that the first and second windows share, and add
+ one for the locator. */
total_height = cur_total_height =
(first_win->generic.height + second_win->generic.height - 1)
+ TUI_CMD_WIN->generic.height + 1; /* Locator. */
else
{
min_height = MIN_WIN_HEIGHT;
- /*
- ** First see if we can increase/decrease the command
- ** window. And make sure that the command window is
- ** at least 1 line.
- */
+
+ /* First see if we can increase/decrease the command
+ window. And make sure that the command window is at
+ least 1 line. */
ok = ((TUI_CMD_WIN->generic.height + diff) > 0);
if (!ok)
- { /*
- ** Looks like we have to increase/decrease one of
- ** the other windows.
- */
+ { /* Looks like we have to increase/decrease one of
+ the other windows. */
if (primary_win_info == first_win)
ok = (second_win->generic.height + diff) >= min_height;
else
TUI_CMD_WIN->generic.height + diff;
}
}
- /*
- ** Now make sure that the proposed total height doesn't exceed
- ** the old total height.
- */
+ /* Now make sure that the proposed total height doesn't
+ exceed the old total height. */
if (ok)
ok = (new_height >= min_height && total_height <= cur_total_height);
}
*num_to_scroll = 0;
*win_to_scroll = tui_win_with_focus ();
- /*
- ** First set up the default window to scroll, in case there is no
- ** window name arg.
- */
+ /* First set up the default window to scroll, in case there is no
+ window name arg. */
if (arg != (char *) NULL)
{
char *buf, *buf_ptr;
{
int first_element_no = (-1);
- /*
- ** First see if there is a register on line_no, and if so, set the
- ** first element number.
- */
+ /* First see if there is a register on line_no, and if so, set the
+ first element number. */
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;
tui_delete_data_content_windows ();
tui_check_and_display_highlight_if_needed (TUI_DATA_WIN);
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 !=
(tui_win_content) NULL &&
TUI_DATA_WIN->detail.data_display_info.data_content_count > 0)
/* Display regs if we can. */
if (tui_display_registers_from_line (_line_no, FALSE) < 0)
- { /*
- ** _line_no is past the regs display, so calc where the
- ** start data element is.
- */
+ { /* _line_no is past the regs display, so calc where the
+ start data element is. */
if (regs_last_line < _line_no)
- { /* Figure out how many lines each element is to obtain
- the start element_no. */
+ { /* Figure out how many lines each element is to obtain
+ the start element_no. */
}
}
else
- { /*
- ** Calculate the starting element of the data display,
- ** given regs_last_line and how many lines each element
- ** is, up to _line_no.
- */
+ { /* Calculate the starting element of the data display, given
+ regs_last_line and how many lines each element is, up to
+ _line_no. */
}
/* Now display the data , starting at element_no. */
}
(win_info->generic.content_size - 2);
sal.symtab = s;
set_current_source_symtab_and_line (&sal);
- /*
- ** If the focus was in the asm win, put it in the src
- ** win if we don't have a split layout.
- */
+ /* If the focus was in the asm win, put it in the src win if
+ we don't have a split layout. */
if (tui_win_with_focus () == TUI_DISASM_WIN &&
tui_current_layout () != SRC_DISASSEM_COMMAND)
tui_set_win_focus_to (TUI_SRC_WIN);
{
struct termio mode;
- /*
- ** Reset the teletype mode bits to a sensible state.
- ** Copied tset.c
- */
+ /* Reset the teletype mode bits to a sensible state.
+ Copied tset.c. */
#if defined (TIOCGETC)
struct tchars tbuf;
#endif /* TIOCGETC */