2004-02-07 Andrew Cagney <cagney@redhat.com>

* tui/tui.h (Opaque, OpaquePtr OpaqueList): Delete definition.
	(TuiPoint, TuiPointPtr): Ditto.
	(TuiStatus, TuiStatusPtr): Ditto.
	(TuiWinType, TuiWinTypePtr): Ditto.
	(struct tui_point): Rename _TuiPoint.
	(tui_get_low_disassembly_address): Rename
	tuiGetLowDisassemblyAddress.
	(tui_update_all_exec_infos): Rename tuiUpdateAllExecInfos.
	(tuiFree): Delete declaration.
	(OpaqueFuncPtr, TuiOpaqueFuncPtr): Delete definitions.
	(TuiVoidFuncPtr, TuiIntFuncPtr): Delete definitions.
	* tui/tui.c (tuiFree): Delete function.
	* cli/cli-cmds.c (disassemble_command): Update references.
	* tui/tui-data.c, tui/tui-data.h, tui/tui-disasm.c: Ditto.
	* tui/tui-layout.c, tui/tui-regs.c, tui/tui-source.c: Ditto.
	* tui/tui-stack.c, tui/tui-win.c, tui/tui-wingeneral.c: Ditto.
	* tui/tui-winsource.c: Ditto.
This commit is contained in:
Andrew Cagney 2004-02-07 17:46:14 +00:00
parent b99607ea3c
commit 22940a245d
14 changed files with 178 additions and 189 deletions

View file

@ -1,3 +1,23 @@
2004-02-07 Andrew Cagney <cagney@redhat.com>
* tui/tui.h (Opaque, OpaquePtr OpaqueList): Delete definition.
(TuiPoint, TuiPointPtr): Ditto.
(TuiStatus, TuiStatusPtr): Ditto.
(TuiWinType, TuiWinTypePtr): Ditto.
(struct tui_point): Rename _TuiPoint.
(tui_get_low_disassembly_address): Rename
tuiGetLowDisassemblyAddress.
(tui_update_all_exec_infos): Rename tuiUpdateAllExecInfos.
(tuiFree): Delete declaration.
(OpaqueFuncPtr, TuiOpaqueFuncPtr): Delete definitions.
(TuiVoidFuncPtr, TuiIntFuncPtr): Delete definitions.
* tui/tui.c (tuiFree): Delete function.
* cli/cli-cmds.c (disassemble_command): Update references.
* tui/tui-data.c, tui/tui-data.h, tui/tui-disasm.c: Ditto.
* tui/tui-layout.c, tui/tui-regs.c, tui/tui-source.c: Ditto.
* tui/tui-stack.c, tui/tui-win.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-winsource.c: Ditto.
2004-02-07 Elena Zannoni <ezannoni@redhat.com> 2004-02-07 Elena Zannoni <ezannoni@redhat.com>
* objfiles.h (struct objfile): Add objfile_obstack field. * objfiles.h (struct objfile): Add objfile_obstack field.

View file

@ -850,8 +850,9 @@ disassemble_command (char *arg, int from_tty)
#if defined(TUI) #if defined(TUI)
/* NOTE: cagney/2003-02-13 The `tui_active' was previously /* NOTE: cagney/2003-02-13 The `tui_active' was previously
`tui_version'. */ `tui_version'. */
else if (tui_active) if (tui_active)
low = tuiGetLowDisassemblyAddress (low, pc); /* FIXME: cagney/2004-02-07: This should be an observer. */
low = tui_get_low_disassembly_address (low, pc);
#endif #endif
low += FUNCTION_START_OFFSET; low += FUNCTION_START_OFFSET;
} }
@ -864,8 +865,9 @@ disassemble_command (char *arg, int from_tty)
#if defined(TUI) #if defined(TUI)
/* NOTE: cagney/2003-02-13 The `tui_active' was previously /* NOTE: cagney/2003-02-13 The `tui_active' was previously
`tui_version'. */ `tui_version'. */
else if (tui_active) if (tui_active)
low = tuiGetLowDisassemblyAddress (low, pc); /* FIXME: cagney/2004-02-07: This should be an observer. */
low = tui_get_low_disassembly_address (low, pc);
#endif #endif
low += FUNCTION_START_OFFSET; low += FUNCTION_START_OFFSET;
} }

View file

