diff options
author | Andrew Cagney <cagney@redhat.com> | 2004-02-07 17:46:14 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2004-02-07 17:46:14 +0000 |
commit | 22940a245df9e2473270137fbfbf1280db4eebcf (patch) | |
tree | f118ef934a6b399ebdd034e191dc5fcbdbd3accc /gdb/tui/tui-data.c | |
parent | b99607ea3cc204c613ef8acf0fce8bdffb7e89e7 (diff) | |
download | gdb-22940a245df9e2473270137fbfbf1280db4eebcf.zip gdb-22940a245df9e2473270137fbfbf1280db4eebcf.tar.gz gdb-22940a245df9e2473270137fbfbf1280db4eebcf.tar.bz2 |
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.
Diffstat (limited to 'gdb/tui/tui-data.c')
-rw-r--r-- | gdb/tui/tui-data.c | 73 |
1 files changed, 35 insertions, 38 deletions
diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c index b962eee..752f4ce 100644 --- a/gdb/tui/tui-data.c +++ b/gdb/tui/tui-data.c @@ -49,8 +49,7 @@ static int _termHeight, _termWidth; static struct tui_gen_win_info _locator; static struct tui_gen_win_info _execInfo[2]; static struct tui_win_info * _srcWinList[2]; -static struct tui_list _sourceWindows = -{(OpaqueList) _srcWinList, 0}; +static struct tui_list _sourceWindows = {(void **) _srcWinList, 0}; static int _defaultTabLen = DEFAULT_TAB_LEN; static struct tui_win_info * _winWithFocus = (struct tui_win_info *) NULL; static struct tui_layout_def _layoutDef = @@ -64,8 +63,8 @@ static int _winResized = FALSE; /********************************* ** Static function forward decls **********************************/ -static void freeContent (tui_win_content, int, TuiWinType); -static void freeContentElements (tui_win_content, int, TuiWinType); +static void freeContent (tui_win_content, int, enum tui_win_type); +static void freeContentElements (tui_win_content, int, enum tui_win_type); @@ -152,8 +151,8 @@ tui_source_windows (void) void tui_clear_source_windows (void) { - _sourceWindows.list[0] = (Opaque) NULL; - _sourceWindows.list[1] = (Opaque) NULL; + _sourceWindows.list[0] = NULL; + _sourceWindows.list[1] = NULL; _sourceWindows.count = 0; } @@ -176,7 +175,7 @@ void tui_add_to_source_windows (struct tui_win_info * winInfo) { 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 * 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; if (curWin->generic.type == CMD_WIN) @@ -350,7 +349,7 @@ tui_next_win (struct tui_win_info * curWin) struct tui_win_info * 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; if (curWin->generic.type == SRC_WIN) @@ -469,7 +468,7 @@ tui_init_generic_part (struct tui_gen_win_info * win) win->contentSize = win->lastVisibleLine = 0; win->handle = (WINDOW *) NULL; - win->content = (OpaquePtr) NULL; + win->content = NULL; win->contentInUse = win->isVisible = FALSE; win->title = 0; @@ -480,7 +479,7 @@ tui_init_generic_part (struct tui_gen_win_info * win) ** initContentElement(). */ void -initContentElement (struct tui_win_element * element, TuiWinType type) +initContentElement (struct tui_win_element * element, enum tui_win_type type) { element->highlight = FALSE; switch (type) @@ -496,7 +495,7 @@ initContentElement (struct tui_win_element * element, TuiWinType type) tui_init_generic_part (&element->whichElement.dataWindow); element->whichElement.dataWindow.type = DATA_ITEM_WIN; ((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 *) & element->whichElement.dataWindow)->contentSize = 1; break; @@ -507,7 +506,7 @@ initContentElement (struct tui_win_element * element, TuiWinType type) element->whichElement.data.name = (char *) NULL; element->whichElement.data.type = TUI_REGISTER; element->whichElement.data.itemNo = UNDEFINED_ITEM; - element->whichElement.data.value = (Opaque) NULL; + element->whichElement.data.value = NULL; element->whichElement.data.highlight = FALSE; break; case LOCATOR_WIN: @@ -560,7 +559,7 @@ initWinInfo (struct tui_win_info * winInfo) winInfo->detail.commandInfo.curch = 0; break; default: - winInfo->detail.opaque = (Opaque) NULL; + winInfo->detail.opaque = NULL; break; } @@ -569,7 +568,7 @@ initWinInfo (struct tui_win_info * winInfo) 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; @@ -589,7 +588,7 @@ tui_alloc_win_info (TuiWinType type) ** Allocates the content and elements in a block. */ 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; char *elementBlockPtr = (char *) NULL; @@ -616,7 +615,7 @@ tui_alloc_content (int numElements, TuiWinType type) } else { - tuiFree ((char *) content); + xfree (content); 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; 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; } else indexStart = winInfo->contentSize; - if (winInfo->content != (OpaquePtr) NULL) + if (winInfo->content != NULL) { for (i = indexStart; (i < numElements + indexStart); i++) { if ((elementPtr = (struct tui_win_element *) 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); winInfo->contentSize++; } @@ -696,7 +695,7 @@ tuiDelWindow (struct tui_win_info * winInfo) } break; case DATA_WIN: - if (winInfo->generic.content != (OpaquePtr) NULL) + if (winInfo->generic.content != NULL) { tui_del_data_windows (winInfo->detail.dataDisplayInfo.regsContent, winInfo->detail.dataDisplayInfo.regsContentCount); @@ -746,7 +745,7 @@ tui_free_window (struct tui_win_info * winInfo) } break; case DATA_WIN: - if (winInfo->generic.content != (OpaquePtr) NULL) + if (winInfo->generic.content != NULL) { tui_free_data_content (winInfo->detail.dataDisplayInfo.regsContent, winInfo->detail.dataDisplayInfo.regsContentCount); @@ -762,7 +761,7 @@ tui_free_window (struct tui_win_info * winInfo) TUI_UNDEFINED_REGS; winInfo->detail.dataDisplayInfo.regsColumnCount = 1; winInfo->detail.dataDisplayInfo.displayRegs = FALSE; - winInfo->generic.content = (OpaquePtr) NULL; + winInfo->generic.content = NULL; winInfo->generic.contentSize = 0; } break; @@ -802,12 +801,12 @@ tui_free_all_source_wins_content (void) void 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, winInfo->contentSize, winInfo->type); - winInfo->content = (OpaquePtr) NULL; + winInfo->content = NULL; } winInfo->contentSize = 0; @@ -875,12 +874,12 @@ tui_free_data_content (tui_win_content content, int contentSize) ** freeContent(). */ 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) { freeContentElements (content, contentSize, winType); - tuiFree ((char *) content); + xfree (content); } return; @@ -891,7 +890,7 @@ freeContent (tui_win_content content, int contentSize, TuiWinType winType) ** freeContentElements(). */ 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) { @@ -900,8 +899,7 @@ freeContentElements (tui_win_content content, int contentSize, TuiWinType type) if (type == SRC_WIN || type == DISASSEM_WIN) { /* free whole source block */ - if (content[0]->whichElement.source.line != (char *) NULL) - tuiFree (content[0]->whichElement.source.line); + xfree (content[0]->whichElement.source.line); } else { @@ -915,7 +913,7 @@ freeContentElements (tui_win_content content, int contentSize, TuiWinType type) switch (type) { case DATA_WIN: - tuiFree ((char *) element); + xfree (element); break; 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. */ if (element->whichElement.data.type != TUI_REGISTER) - tuiFree ((char *) - element->whichElement.data.name); - tuiFree ((char *) element->whichElement.data.value); - tuiFree ((char *) element); + xfree ((void *)element->whichElement.data.name); + xfree (element->whichElement.data.value); + xfree (element); break; case CMD_WIN: - tuiFree ((char *) element->whichElement.command.line); + xfree (element->whichElement.command.line); break; default: break; @@ -938,7 +935,7 @@ freeContentElements (tui_win_content content, int contentSize, TuiWinType type) } } if (type != DATA_WIN && type != DATA_ITEM_WIN) - tuiFree ((char *) content[0]); /* free the element block */ + xfree (content[0]); /* free the element block */ } return; |