Date: Sun, 26 May 1996 19:25:23 -0400 (EDT) From: John Capo <jc@irbs.com> To: FreeBSD-gnats-submit@freebsd.org Subject: bin/1255: Silence gcc whining about tputs() in libedit/term.c Message-ID: <199605262325.TAA13941@irbs.irbs.com> Resent-Message-ID: <199605262330.QAA09250@freefall.freebsd.org>
index | next in thread | raw e-mail
>Number: 1255
>Category: bin
>Synopsis: Silence gcc whining about tputs() in libedit/term.c
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun May 26 16:30:01 PDT 1996
>Last-Modified:
>Originator: John Capo
>Organization:
>Release: FreeBSD 2.1-STABLE i386
>Environment:
>Description:
>How-To-Repeat:
>Fix:
*** /usr/stable/src/lib/libedit/term.c Sun May 5 00:36:45 1996
--- lib/libedit/term.c Sun May 26 19:10:49 1996
***************
*** 427,433 ****
if ((del = where - el->el_cursor.v) > 0) {
if ((del > 1) && GoodStr(T_DO))
! (void) tputs(tgoto(Str(T_DO), del, del), del, term__putc);
else {
for (i = 0; i < del; i++)
term__putc('\n');
--- 427,433 ----
if ((del = where - el->el_cursor.v) > 0) {
if ((del > 1) && GoodStr(T_DO))
! (void) tputs(tgoto(Str(T_DO), del, del), del, (void(*)(int))term__putc);
else {
for (i = 0; i < del; i++)
term__putc('\n');
***************
*** 436,446 ****
}
else { /* del < 0 */
if (GoodStr(T_UP) && (-del > 1 || !GoodStr(T_up)))
! (void) tputs(tgoto(Str(T_UP), -del, -del), -del, term__putc);
else {
if (GoodStr(T_up))
for (i = 0; i < -del; i++)
! (void) tputs(Str(T_up), 1, term__putc);
}
}
el->el_cursor.v = where; /* now where is here */
--- 436,446 ----
}
else { /* del < 0 */
if (GoodStr(T_UP) && (-del > 1 || !GoodStr(T_up)))
! (void) tputs(tgoto(Str(T_UP), -del, -del), -del, (void(*)(int))term__putc);
else {
if (GoodStr(T_up))
for (i = 0; i < -del; i++)
! (void) tputs(Str(T_up), 1, (void(*)(int))term__putc);
}
}
el->el_cursor.v = where; /* now where is here */
***************
*** 479,489 ****
if ((del < -4 || del > 4) && GoodStr(T_ch))
/* go there directly */
! (void) tputs(tgoto(Str(T_ch), where, where), where, term__putc);
else {
if (del > 0) { /* moving forward */
if ((del > 4) && GoodStr(T_RI))
! (void) tputs(tgoto(Str(T_RI), del, del), del, term__putc);
else {
if (EL_CAN_TAB) { /* if I can do tabs, use them */
if ((el->el_cursor.h & 0370) != (where & 0370)) {
--- 479,489 ----
if ((del < -4 || del > 4) && GoodStr(T_ch))
/* go there directly */
! (void) tputs(tgoto(Str(T_ch), where, where), where, (void(*)(int))term__putc);
else {
if (del > 0) { /* moving forward */
if ((del > 4) && GoodStr(T_RI))
! (void) tputs(tgoto(Str(T_RI), del, del), del, (void(*)(int))term__putc);
else {
if (EL_CAN_TAB) { /* if I can do tabs, use them */
if ((el->el_cursor.h & 0370) != (where & 0370)) {
***************
*** 505,511 ****
}
else { /* del < 0 := moving backward */
if ((-del > 4) && GoodStr(T_LE))
! (void) tputs(tgoto(Str(T_LE), -del, -del), -del, term__putc);
else { /* can't go directly there */
/* if the "cost" is greater than the "cost" from col 0 */
if (EL_CAN_TAB ? (-del > ((where >> 3) + (where & 07)))
--- 505,511 ----
}
else { /* del < 0 := moving backward */
if ((-del > 4) && GoodStr(T_LE))
! (void) tputs(tgoto(Str(T_LE), -del, -del), -del, (void(*)(int))term__putc);
else { /* can't go directly there */
/* if the "cost" is greater than the "cost" from col 0 */
if (EL_CAN_TAB ? (-del > ((where >> 3) + (where & 07)))
***************
*** 577,595 ****
if (GoodStr(T_DC)) /* if I have multiple delete */
if ((num > 1) || !GoodStr(T_dc)) { /* if dc would be more expen. */
! (void) tputs(tgoto(Str(T_DC), num, num), num, term__putc);
return;
}
if (GoodStr(T_dm)) /* if I have delete mode */
! (void) tputs(Str(T_dm), 1, term__putc);
if (GoodStr(T_dc)) /* else do one at a time */
while (num--)
! (void) tputs(Str(T_dc), 1, term__putc);
if (GoodStr(T_ed)) /* if I have delete mode */
! (void) tputs(Str(T_ed), 1, term__putc);
} /* end term_deletechars */
--- 577,595 ----
if (GoodStr(T_DC)) /* if I have multiple delete */
if ((num > 1) || !GoodStr(T_dc)) { /* if dc would be more expen. */
! (void) tputs(tgoto(Str(T_DC), num, num), num, (void(*)(int))term__putc);
return;
}
if (GoodStr(T_dm)) /* if I have delete mode */
! (void) tputs(Str(T_dm), 1, (void(*)(int))term__putc);
if (GoodStr(T_dc)) /* else do one at a time */
while (num--)
! (void) tputs(Str(T_dc), 1, (void(*)(int))term__putc);
if (GoodStr(T_ed)) /* if I have delete mode */
! (void) tputs(Str(T_ed), 1, (void(*)(int))term__putc);
} /* end term_deletechars */
***************
*** 621,633 ****
if (GoodStr(T_IC)) /* if I have multiple insert */
if ((num > 1) || !GoodStr(T_ic)) { /* if ic would be more expen. */
! (void) tputs(tgoto(Str(T_IC), num, num), num, term__putc);
term_overwrite(el, cp, num); /* this updates el_cursor.h */
return;
}
if (GoodStr(T_im) && GoodStr(T_ei)) { /* if I have insert mode */
! (void) tputs(Str(T_im), 1, term__putc);
el->el_cursor.h += num;
do
--- 621,633 ----
if (GoodStr(T_IC)) /* if I have multiple insert */
if ((num > 1) || !GoodStr(T_ic)) { /* if ic would be more expen. */
! (void) tputs(tgoto(Str(T_IC), num, num), num, (void(*)(int))term__putc);
term_overwrite(el, cp, num); /* this updates el_cursor.h */
return;
}
if (GoodStr(T_im) && GoodStr(T_ei)) { /* if I have insert mode */
! (void) tputs(Str(T_im), 1, (void(*)(int))term__putc);
el->el_cursor.h += num;
do
***************
*** 635,656 ****
while (--num);
if (GoodStr(T_ip)) /* have to make num chars insert */
! (void) tputs(Str(T_ip), 1, term__putc);
! (void) tputs(Str(T_ei), 1, term__putc);
return;
}
do {
if (GoodStr(T_ic)) /* have to make num chars insert */
! (void) tputs(Str(T_ic), 1, term__putc); /* insert a char */
term__putc(*cp++);
el->el_cursor.h++;
if (GoodStr(T_ip)) /* have to make num chars insert */
! (void) tputs(Str(T_ip), 1, term__putc);/* pad the inserted char */
} while (--num);
} /* end term_insertwrite */
--- 635,656 ----
while (--num);
if (GoodStr(T_ip)) /* have to make num chars insert */
! (void) tputs(Str(T_ip), 1, (void(*)(int))term__putc);
! (void) tputs(Str(T_ei), 1, (void(*)(int))term__putc);
return;
}
do {
if (GoodStr(T_ic)) /* have to make num chars insert */
! (void) tputs(Str(T_ic), 1, (void(*)(int))term__putc); /* insert a char */
term__putc(*cp++);
el->el_cursor.h++;
if (GoodStr(T_ip)) /* have to make num chars insert */
! (void) tputs(Str(T_ip), 1, (void(*)(int))term__putc);/* pad the inserted char */
} while (--num);
} /* end term_insertwrite */
***************
*** 667,673 ****
int i;
if (EL_CAN_CEOL && GoodStr(T_ce))
! (void) tputs(Str(T_ce), 1, term__putc);
else {
for (i = 0; i < num; i++)
term__putc(' ');
--- 667,673 ----
int i;
if (EL_CAN_CEOL && GoodStr(T_ce))
! (void) tputs(Str(T_ce), 1, (void(*)(int))term__putc);
else {
for (i = 0; i < num; i++)
term__putc(' ');
***************
*** 685,695 ****
{ /* clear the whole screen and home */
if (GoodStr(T_cl))
/* send the clear screen code */
! (void) tputs(Str(T_cl), Val(T_li), term__putc);
else if (GoodStr(T_ho) && GoodStr(T_cd)) {
! (void) tputs(Str(T_ho), Val(T_li), term__putc); /* home */
/* clear to bottom of screen */
! (void) tputs(Str(T_cd), Val(T_li), term__putc);
}
else {
term__putc('\r');
--- 685,695 ----
{ /* clear the whole screen and home */
if (GoodStr(T_cl))
/* send the clear screen code */
! (void) tputs(Str(T_cl), Val(T_li), (void(*)(int))term__putc);
else if (GoodStr(T_ho) && GoodStr(T_cd)) {
! (void) tputs(Str(T_ho), Val(T_li), (void(*)(int))term__putc); /* home */
/* clear to bottom of screen */
! (void) tputs(Str(T_cd), Val(T_li), (void(*)(int))term__putc);
}
else {
term__putc('\r');
***************
*** 706,715 ****
EditLine *el;
{
if (GoodStr(T_vb))
! (void) tputs(Str(T_vb), 1, term__putc); /* visible bell */
else if (GoodStr(T_bl))
/* what termcap says we should use */
! (void) tputs(Str(T_bl), 1, term__putc);
else
term__putc('\007'); /* an ASCII bell; ^G */
} /* end term_beep */
--- 706,715 ----
EditLine *el;
{
if (GoodStr(T_vb))
! (void) tputs(Str(T_vb), 1, (void(*)(int))term__putc); /* visible bell */
else if (GoodStr(T_bl))
/* what termcap says we should use */
! (void) tputs(Str(T_bl), 1, (void(*)(int))term__putc);
else
term__putc('\007'); /* an ASCII bell; ^G */
} /* end term_beep */
***************
*** 724,732 ****
EditLine *el;
{
if (GoodStr(T_cd))
! (void) tputs(Str(T_cd), Val(T_li), term__putc);
else if (GoodStr(T_ce))
! (void) tputs(Str(T_ce), Val(T_li), term__putc);
} /* end term_clear_to_bottom */
#endif
--- 724,732 ----
EditLine *el;
{
if (GoodStr(T_cd))
! (void) tputs(Str(T_cd), Val(T_li), (void(*)(int))term__putc);
else if (GoodStr(T_ce))
! (void) tputs(Str(T_ce), Val(T_li), (void(*)(int))term__putc);
} /* end term_clear_to_bottom */
#endif
***************
*** 1316,1322 ****
"echotc: Warning: Extra argument `%s'.\n", *argv);
return -1;
}
! (void) tputs(scap, 1, term__putc);
break;
case 1:
argv++;
--- 1316,1322 ----
"echotc: Warning: Extra argument `%s'.\n", *argv);
return -1;
}
! (void) tputs(scap, 1, (void(*)(int))term__putc);
break;
case 1:
argv++;
***************
*** 1335,1341 ****
"echotc: Warning: Extra argument `%s'.\n", *argv);
return -1;
}
! (void) tputs(tgoto(scap, arg_cols, arg_rows), 1, term__putc);
break;
default:
/* This is wrong, but I will ignore it... */
--- 1335,1341 ----
"echotc: Warning: Extra argument `%s'.\n", *argv);
return -1;
}
! (void) tputs(tgoto(scap, arg_cols, arg_rows), 1, (void(*)(int))term__putc);
break;
default:
/* This is wrong, but I will ignore it... */
***************
*** 1368,1374 ****
"echotc: Warning: Extra argument `%s'.\n", *argv);
return -1;
}
! (void) tputs(tgoto(scap, arg_cols, arg_rows), arg_rows, term__putc);
break;
}
return 0;
--- 1368,1374 ----
"echotc: Warning: Extra argument `%s'.\n", *argv);
return -1;
}
! (void) tputs(tgoto(scap, arg_cols, arg_rows), arg_rows, (void(*)(int))term__putc);
break;
}
return 0;
>Audit-Trail:
>Unformatted:
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605262325.TAA13941>