@ -49,8 +49,7 @@ static int _termHeight, _termWidth;
static struct tui_gen_win_info _locator; static struct tui_gen_win_info _locator;
static struct tui_gen_win_info _execInfo[2]; static struct tui_gen_win_info _execInfo[2];
static struct tui_win_info * _srcWinList[2]; static struct tui_win_info * _srcWinList[2];
static struct tui_list _sourceWindows = static struct tui_list _sourceWindows = {(void **) _srcWinList, 0};
{(OpaqueList) _srcWinList, 0};
static int _defaultTabLen = DEFAULT_TAB_LEN; static int _defaultTabLen = DEFAULT_TAB_LEN;
static struct tui_win_info * _winWithFocus = (struct tui_win_info *) NULL; static struct tui_win_info * _winWithFocus = (struct tui_win_info *) NULL;
static struct tui_layout_def _layoutDef = static struct tui_layout_def _layoutDef =
@ -64,8 +63,8 @@ static int _winResized = FALSE;
/********************************* /*********************************
** Static function forward decls ** Static function forward decls
**********************************/ **********************************/
static void freeContent (tui_win_content, int, TuiWinType); static void freeContent (tui_win_content, int, enum tui_win_type);
static void freeContentElements (tui_win_content, int, TuiWinType); static void freeContentElements (tui_win_content, int, enum tui_win_type);
@ -152,8 +151,8 @@ tui_source_windows (void)
void void
tui_clear_source_windows (void) tui_clear_source_windows (void)
{ {
_sourceWindows.list[0] = (Opaque) NULL; _sourceWindows.list[0] = NULL;
_sourceWindows.list[1] = (Opaque) NULL; _sourceWindows.list[1] = NULL;
_sourceWindows.count = 0; _sourceWindows.count = 0;
} }
@ -176,7 +175,7 @@ void
tui_add_to_source_windows (struct tui_win_info * winInfo) tui_add_to_source_windows (struct tui_win_info * winInfo)
{ {
if (_sourceWindows.count < 2) if (_sourceWindows.count < 2)
_sourceWindows.list[_sourceWindows.count++] = (Opaque) winInfo; _sourceWindows.list[_sourceWindows.count++] = (void *) winInfo;
} }
@ -321,7 +320,7 @@ setGenWinOrigin (struct tui_gen_win_info * winInfo, int x, int y)
struct tui_win_info * struct tui_win_info *
tui_next_win (struct tui_win_info * curWin) tui_next_win (struct tui_win_info * curWin)
{ {
TuiWinType type = curWin->generic.type; enum tui_win_type type = curWin->generic.type;
struct tui_win_info * nextWin = (struct tui_win_info *) NULL; struct tui_win_info * nextWin = (struct tui_win_info *) NULL;
if (curWin->generic.type == CMD_WIN) if (curWin->generic.type == CMD_WIN)
@ -350,7 +349,7 @@ tui_next_win (struct tui_win_info * curWin)
struct tui_win_info * struct tui_win_info *
tui_prev_win (struct tui_win_info * curWin) tui_prev_win (struct tui_win_info * curWin)
{ {
TuiWinType type = curWin->generic.type; enum tui_win_type type = curWin->generic.type;
struct tui_win_info * prev = (struct tui_win_info *) NULL; struct tui_win_info * prev = (struct tui_win_info *) NULL;
if (curWin->generic.type == SRC_WIN) if (curWin->generic.type == SRC_WIN)
@ -469,7 +468,7 @@ tui_init_generic_part (struct tui_gen_win_info * win)
win->contentSize = win->contentSize =
win->lastVisibleLine = 0; win->lastVisibleLine = 0;
win->handle = (WINDOW *) NULL; win->handle = (WINDOW *) NULL;
win->content = (OpaquePtr) NULL; win->content = NULL;
win->contentInUse = win->contentInUse =
win->isVisible = FALSE; win->isVisible = FALSE;
win->title = 0; win->title = 0;
@ -480,7 +479,7 @@ tui_init_generic_part (struct tui_gen_win_info * win)
** initContentElement(). ** initContentElement().
*/ */
void void
initContentElement (struct tui_win_element * element, TuiWinType type) initContentElement (struct tui_win_element * element, enum tui_win_type type)
{ {
element->highlight = FALSE; element->highlight = FALSE;
switch (type) switch (type)
@ -496,7 +495,7 @@ initContentElement (struct tui_win_element * element, TuiWinType type)
tui_init_generic_part (&element->whichElement.dataWindow); tui_init_generic_part (&element->whichElement.dataWindow);
element->whichElement.dataWindow.type = DATA_ITEM_WIN; element->whichElement.dataWindow.type = DATA_ITEM_WIN;
((struct tui_gen_win_info *) & element->whichElement.dataWindow)->content = ((struct tui_gen_win_info *) & element->whichElement.dataWindow)->content =
(OpaquePtr) tui_alloc_content (1, DATA_ITEM_WIN); (void **) tui_alloc_content (1, DATA_ITEM_WIN);
((struct tui_gen_win_info *) ((struct tui_gen_win_info *)
& element->whichElement.dataWindow)->contentSize = 1; & element->whichElement.dataWindow)->contentSize = 1;
break; break;
@ -507,7 +506,7 @@ initContentElement (struct tui_win_element * element, TuiWinType type)
element->whichElement.data.name = (char *) NULL; element->whichElement.data.name = (char *) NULL;
element->whichElement.data.type = TUI_REGISTER; element->whichElement.data.type = TUI_REGISTER;
element->whichElement.data.itemNo = UNDEFINED_ITEM; element->whichElement.data.itemNo = UNDEFINED_ITEM;
element->whichElement.data.value = (Opaque) NULL; element->whichElement.data.value = NULL;
element->whichElement.data.highlight = FALSE; element->whichElement.data.highlight = FALSE;
break; break;
case LOCATOR_WIN: case LOCATOR_WIN:
@ -560,7 +559,7 @@ initWinInfo (struct tui_win_info * winInfo)
winInfo->detail.commandInfo.curch = 0; winInfo->detail.commandInfo.curch = 0;
break; break;
default: default:
winInfo->detail.opaque = (Opaque) NULL; winInfo->detail.opaque = NULL;
break; break;
} }
@ -569,7 +568,7 @@ initWinInfo (struct tui_win_info * winInfo)
struct tui_win_info * struct tui_win_info *
tui_alloc_win_info (TuiWinType type) tui_alloc_win_info (enum tui_win_type type)
{ {
struct tui_win_info * winInfo = (struct tui_win_info *) NULL; struct tui_win_info * winInfo = (struct tui_win_info *) NULL;
@ -589,7 +588,7 @@ tui_alloc_win_info (TuiWinType type)
** Allocates the content and elements in a block. ** Allocates the content and elements in a block.
*/ */
tui_win_content tui_win_content
tui_alloc_content (int numElements, TuiWinType type) tui_alloc_content (int numElements, enum tui_win_type type)
{ {
tui_win_content content = (tui_win_content) NULL; tui_win_content content = (tui_win_content) NULL;
char *elementBlockPtr = (char *) NULL; char *elementBlockPtr = (char *) NULL;
@ -616,7 +615,7 @@ tui_alloc_content (int numElements, TuiWinType type)
} }
else else
{ {
tuiFree ((char *) content); xfree (content);
content = (tui_win_content) NULL; content = (tui_win_content) NULL;
} }
} }
@ -637,21 +636,21 @@ tui_add_content_elements (struct tui_gen_win_info * winInfo, int numElements)
struct tui_win_element * elementPtr; struct tui_win_element * elementPtr;
int i, indexStart; int i, indexStart;
if (winInfo->content == (OpaquePtr) NULL) if (winInfo->content == NULL)
{ {
winInfo->content = (OpaquePtr) tui_alloc_content (numElements, winInfo->type); winInfo->content = (void **) tui_alloc_content (numElements, winInfo->type);
indexStart = 0; indexStart = 0;
} }
else else
indexStart = winInfo->contentSize; indexStart = winInfo->contentSize;
if (winInfo->content != (OpaquePtr) NULL) if (winInfo->content != NULL)
{ {
for (i = indexStart; (i < numElements + indexStart); i++) for (i = indexStart; (i < numElements + indexStart); i++)
{ {
if ((elementPtr = (struct tui_win_element *) if ((elementPtr = (struct tui_win_element *)
xmalloc (sizeof (struct tui_win_element))) != (struct tui_win_element *) NULL) xmalloc (sizeof (struct tui_win_element))) != (struct tui_win_element *) NULL)
{ {
winInfo->content[i] = (Opaque) elementPtr; winInfo->content[i] = (void *) elementPtr;
initContentElement (elementPtr, winInfo->type); initContentElement (elementPtr, winInfo->type);
winInfo->contentSize++; winInfo->contentSize++;
} }
@ -696,7 +695,7 @@ tuiDelWindow (struct tui_win_info * winInfo)
} }
break; break;
case DATA_WIN: case DATA_WIN:
if (winInfo->generic.content != (OpaquePtr) NULL) if (winInfo->generic.content != NULL)
{ {
tui_del_data_windows (winInfo->detail.dataDisplayInfo.regsContent, tui_del_data_windows (winInfo->detail.dataDisplayInfo.regsContent,
winInfo->detail.dataDisplayInfo.regsContentCount); winInfo->detail.dataDisplayInfo.regsContentCount);
@ -746,7 +745,7 @@ tui_free_window (struct tui_win_info * winInfo)
} }
break; break;
case DATA_WIN: case DATA_WIN:
if (winInfo->generic.content != (OpaquePtr) NULL) if (winInfo->generic.content != NULL)
{ {
tui_free_data_content (winInfo->detail.dataDisplayInfo.regsContent, tui_free_data_content (winInfo->detail.dataDisplayInfo.regsContent,
winInfo->detail.dataDisplayInfo.regsContentCount); winInfo->detail.dataDisplayInfo.regsContentCount);
@ -762,7 +761,7 @@ tui_free_window (struct tui_win_info * winInfo)
TUI_UNDEFINED_REGS; TUI_UNDEFINED_REGS;
winInfo->detail.dataDisplayInfo.regsColumnCount = 1; winInfo->detail.dataDisplayInfo.regsColumnCount = 1;
winInfo->detail.dataDisplayInfo.displayRegs = FALSE; winInfo->detail.dataDisplayInfo.displayRegs = FALSE;
winInfo->generic.content = (OpaquePtr) NULL; winInfo->generic.content = NULL;
winInfo->generic.contentSize = 0; winInfo->generic.contentSize = 0;
} }
break; break;
@ -802,12 +801,12 @@ tui_free_all_source_wins_content (void)
void void
tui_free_win_content (struct tui_gen_win_info * winInfo) tui_free_win_content (struct tui_gen_win_info * winInfo)
{ {
if (winInfo->content != (OpaquePtr) NULL) if (winInfo->content != NULL)
{ {
freeContent ((tui_win_content) winInfo->content, freeContent ((tui_win_content) winInfo->content,
winInfo->contentSize, winInfo->contentSize,
winInfo->type); winInfo->type);
winInfo->content = (OpaquePtr) NULL; winInfo->content = NULL;
} }
winInfo->contentSize = 0; winInfo->contentSize = 0;
@ -875,12 +874,12 @@ tui_free_data_content (tui_win_content content, int contentSize)
** freeContent(). ** freeContent().
*/ */
static void static void
freeContent (tui_win_content content, int contentSize, TuiWinType winType) freeContent (tui_win_content content, int contentSize, enum tui_win_type winType)
{ {
if (content != (tui_win_content) NULL) if (content != (tui_win_content) NULL)
{ {
freeContentElements (content, contentSize, winType); freeContentElements (content, contentSize, winType);
tuiFree ((char *) content); xfree (content);
} }
return; return;
@ -891,7 +890,7 @@ freeContent (tui_win_content content, int contentSize, TuiWinType winType)
** freeContentElements(). ** freeContentElements().
*/ */
static void static void
freeContentElements (tui_win_content content, int contentSize, TuiWinType type) freeContentElements (tui_win_content content, int contentSize, enum tui_win_type type)
{ {
if (content != (tui_win_content) NULL) if (content != (tui_win_content) NULL)
{ {
@ -900,8 +899,7 @@ freeContentElements (tui_win_content content, int contentSize, TuiWinType type)
if (type == SRC_WIN || type == DISASSEM_WIN) if (type == SRC_WIN || type == DISASSEM_WIN)
{ {
/* free whole source block */ /* free whole source block */
if (content[0]->whichElement.source.line != (char *) NULL) xfree (content[0]->whichElement.source.line);
tuiFree (content[0]->whichElement.source.line);
} }
else else
{ {
@ -915,7 +913,7 @@ freeContentElements (tui_win_content content, int contentSize, TuiWinType type)
switch (type) switch (type)
{ {
case DATA_WIN: case DATA_WIN:
tuiFree ((char *) element); xfree (element);
break; break;
case DATA_ITEM_WIN: case DATA_ITEM_WIN:
/* /*
@ -923,13 +921,12 @@ freeContentElements (tui_win_content content, int contentSize, TuiWinType type)
** in a single block, but individually, as needed. ** in a single block, but individually, as needed.
*/ */
if (element->whichElement.data.type != TUI_REGISTER) if (element->whichElement.data.type != TUI_REGISTER)
tuiFree ((char *) xfree ((void *)element->whichElement.data.name);
element->whichElement.data.name); xfree (element->whichElement.data.value);
tuiFree ((char *) element->whichElement.data.value); xfree (element);
tuiFree ((char *) element);
break; break;
case CMD_WIN: case CMD_WIN:
tuiFree ((char *) element->whichElement.command.line); xfree (element->whichElement.command.line);
break; break;
default: default:
break; break;
@ -938,7 +935,7 @@ freeContentElements (tui_win_content content, int contentSize, TuiWinType type)
} }
} }
if (type != DATA_WIN && type != DATA_ITEM_WIN) if (type != DATA_WIN && type != DATA_ITEM_WIN)
tuiFree ((char *) content[0]); /* free the element block */ xfree (content[0]); /* free the element block */
} }
return; return;

View file

@ -35,11 +35,11 @@
struct tui_gen_win_info struct tui_gen_win_info
{ {
WINDOW *handle; /* window handle */ WINDOW *handle; /* window handle */
TuiWinType type; /* type of window */ enum tui_win_type type; /* type of window */
int width; /* window width */ int width; /* window width */
int height; /* window height */ int height; /* window height */
TuiPoint origin; /* origin of window */ struct tui_point origin; /* origin of window */
OpaquePtr content; /* content of window */ void **content; /* content of window */
int contentSize; /* Size of content (# of elements) */ int contentSize; /* Size of content (# of elements) */
int contentInUse; /* Can it be used, or is it already used? */ int contentInUse; /* Can it be used, or is it already used? */
int viewportHeight; /* viewport height */ int viewportHeight; /* viewport height */
@ -107,7 +107,7 @@ enum tui_scroll_direction
/* General list struct. */ /* General list struct. */
struct tui_list struct tui_list
{ {
OpaqueList list; void **list;
int count; int count;
}; };
@ -153,7 +153,7 @@ union tui_line_or_address
/* Current Layout definition */ /* Current Layout definition */
struct tui_layout_def struct tui_layout_def
{ {
TuiWinType displayMode; enum tui_win_type displayMode;
int split; int split;
enum tui_register_display_type regsDisplayType; enum tui_register_display_type regsDisplayType;
enum tui_register_display_type floatRegsDisplayType; enum tui_register_display_type floatRegsDisplayType;
@ -175,7 +175,7 @@ struct tui_data_element
const char *name; const char *name;
int itemNo; /* the register number, or data display number */ int itemNo; /* the register number, or data display number */
enum tui_data_type type; enum tui_data_type type;
Opaque value; void *value;
int highlight; int highlight;
}; };
@ -276,7 +276,7 @@ struct tui_win_info
struct tui_source_info sourceInfo; struct tui_source_info sourceInfo;
struct tui_data_info dataDisplayInfo; struct tui_data_info dataDisplayInfo;
struct tui_command_info commandInfo; struct tui_command_info commandInfo;
Opaque opaque; void *opaque;
} }
detail; detail;
int canHighlight; /* Can this window ever be highlighted? */ int canHighlight; /* Can this window ever be highlighted? */
@ -324,7 +324,7 @@ extern struct tui_win_info *(winList[MAX_MAJOR_WINDOWS]);
/* Data Manipulation Functions */ /* Data Manipulation Functions */
extern void tui_initialize_static_data (void); extern void tui_initialize_static_data (void);
extern struct tui_gen_win_info *tui_alloc_generic_win_info (void); extern struct tui_gen_win_info *tui_alloc_generic_win_info (void);
extern struct tui_win_info *tui_alloc_win_info (TuiWinType); extern struct tui_win_info *tui_alloc_win_info (enum tui_win_type);
extern void tui_init_generic_part (struct tui_gen_win_info *); extern void tui_init_generic_part (struct tui_gen_win_info *);
extern void tui_init_win_info (struct tui_win_info *); extern void tui_init_win_info (struct tui_win_info *);
extern tui_win_content tui_alloc_content (int, enum tui_win_type); extern tui_win_content tui_alloc_content (int, enum tui_win_type);

View file

@ -175,7 +175,7 @@ tui_find_disassembly_address (CORE_ADDR pc, int from)
enum tui_status enum tui_status
tui_set_disassem_content (CORE_ADDR pc) tui_set_disassem_content (CORE_ADDR pc)
{ {
TuiStatus ret = TUI_FAILURE; enum tui_status ret = TUI_FAILURE;
register int i; register int i;
register int offset = disassemWin->detail.sourceInfo.horizontalOffset; register int offset = disassemWin->detail.sourceInfo.horizontalOffset;
register int lineWidth, maxLines; register int lineWidth, maxLines;
@ -358,7 +358,7 @@ tui_get_begin_asm_address (void)
disassembly window. This may or may not be the same as the disassembly window. This may or may not be the same as the
low address input. */ low address input. */
CORE_ADDR CORE_ADDR
tuiGetLowDisassemblyAddress (CORE_ADDR low, CORE_ADDR pc) tui_get_low_disassembly_address (CORE_ADDR low, CORE_ADDR pc)
{ {
int pos; int pos;
@ -377,7 +377,7 @@ void
tui_vertical_disassem_scroll (enum tui_scroll_direction scrollDirection, tui_vertical_disassem_scroll (enum tui_scroll_direction scrollDirection,
int numToScroll) int numToScroll)
{ {
if (disassemWin->generic.content != (OpaquePtr) NULL) if (disassemWin->generic.content != NULL)
{ {
CORE_ADDR pc; CORE_ADDR pc;
tui_win_content content; tui_win_content content;

View file

@ -51,10 +51,10 @@
** Static Local Decls ** Static Local Decls
********************************/ ********************************/
static void showLayout (enum tui_layout_type); static void showLayout (enum tui_layout_type);
static void _initGenWinInfo (struct tui_gen_win_info *, TuiWinType, int, int, int, int); static void _initGenWinInfo (struct tui_gen_win_info *, enum tui_win_type, int, int, int, int);
static void _initAndMakeWin (Opaque *, TuiWinType, int, int, int, int, int); static void _initAndMakeWin (void **, enum tui_win_type, int, int, int, int, int);
static void _showSourceOrDisassemAndCommand (enum tui_layout_type); static void _showSourceOrDisassemAndCommand (enum tui_layout_type);
static void _makeSourceOrDisassemWindow (struct tui_win_info * *, TuiWinType, int, int); static void _makeSourceOrDisassemWindow (struct tui_win_info * *, enum tui_win_type, int, int);
static void _makeCommandWindow (struct tui_win_info * *, int, int); static void _makeCommandWindow (struct tui_win_info * *, int, int);
static void _makeSourceWindow (struct tui_win_info * *, int, int); static void _makeSourceWindow (struct tui_win_info * *, int, int);
static void _makeDisassemWindow (struct tui_win_info * *, int, int); static void _makeDisassemWindow (struct tui_win_info * *, int, int);
@ -137,7 +137,7 @@ enum tui_status
tui_set_layout (enum tui_layout_type layoutType, tui_set_layout (enum tui_layout_type layoutType,
enum tui_register_display_type regsDisplayType) enum tui_register_display_type regsDisplayType)
{ {
TuiStatus status = TUI_SUCCESS; enum tui_status status = TUI_SUCCESS;
if (layoutType != UNDEFINED_LAYOUT || regsDisplayType != TUI_UNDEFINED_REGS) if (layoutType != UNDEFINED_LAYOUT || regsDisplayType != TUI_UNDEFINED_REGS)
{ {
@ -325,7 +325,7 @@ tui_add_win_to_layout (enum tui_win_type type)
** type and the layout. ** type and the layout.
*/ */
int int
tuiDefaultWinHeight (TuiWinType type, enum tui_layout_type layout) tuiDefaultWinHeight (enum tui_win_type type, enum tui_layout_type layout)
{ {
int h; int h;
@ -422,10 +422,10 @@ Source/Disassembly/Command layouts.\n");
** Function to set the layout to SRC, ASM, SPLIT, NEXT, PREV, DATA, REGS, ** Function to set the layout to SRC, ASM, SPLIT, NEXT, PREV, DATA, REGS,
** $REGS, $GREGS, $FREGS, $SREGS. ** $REGS, $GREGS, $FREGS, $SREGS.
*/ */
TuiStatus enum tui_status
tui_set_layout_for_display_command (const char *layoutName) tui_set_layout_for_display_command (const char *layoutName)
{ {
TuiStatus status = TUI_SUCCESS; enum tui_status status = TUI_SUCCESS;
if (layoutName != (char *) NULL) if (layoutName != (char *) NULL)
{ {
@ -673,7 +673,7 @@ _prevLayout (void)
static void static void
_makeCommandWindow (struct tui_win_info * * winInfoPtr, int height, int originY) _makeCommandWindow (struct tui_win_info * * winInfoPtr, int height, int originY)
{ {
_initAndMakeWin ((Opaque *) winInfoPtr, _initAndMakeWin ((void **) winInfoPtr,
CMD_WIN, CMD_WIN,
height, height,
tui_term_width (), tui_term_width (),
@ -717,7 +717,7 @@ _makeDisassemWindow (struct tui_win_info * * winInfoPtr, int height, int originY
static void static void
_makeDataWindow (struct tui_win_info * * winInfoPtr, int height, int originY) _makeDataWindow (struct tui_win_info * * winInfoPtr, int height, int originY)
{ {
_initAndMakeWin ((Opaque *) winInfoPtr, _initAndMakeWin ((void **) winInfoPtr,
DATA_WIN, DATA_WIN,
height, height,
tui_term_width (), tui_term_width (),
@ -804,7 +804,7 @@ _showSourceDisassemCommand (void)
if (m_winPtrIsNull (disassemWin)) if (m_winPtrIsNull (disassemWin))
{ {
_makeDisassemWindow (&disassemWin, asmHeight, srcHeight - 1); _makeDisassemWindow (&disassemWin, asmHeight, srcHeight - 1);
_initAndMakeWin ((Opaque *) & locator, _initAndMakeWin ((void **) & locator,
LOCATOR_WIN, LOCATOR_WIN,
2 /* 1 */ , 2 /* 1 */ ,
tui_term_width (), tui_term_width (),
@ -881,7 +881,7 @@ _showData (enum tui_layout_type newLayout)
{ {
int totalHeight = (tui_term_height () - cmdWin->generic.height); int totalHeight = (tui_term_height () - cmdWin->generic.height);
int srcHeight, dataHeight; int srcHeight, dataHeight;
TuiWinType winType; enum tui_win_type winType;
struct tui_gen_win_info * locator = tui_locator_win_info_ptr (); struct tui_gen_win_info * locator = tui_locator_win_info_ptr ();
@ -901,7 +901,7 @@ _showData (enum tui_layout_type newLayout)
_makeSourceWindow (&winList[winType], srcHeight, dataHeight - 1); _makeSourceWindow (&winList[winType], srcHeight, dataHeight - 1);
else else
_makeDisassemWindow (&winList[winType], srcHeight, dataHeight - 1); _makeDisassemWindow (&winList[winType], srcHeight, dataHeight - 1);
_initAndMakeWin ((Opaque *) & locator, _initAndMakeWin ((void **) & locator,
LOCATOR_WIN, LOCATOR_WIN,
2 /* 1 */ , 2 /* 1 */ ,
tui_term_width (), tui_term_width (),
@ -945,7 +945,7 @@ _showData (enum tui_layout_type newLayout)
** _initGenWinInfo(). ** _initGenWinInfo().
*/ */
static void static void
_initGenWinInfo (struct tui_gen_win_info * winInfo, TuiWinType type, _initGenWinInfo (struct tui_gen_win_info * winInfo, enum tui_win_type type,
int height, int width, int originX, int originY) int height, int width, int originX, int originY)
{ {
int h = height; int h = height;
@ -971,25 +971,25 @@ _initGenWinInfo (struct tui_gen_win_info * winInfo, TuiWinType type,
** _initAndMakeWin(). ** _initAndMakeWin().
*/ */
static void static void
_initAndMakeWin (Opaque * winInfoPtr, TuiWinType winType, _initAndMakeWin (void ** winInfoPtr, enum tui_win_type winType,
int height, int width, int originX, int originY, int boxIt) int height, int width, int originX, int originY, int boxIt)
{ {
Opaque opaqueWinInfo = *winInfoPtr; void *opaqueWinInfo = *winInfoPtr;
struct tui_gen_win_info * generic; struct tui_gen_win_info * generic;
if (opaqueWinInfo == (Opaque) NULL) if (opaqueWinInfo == NULL)
{ {
if (m_winIsAuxillary (winType)) if (m_winIsAuxillary (winType))
opaqueWinInfo = (Opaque) tui_alloc_generic_win_info (); opaqueWinInfo = (void *) tui_alloc_generic_win_info ();
else else
opaqueWinInfo = (Opaque) tui_alloc_win_info (winType); opaqueWinInfo = (void *) tui_alloc_win_info (winType);
} }
if (m_winIsAuxillary (winType)) if (m_winIsAuxillary (winType))
generic = (struct tui_gen_win_info *) opaqueWinInfo; generic = (struct tui_gen_win_info *) opaqueWinInfo;
else else
generic = &((struct tui_win_info *) opaqueWinInfo)->generic; generic = &((struct tui_win_info *) opaqueWinInfo)->generic;
if (opaqueWinInfo != (Opaque) NULL) if (opaqueWinInfo != NULL)
{ {
_initGenWinInfo (generic, winType, height, width, originX, originY); _initGenWinInfo (generic, winType, height, width, originX, originY);
if (!m_winIsAuxillary (winType)) if (!m_winIsAuxillary (winType))
@ -1009,7 +1009,7 @@ _initAndMakeWin (Opaque * winInfoPtr, TuiWinType winType,
** _makeSourceOrDisassemWindow(). ** _makeSourceOrDisassemWindow().
*/ */
static void static void
_makeSourceOrDisassemWindow (struct tui_win_info * * winInfoPtr, TuiWinType type, _makeSourceOrDisassemWindow (struct tui_win_info * * winInfoPtr, enum tui_win_type type,
int height, int originY) int height, int originY)
{ {
struct tui_gen_win_info * executionInfo = (struct tui_gen_win_info *) NULL; struct tui_gen_win_info * executionInfo = (struct tui_gen_win_info *) NULL;
@ -1021,7 +1021,7 @@ _makeSourceOrDisassemWindow (struct tui_win_info * * winInfoPtr, TuiWinType type
executionInfo = tui_source_exec_info_win_ptr (); executionInfo = tui_source_exec_info_win_ptr ();
else else
executionInfo = tui_disassem_exec_info_win_ptr (); executionInfo = tui_disassem_exec_info_win_ptr ();
_initAndMakeWin ((Opaque *) & executionInfo, _initAndMakeWin ((void **) & executionInfo,
EXEC_INFO_WIN, EXEC_INFO_WIN,
height, height,
3, 3,
@ -1031,7 +1031,7 @@ _makeSourceOrDisassemWindow (struct tui_win_info * * winInfoPtr, TuiWinType type
/* /*
** Now create the source window. ** Now create the source window.
*/ */
_initAndMakeWin ((Opaque *) winInfoPtr, _initAndMakeWin ((void **) winInfoPtr,
type, type,
height, height,
tui_term_width () - executionInfo->width, tui_term_width () - executionInfo->width,
@ -1076,7 +1076,7 @@ _showSourceOrDisassemAndCommand (enum tui_layout_type layoutType)
_makeSourceWindow (winInfoPtr, srcHeight - 1, 0); _makeSourceWindow (winInfoPtr, srcHeight - 1, 0);
else else
_makeDisassemWindow (winInfoPtr, srcHeight - 1, 0); _makeDisassemWindow (winInfoPtr, srcHeight - 1, 0);
_initAndMakeWin ((Opaque *) & locator, _initAndMakeWin ((void **) & locator,
LOCATOR_WIN, LOCATOR_WIN,
2 /* 1 */ , 2 /* 1 */ ,
tui_term_width (), tui_term_width (),

View file

@ -76,19 +76,19 @@
/***************************************** /*****************************************
** STATIC LOCAL FUNCTIONS FORWARD DECLS ** ** STATIC LOCAL FUNCTIONS FORWARD DECLS **
******************************************/ ******************************************/
static TuiStatus _tuiSetRegsContent static enum tui_status _tuiSetRegsContent
(int, int, struct frame_info *, enum tui_register_display_type, int); (int, int, struct frame_info *, enum tui_register_display_type, int);
static const char *_tuiRegisterName (int); static const char *_tuiRegisterName (int);
static TuiStatus _tuiGetRegisterRawValue (int, char *, struct frame_info *); static enum tui_status _tuiGetRegisterRawValue (int, char *, struct frame_info *);
static void _tuiSetRegisterElement static void _tuiSetRegisterElement
(int, struct frame_info *, struct tui_data_element *, int); (int, struct frame_info *, struct tui_data_element *, int);
static void _tuiDisplayRegister (int, struct tui_gen_win_info *, enum precision_type); static void _tuiDisplayRegister (int, struct tui_gen_win_info *, enum precision_type);
static void _tuiRegisterFormat static void _tuiRegisterFormat
(char *, int, int, struct tui_data_element *, enum precision_type); (char *, int, int, struct tui_data_element *, enum precision_type);
static TuiStatus _tuiSetGeneralRegsContent (int); static enum tui_status _tuiSetGeneralRegsContent (int);
static TuiStatus _tuiSetSpecialRegsContent (int); static enum tui_status _tuiSetSpecialRegsContent (int);
static TuiStatus _tuiSetGeneralAndSpecialRegsContent (int); static enum tui_status _tuiSetGeneralAndSpecialRegsContent (int);
static TuiStatus _tuiSetFloatRegsContent (enum tui_register_display_type, int); static enum tui_status _tuiSetFloatRegsContent (enum tui_register_display_type, int);
static int _tuiRegValueHasChanged static int _tuiRegValueHasChanged
(struct tui_data_element *, struct frame_info *, char *); (struct tui_data_element *, struct frame_info *, char *);
static void _tuiShowFloat_command (char *, int); static void _tuiShowFloat_command (char *, int);
@ -211,7 +211,7 @@ tui_calculate_regs_column_count (enum tui_register_display_type dpyType)
void void
tui_show_registers (enum tui_register_display_type dpyType) tui_show_registers (enum tui_register_display_type dpyType)
{ {
TuiStatus ret = TUI_FAILURE; enum tui_status ret = TUI_FAILURE;
int refreshValuesOnly = FALSE; int refreshValuesOnly = FALSE;
/* Say that registers should be displayed, even if there is a problem */ /* Say that registers should be displayed, even if there is a problem */
@ -641,7 +641,7 @@ _tuiRegisterFormat (char *buf, int bufLen, int regNum,
** _tuiSetGeneralRegsContent(). ** _tuiSetGeneralRegsContent().
** Set the content of the data window to consist of the general registers. ** Set the content of the data window to consist of the general registers.
*/ */
static TuiStatus static enum tui_status
_tuiSetGeneralRegsContent (int refreshValuesOnly) _tuiSetGeneralRegsContent (int refreshValuesOnly)
{ {
return (_tuiSetRegsContent (0, return (_tuiSetRegsContent (0,
@ -663,10 +663,10 @@ _tuiSetGeneralRegsContent (int refreshValuesOnly)
** _tuiSetSpecialRegsContent(). ** _tuiSetSpecialRegsContent().
** Set the content of the data window to consist of the special registers. ** Set the content of the data window to consist of the special registers.
*/ */
static TuiStatus static enum tui_status
_tuiSetSpecialRegsContent (int refreshValuesOnly) _tuiSetSpecialRegsContent (int refreshValuesOnly)
{ {
TuiStatus ret = TUI_FAILURE; enum tui_status ret = TUI_FAILURE;
int endRegNum; int endRegNum;
endRegNum = FP0_REGNUM - 1; endRegNum = FP0_REGNUM - 1;
@ -684,10 +684,10 @@ _tuiSetSpecialRegsContent (int refreshValuesOnly)
** _tuiSetGeneralAndSpecialRegsContent(). ** _tuiSetGeneralAndSpecialRegsContent().
** Set the content of the data window to consist of the special registers. ** Set the content of the data window to consist of the special registers.
*/ */
static TuiStatus static enum tui_status
_tuiSetGeneralAndSpecialRegsContent (int refreshValuesOnly) _tuiSetGeneralAndSpecialRegsContent (int refreshValuesOnly)
{ {
TuiStatus ret = TUI_FAILURE; enum tui_status ret = TUI_FAILURE;
int endRegNum = (-1); int endRegNum = (-1);
endRegNum = FP0_REGNUM - 1; endRegNum = FP0_REGNUM - 1;
@ -701,10 +701,10 @@ _tuiSetGeneralAndSpecialRegsContent (int refreshValuesOnly)
** _tuiSetFloatRegsContent(). ** _tuiSetFloatRegsContent().
** Set the content of the data window to consist of the float registers. ** Set the content of the data window to consist of the float registers.
*/ */
static TuiStatus static enum tui_status
_tuiSetFloatRegsContent (enum tui_register_display_type dpyType, int refreshValuesOnly) _tuiSetFloatRegsContent (enum tui_register_display_type dpyType, int refreshValuesOnly)
{ {
TuiStatus ret = TUI_FAILURE; enum tui_status ret = TUI_FAILURE;
int startRegNum; int startRegNum;
startRegNum = FP0_REGNUM; startRegNum = FP0_REGNUM;
@ -759,10 +759,10 @@ _tuiRegValueHasChanged (struct tui_data_element * dataElement,
** _tuiGetRegisterRawValue(). ** _tuiGetRegisterRawValue().
** Get the register raw value. The raw value is returned in regValue. ** Get the register raw value. The raw value is returned in regValue.
*/ */
static TuiStatus static enum tui_status
_tuiGetRegisterRawValue (int regNum, char *regValue, struct frame_info *frame) _tuiGetRegisterRawValue (int regNum, char *regValue, struct frame_info *frame)
{ {
TuiStatus ret = TUI_FAILURE; enum tui_status ret = TUI_FAILURE;
if (target_has_registers) if (target_has_registers)
{ {
@ -796,9 +796,9 @@ _tuiSetRegisterElement (int regNum, struct frame_info *frame,
dataElement->name = _tuiRegisterName (regNum); dataElement->name = _tuiRegisterName (regNum);
dataElement->highlight = FALSE; dataElement->highlight = FALSE;
} }
if (dataElement->value == (Opaque) NULL) if (dataElement->value == NULL)
dataElement->value = (Opaque) xmalloc (MAX_REGISTER_SIZE); dataElement->value = xmalloc (MAX_REGISTER_SIZE);
if (dataElement->value != (Opaque) NULL) if (dataElement->value != NULL)
_tuiGetRegisterRawValue (regNum, dataElement->value, frame); _tuiGetRegisterRawValue (regNum, dataElement->value, frame);
} }
@ -812,13 +812,13 @@ _tuiSetRegisterElement (int regNum, struct frame_info *frame,
** numbered from startRegNum to endRegNum. Note that if ** numbered from startRegNum to endRegNum. Note that if
** refreshValuesOnly is TRUE, startRegNum and endRegNum are ignored. ** refreshValuesOnly is TRUE, startRegNum and endRegNum are ignored.
*/ */
static TuiStatus static enum tui_status
_tuiSetRegsContent (int startRegNum, int endRegNum, _tuiSetRegsContent (int startRegNum, int endRegNum,
struct frame_info *frame, struct frame_info *frame,
enum tui_register_display_type dpyType, enum tui_register_display_type dpyType,
int refreshValuesOnly) int refreshValuesOnly)
{ {
TuiStatus ret = TUI_FAILURE; enum tui_status ret = TUI_FAILURE;
int numRegs = endRegNum - startRegNum + 1; int numRegs = endRegNum - startRegNum + 1;
int allocatedHere = FALSE; int allocatedHere = FALSE;
@ -842,7 +842,7 @@ _tuiSetRegsContent (int startRegNum, int endRegNum,
if (!refreshValuesOnly || allocatedHere) if (!refreshValuesOnly || allocatedHere)
{ {
dataWin->generic.content = (OpaquePtr) NULL; dataWin->generic.content = NULL;
dataWin->generic.contentSize = 0; dataWin->generic.contentSize = 0;
tui_add_content_elements (&dataWin->generic, numRegs); tui_add_content_elements (&dataWin->generic, numRegs);
dataWin->detail.dataDisplayInfo.regsContent = dataWin->detail.dataDisplayInfo.regsContent =

View file

@ -48,7 +48,7 @@
enum tui_status enum tui_status
tui_set_source_content (struct symtab *s, int lineNo, int noerror) tui_set_source_content (struct symtab *s, int lineNo, int noerror)
{ {
TuiStatus ret = TUI_FAILURE; enum tui_status ret = TUI_FAILURE;
if (s != (struct symtab *) NULL && s->filename != (char *) NULL) if (s != (struct symtab *) NULL && s->filename != (char *) NULL)
{ {
@ -214,7 +214,7 @@ tui_set_source_content (struct symtab *s, int lineNo, int noerror)
curLineNo++; curLineNo++;
} }
if (offset > 0) if (offset > 0)
tuiFree (srcLine); xfree (srcLine);
fclose (stream); fclose (stream);
srcWin->generic.contentSize = nlines; srcWin->generic.contentSize = nlines;
ret = TUI_SUCCESS; ret = TUI_SUCCESS;
@ -323,7 +323,7 @@ void
tui_vertical_source_scroll (enum tui_scroll_direction scrollDirection, tui_vertical_source_scroll (enum tui_scroll_direction scrollDirection,
int numToScroll) int numToScroll)
{ {
if (srcWin->generic.content != (OpaquePtr) NULL) if (srcWin->generic.content != NULL)
{ {
union tui_line_or_address l; union tui_line_or_address l;
struct symtab *s; struct symtab *s;

View file

@ -280,7 +280,7 @@ tui_set_locator_filename (const char *filename)
struct tui_gen_win_info * locator = tui_locator_win_info_ptr (); struct tui_gen_win_info * locator = tui_locator_win_info_ptr ();
struct tui_locator_element * element; struct tui_locator_element * element;
if (locator->content[0] == (Opaque) NULL) if (locator->content[0] == NULL)
{ {
tui_set_locator_info (filename, NULL, 0, 0); tui_set_locator_info (filename, NULL, 0, 0);
return; return;
@ -302,7 +302,7 @@ tui_set_locator_info (const char *filename, const char *procname, int lineno,
/* Allocate the locator content if necessary. */ /* Allocate the locator content if necessary. */
if (locator->contentSize <= 0) if (locator->contentSize <= 0)
{ {
locator->content = (OpaquePtr) tui_alloc_content (1, locator->type); locator->content = (void **) tui_alloc_content (1, locator->type);
locator->contentSize = 1; locator->contentSize = 1;
} }
@ -366,7 +366,7 @@ tui_show_frame_info (struct frame_info *fi)
&low, (CORE_ADDR) NULL) == 0) &low, (CORE_ADDR) NULL) == 0)
error ("No function contains program counter for selected frame.\n"); error ("No function contains program counter for selected frame.\n");
else else
low = tuiGetLowDisassemblyAddress (low, get_frame_pc (fi)); low = tui_get_low_disassembly_address (low, get_frame_pc (fi));
} }
if (winInfo == srcWin) if (winInfo == srcWin)

View file

@ -63,7 +63,7 @@
********************************/ ********************************/
static void _makeVisibleWithNewHeight (struct tui_win_info *); static void _makeVisibleWithNewHeight (struct tui_win_info *);
static void _makeInvisibleAndSetNewHeight (struct tui_win_info *, int); static void _makeInvisibleAndSetNewHeight (struct tui_win_info *, int);
static TuiStatus _tuiAdjustWinHeights (struct tui_win_info *, int); static enum tui_status _tuiAdjustWinHeights (struct tui_win_info *, int);
static int _newHeightOk (struct tui_win_info *, int); static int _newHeightOk (struct tui_win_info *, int);
static void _tuiSetTabWidth_command (char *, int); static void _tuiSetTabWidth_command (char *, int);
static void _tuiRefreshAll_command (char *, int); static void _tuiRefreshAll_command (char *, int);
@ -563,7 +563,7 @@ tui_scroll (enum tui_scroll_direction direction,
void void
tui_refresh_all_win (void) tui_refresh_all_win (void)
{ {
TuiWinType type; enum tui_win_type type;
clearok (curscr, TRUE); clearok (curscr, TRUE);
tui_refresh_all (winList); tui_refresh_all (winList);
@ -613,7 +613,7 @@ tuiResizeAll (void)
struct tui_win_info *firstWin; struct tui_win_info *firstWin;
struct tui_win_info *secondWin; struct tui_win_info *secondWin;
struct tui_gen_win_info * locator = tui_locator_win_info_ptr (); struct tui_gen_win_info * locator = tui_locator_win_info_ptr ();
TuiWinType winType; enum tui_win_type winType;
int newHeight, splitDiff, cmdSplitDiff, numWinsDisplayed = 2; int newHeight, splitDiff, cmdSplitDiff, numWinsDisplayed = 2;
/* turn keypad off while we resize */ /* turn keypad off while we resize */
@ -885,7 +885,7 @@ The window name specified must be valid and visible.\n");
if (dataWin && dataWin->generic.isVisible) if (dataWin && dataWin->generic.isVisible)
tui_refresh_data_win (); tui_refresh_data_win ();
tuiFree (bufPtr); xfree (bufPtr);
printf_filtered ("Focus set to %s window.\n", printf_filtered ("Focus set to %s window.\n",
tui_win_name ((struct tui_gen_win_info *) tui_win_with_focus ())); tui_win_name ((struct tui_gen_win_info *) tui_win_with_focus ()));
} }
@ -913,7 +913,7 @@ _tuiSetFocus_command (char *arg, int fromTTY)
static void static void
_tuiAllWindowsInfo (char *arg, int fromTTY) _tuiAllWindowsInfo (char *arg, int fromTTY)
{ {
TuiWinType type; enum tui_win_type type;
struct tui_win_info * winWithFocus = tui_win_with_focus (); struct tui_win_info * winWithFocus = tui_win_with_focus ();
for (type = SRC_WIN; (type < MAX_MAJOR_WINDOWS); type++) for (type = SRC_WIN; (type < MAX_MAJOR_WINDOWS); type++)
@ -1052,7 +1052,7 @@ The window name specified must be valid and visible.\n");
printf_filtered (WIN_HEIGHT_USAGE); printf_filtered (WIN_HEIGHT_USAGE);
if (buf != (char *) NULL) if (buf != (char *) NULL)
tuiFree (buf); xfree (buf);
} }
else else
printf_filtered (WIN_HEIGHT_USAGE); printf_filtered (WIN_HEIGHT_USAGE);
@ -1122,10 +1122,10 @@ _tuiXDBsetWinHeight_command (char *arg, int fromTTY)
** _tuiAdjustWinHeights(). ** _tuiAdjustWinHeights().
** Function to adjust all window heights around the primary ** Function to adjust all window heights around the primary
*/ */
static TuiStatus static enum tui_status
_tuiAdjustWinHeights (struct tui_win_info * primaryWinInfo, int newHeight) _tuiAdjustWinHeights (struct tui_win_info * primaryWinInfo, int newHeight)
{ {
TuiStatus status = TUI_FAILURE; enum tui_status status = TUI_FAILURE;
if (_newHeightOk (primaryWinInfo, newHeight)) if (_newHeightOk (primaryWinInfo, newHeight))
{ {
@ -1350,7 +1350,7 @@ _makeVisibleWithNewHeight (struct tui_win_info * winInfo)
case DISASSEM_WIN: case DISASSEM_WIN:
tui_free_win_content (winInfo->detail.sourceInfo.executionInfo); tui_free_win_content (winInfo->detail.sourceInfo.executionInfo);
tui_make_visible (winInfo->detail.sourceInfo.executionInfo); tui_make_visible (winInfo->detail.sourceInfo.executionInfo);
if (winInfo->generic.content != (OpaquePtr) NULL) if (winInfo->generic.content != NULL)
{ {
union tui_line_or_address lineOrAddr; union tui_line_or_address lineOrAddr;
struct symtab_and_line cursal struct symtab_and_line cursal
@ -1582,7 +1582,7 @@ The window name specified must be valid and visible.\n");
else if (*winToScroll == cmdWin) else if (*winToScroll == cmdWin)
*winToScroll = (struct tui_win_info *) (tui_source_windows ())->list[0]; *winToScroll = (struct tui_win_info *) (tui_source_windows ())->list[0];
} }
tuiFree (buf); xfree (buf);
} }
return; return;

View file

@ -252,7 +252,7 @@ tui_make_all_invisible (void)
void void
tui_refresh_all (struct tui_win_info * * list) tui_refresh_all (struct tui_win_info * * list)
{ {
TuiWinType type; enum tui_win_type type;
struct tui_gen_win_info * locator = tui_locator_win_info_ptr (); struct tui_gen_win_info * locator = tui_locator_win_info_ptr ();
for (type = SRC_WIN; (type < MAX_MAJOR_WINDOWS); type++) for (type = SRC_WIN; (type < MAX_MAJOR_WINDOWS); type++)

View file

@ -91,7 +91,7 @@ void
tui_update_source_window_as_is (struct tui_win_info * winInfo, struct symtab *s, tui_update_source_window_as_is (struct tui_win_info * winInfo, struct symtab *s,
union tui_line_or_address lineOrAddr, int noerror) union tui_line_or_address lineOrAddr, int noerror)
{ {
TuiStatus ret; enum tui_status ret;
if (winInfo->generic.type == SRC_WIN) if (winInfo->generic.type == SRC_WIN)
ret = tui_set_source_content (s, lineOrAddr.lineNo, noerror); ret = tui_set_source_content (s, lineOrAddr.lineNo, noerror);
@ -314,7 +314,7 @@ tui_horizontal_source_scroll (struct tui_win_info * winInfo,
enum tui_scroll_direction direction, enum tui_scroll_direction direction,
int numToScroll) int numToScroll)
{ {
if (winInfo->generic.content != (OpaquePtr) NULL) if (winInfo->generic.content != NULL)
{ {
int offset; int offset;
struct symtab *s; struct symtab *s;
@ -459,20 +459,20 @@ tui_update_breakpoint_info (struct tui_win_info * win, int current_only)
** based upon the input window which is either the source or ** based upon the input window which is either the source or
** disassembly window. ** disassembly window.
*/ */
TuiStatus enum tui_status
tuiSetExecInfoContent (struct tui_win_info * winInfo) tuiSetExecInfoContent (struct tui_win_info * winInfo)
{ {
TuiStatus ret = TUI_SUCCESS; enum tui_status ret = TUI_SUCCESS;
if (winInfo->detail.sourceInfo.executionInfo != (struct tui_gen_win_info *) NULL) if (winInfo->detail.sourceInfo.executionInfo != (struct tui_gen_win_info *) NULL)
{ {
struct tui_gen_win_info * execInfoPtr = winInfo->detail.sourceInfo.executionInfo; struct tui_gen_win_info * execInfoPtr = winInfo->detail.sourceInfo.executionInfo;
if (execInfoPtr->content == (OpaquePtr) NULL) if (execInfoPtr->content == NULL)
execInfoPtr->content = execInfoPtr->content =
(OpaquePtr) tui_alloc_content (winInfo->generic.height, (void **) tui_alloc_content (winInfo->generic.height,
execInfoPtr->type); execInfoPtr->type);
if (execInfoPtr->content != (OpaquePtr) NULL) if (execInfoPtr->content != NULL)
{ {
int i; int i;
@ -575,7 +575,7 @@ tui_alloc_source_buffer (struct tui_win_info *winInfo)
{ {
register char *srcLineBuf; register char *srcLineBuf;
register int i, lineWidth, maxLines; register int i, lineWidth, maxLines;
TuiStatus ret = TUI_FAILURE; enum tui_status ret = TUI_FAILURE;
maxLines = winInfo->generic.height; /* less the highlight box */ maxLines = winInfo->generic.height; /* less the highlight box */
lineWidth = winInfo->generic.width - 1; lineWidth = winInfo->generic.width - 1;
@ -584,7 +584,7 @@ tui_alloc_source_buffer (struct tui_win_info *winInfo)
** will be re-used for all source displays. The only other time this will ** will be re-used for all source displays. The only other time this will
** be done is when a window's size changes. ** be done is when a window's size changes.
*/ */
if (winInfo->generic.content == (OpaquePtr) NULL) if (winInfo->generic.content == NULL)
{ {
srcLineBuf = (char *) xmalloc ((maxLines * lineWidth) * sizeof (char)); srcLineBuf = (char *) xmalloc ((maxLines * lineWidth) * sizeof (char));
if (srcLineBuf == (char *) NULL) if (srcLineBuf == (char *) NULL)
@ -595,9 +595,9 @@ tui_alloc_source_buffer (struct tui_win_info *winInfo)
{ {
/* allocate the content list */ /* allocate the content list */
if ((winInfo->generic.content = if ((winInfo->generic.content =
(OpaquePtr) tui_alloc_content (maxLines, SRC_WIN)) == (OpaquePtr) NULL) (void **) tui_alloc_content (maxLines, SRC_WIN)) == NULL)
{ {
tuiFree (srcLineBuf); xfree (srcLineBuf);
srcLineBuf = (char *) NULL; srcLineBuf = (char *) NULL;
fputs_unfiltered ( fputs_unfiltered (
"Unable to Allocate Memory for Source or Disassembly Display.\n", "Unable to Allocate Memory for Source or Disassembly Display.\n",

View file

@ -456,17 +456,6 @@ tui_disable (void)
tui_update_gdb_sizes (); tui_update_gdb_sizes ();
} }
/* Wrapper on top of free() to ensure that input address
is greater than 0x0. */
void
tuiFree (char *ptr)
{
if (ptr != (char *) NULL)
{
xfree (ptr);
}
}
void void
strcat_to_buf (char *buf, int buflen, const char *itemToAdd) strcat_to_buf (char *buf, int buflen, const char *itemToAdd)
{ {
@ -577,7 +566,7 @@ tui_show_assembly (CORE_ADDR addr)
} }
int int
tui_is_window_visible (TuiWinType type) tui_is_window_visible (enum tui_win_type type)
{ {
if (tui_active == 0) if (tui_active == 0)
return 0; return 0;

View file

@ -38,63 +38,44 @@
struct ui_file; struct ui_file;
/* Opaque data type */
typedef char *Opaque;
typedef
Opaque (*OpaqueFuncPtr) (va_list);
typedef char **OpaqueList;
typedef OpaqueList OpaquePtr;
/* Generic function pointer */
typedef void (*TuiVoidFuncPtr) (va_list);
typedef int (*TuiIntFuncPtr) (va_list);
/*
typedef Opaque (*TuiOpaqueFuncPtr) (va_list);
*/
typedef OpaqueFuncPtr TuiOpaqueFuncPtr;
extern void strcat_to_buf (char *, int, const char *); extern void strcat_to_buf (char *, int, const char *);
/* Types of error returns */ /* Types of error returns. */
typedef enum tui_status enum tui_status
{ {
TUI_SUCCESS, TUI_SUCCESS,
TUI_FAILURE TUI_FAILURE
} };
TuiStatus, *TuiStatusPtr;
/* Types of windows */ /* Types of windows */
typedef enum tui_win_type enum tui_win_type
{ {
SRC_WIN = 0, SRC_WIN = 0,
DISASSEM_WIN, DISASSEM_WIN,
DATA_WIN, DATA_WIN,
CMD_WIN, CMD_WIN,
/* This must ALWAYS be AFTER the major windows last */ /* This must ALWAYS be AFTER the major windows last. */
MAX_MAJOR_WINDOWS, MAX_MAJOR_WINDOWS,
/* auxillary windows */ /* Auxillary windows. */
LOCATOR_WIN, LOCATOR_WIN,
EXEC_INFO_WIN, EXEC_INFO_WIN,
DATA_ITEM_WIN, DATA_ITEM_WIN,
/* This must ALWAYS be next to last */ /* This must ALWAYS be next to last. */
MAX_WINDOWS, MAX_WINDOWS,
UNDEFINED_WIN /* LAST */ UNDEFINED_WIN /* LAST */
} };
TuiWinType, *TuiWinTypePtr;
/* This is a point definition */ /* This is a point definition. */
typedef struct _TuiPoint struct tui_point
{ {
int x, y; int x, y;
} };
TuiPoint, *TuiPointPtr;
/* GENERAL TUI FUNCTIONS */ /* GENERAL TUI FUNCTIONS */
/* tui.c */ /* tui.c */
extern void tuiFree (char *); extern CORE_ADDR tui_get_low_disassembly_address (CORE_ADDR, CORE_ADDR);
extern CORE_ADDR tuiGetLowDisassemblyAddress (CORE_ADDR, CORE_ADDR);
extern void tui_show_assembly (CORE_ADDR addr); extern void tui_show_assembly (CORE_ADDR addr);
extern int tui_is_window_visible (TuiWinType type); extern int tui_is_window_visible (enum tui_win_type type);
extern int tui_get_command_dimension (int *width, int *height); extern int tui_get_command_dimension (int *width, int *height);
/* Initialize readline and configure the keymap for the switching /* Initialize readline and configure the keymap for the switching
@ -137,10 +118,10 @@ extern void tui_show_source (const char *file, int line);
extern struct ui_out *tui_out_new (struct ui_file *stream); extern struct ui_out *tui_out_new (struct ui_file *stream);
/* tuiLayout.c */ /* tui-layout.c */
extern enum tui_status tui_set_layout_for_display_command (const char *name); extern enum tui_status tui_set_layout_for_display_command (const char *name);
/* tuiSourceWin.c */ /* tui-winsource.c */
extern void tuiUpdateAllExecInfos (void); extern void tui_update_all_exec_infos (void);
#endif /* TUI_H */ #endif /* TUI_H */