From: Stephane Carrez Date: Fri, 20 Jul 2001 22:22:08 +0000 (+0000) Subject: * tuiWin.c (tuiStrDup): Remove, replaced by xstrdup. X-Git-Tag: gdb_5_1-2001-07-29-branchpoint~101 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1854bb21902472ab7df44ef2eb095bde62f7208e;p=platform%2Fupstream%2Fbinutils.git * tuiWin.c (tuiStrDup): Remove, replaced by xstrdup. (_parseScrollingArgs): Use xstrdup. (_tuiScrollForward_command): Call tui_enable() to force TUI mode. (_tuiScrollBackward_command): Likewise. (_tuiScrollLeft_command): Likewise. (_tuiScrollRight_command): Likewise. (_tuiSetFocus): Likewise. (_tuiSetFocus_command): Likewise. (_tuiRefreshAll_command): Likewise. (_tuiSetTabWidth_command): Likewise. (_tuiSetWinHeight): Likewise. (_tuiSetWinHeight_command): Likewise. (_tuiXDBsetWinHeight): Likewise. (_tui_vSetFocus): Remove. (_tui_vSetWinHeight): Remove. (_tui_vXDBsetWinHeight): Remove. --- diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog index 0a3d359..b8f1564 100644 --- a/gdb/tui/ChangeLog +++ b/gdb/tui/ChangeLog @@ -1,3 +1,22 @@ +2001-07-20 Stephane Carrez + + * tuiWin.c (tuiStrDup): Remove, replaced by xstrdup. + (_parseScrollingArgs): Use xstrdup. + (_tuiScrollForward_command): Call tui_enable() to force TUI mode. + (_tuiScrollBackward_command): Likewise. + (_tuiScrollLeft_command): Likewise. + (_tuiScrollRight_command): Likewise. + (_tuiSetFocus): Likewise. + (_tuiSetFocus_command): Likewise. + (_tuiRefreshAll_command): Likewise. + (_tuiSetTabWidth_command): Likewise. + (_tuiSetWinHeight): Likewise. + (_tuiSetWinHeight_command): Likewise. + (_tuiXDBsetWinHeight): Likewise. + (_tui_vSetFocus): Remove. + (_tui_vSetWinHeight): Remove. + (_tui_vXDBsetWinHeight): Remove. + 2001-07-21 Stephane Carrez * tuiCommand.h: Remove unused declarations. diff --git a/gdb/tui/tuiWin.c b/gdb/tui/tuiWin.c index ef16704..a0b9bb5 100644 --- a/gdb/tui/tuiWin.c +++ b/gdb/tui/tuiWin.c @@ -189,21 +189,6 @@ tuiSetWinFocusTo (TuiWinInfoPtr winInfo) } /* tuiSetWinFocusTo */ -char * -tuiStrDup (char *str) -{ - char *newStr = (char *) NULL; - - if (str != (char *) NULL) - { - newStr = (char *) xmalloc (strlen (str) + 1); - strcpy (newStr, str); - } - - return newStr; -} /* tuiStrDup */ - - /* ** tuiScrollForward(). */ @@ -578,6 +563,8 @@ _tuiScrollForward_command (char *arg, int fromTTY) int numToScroll = 1; TuiWinInfoPtr winToScroll; + /* Make sure the curses mode is enabled. */ + tui_enable (); if (arg == (char *) NULL) _parseScrollingArgs (arg, &winToScroll, (int *) NULL); else @@ -595,6 +582,8 @@ _tuiScrollBackward_command (char *arg, int fromTTY) int numToScroll = 1; TuiWinInfoPtr winToScroll; + /* Make sure the curses mode is enabled. */ + tui_enable (); if (arg == (char *) NULL) _parseScrollingArgs (arg, &winToScroll, (int *) NULL); else @@ -612,6 +601,8 @@ _tuiScrollLeft_command (char *arg, int fromTTY) int numToScroll; TuiWinInfoPtr winToScroll; + /* Make sure the curses mode is enabled. */ + tui_enable (); _parseScrollingArgs (arg, &winToScroll, &numToScroll); tui_scroll (LEFT_SCROLL, winToScroll, numToScroll); } @@ -626,6 +617,8 @@ _tuiScrollRight_command (char *arg, int fromTTY) int numToScroll; TuiWinInfoPtr winToScroll; + /* Make sure the curses mode is enabled. */ + tui_enable (); _parseScrollingArgs (arg, &winToScroll, &numToScroll); tui_scroll (RIGHT_SCROLL, winToScroll, numToScroll); } @@ -640,7 +633,7 @@ _tuiSetFocus (char *arg, int fromTTY) { if (arg != (char *) NULL) { - char *bufPtr = (char *) tuiStrDup (arg); + char *bufPtr = (char *) xstrdup (arg); int i; TuiWinInfoPtr winInfo = (TuiWinInfoPtr) NULL; @@ -675,28 +668,14 @@ The window name specified must be valid and visible.\n"); return; } /* _tuiSetFocus */ - -/* - ** _tui_vSetFocus() - */ -static void -_tui_vSetFocus (va_list args) -{ - char *arg = va_arg (args, char *); - int fromTTY = va_arg (args, int); - - _tuiSetFocus (arg, fromTTY); - - return; -} /* tui_vSetFocus */ - - /* ** _tuiSetFocus_command() */ static void _tuiSetFocus_command (char *arg, int fromTTY) { + /* Make sure the curses mode is enabled. */ + tui_enable (); _tuiSetFocus (arg, fromTTY); } @@ -733,6 +712,9 @@ _tuiAllWindowsInfo (char *arg, int fromTTY) static void _tuiRefreshAll_command (char *arg, int fromTTY) { + /* Make sure the curses mode is enabled. */ + tui_enable (); + tuiRefreshAll (); } @@ -744,6 +726,8 @@ _tuiRefreshAll_command (char *arg, int fromTTY) static void _tuiSetTabWidth_command (char *arg, int fromTTY) { + /* Make sure the curses mode is enabled. */ + tui_enable (); if (arg != (char *) NULL) { int ts; @@ -766,9 +750,11 @@ _tuiSetTabWidth_command (char *arg, int fromTTY) static void _tuiSetWinHeight (char *arg, int fromTTY) { + /* Make sure the curses mode is enabled. */ + tui_enable (); if (arg != (char *) NULL) { - char *buf = tuiStrDup (arg); + char *buf = xstrdup (arg); char *bufPtr = buf; char *wname = (char *) NULL; int newHeight, i; @@ -847,23 +833,6 @@ The window name specified must be valid and visible.\n"); return; } /* _tuiSetWinHeight */ - -/* - ** _tui_vSetWinHeight(). - ** Set the height of the specified window, with va_list. - */ -static void -_tui_vSetWinHeight (va_list args) -{ - char *arg = va_arg (args, char *); - int fromTTY = va_arg (args, int); - - _tuiSetWinHeight (arg, fromTTY); - - return; -} /* _tui_vSetWinHeight */ - - /* ** _tuiSetWinHeight_command(). ** Set the height of the specified window, with va_list. @@ -871,6 +840,8 @@ _tui_vSetWinHeight (va_list args) static void _tuiSetWinHeight_command (char *arg, int fromTTY) { + /* Make sure the curses mode is enabled. */ + tui_enable (); _tuiSetWinHeight (arg, fromTTY); } @@ -883,6 +854,8 @@ _tuiSetWinHeight_command (char *arg, int fromTTY) static void _tuiXDBsetWinHeight (char *arg, int fromTTY) { + /* Make sure the curses mode is enabled. */ + tui_enable (); if (arg != (char *) NULL) { int inputNo = atoi (arg); @@ -907,23 +880,6 @@ _tuiXDBsetWinHeight (char *arg, int fromTTY) return; } /* _tuiXDBsetWinHeight */ - -/* - ** _tui_vXDBsetWinHeight(). - ** Set the height of the specified window, with va_list. - */ -static void -_tui_vXDBsetWinHeight (va_list args) -{ - char *arg = va_arg (args, char *); - int fromTTY = va_arg (args, int); - - _tuiXDBsetWinHeight (arg, fromTTY); - - return; -} /* _tui_vXDBsetWinHeight */ - - /* ** _tuiSetWinHeight_command(). ** Set the height of the specified window, with va_list. @@ -1363,7 +1319,7 @@ _parseScrollingArgs (char *arg, TuiWinInfoPtr * winToScroll, int *numToScroll) char *buf, *bufPtr; /* process the number of lines to scroll */ - buf = bufPtr = tuiStrDup (arg); + buf = bufPtr = xstrdup (arg); if (isdigit (*bufPtr)) { char *numStr;