From jc@irbs.com  Sun May 26 16:25:59 1996
Received: from irbs.irbs.com ([199.182.75.129])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id QAA08117
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 26 May 1996 16:25:55 -0700 (PDT)
Received: (from jc@localhost) by irbs.irbs.com (8.7.5/8.6.6) id TAA13941; Sun, 26 May 1996 19:25:23 -0400 (EDT)
Message-Id: <199605262325.TAA13941@irbs.irbs.com>
Date: Sun, 26 May 1996 19:25:23 -0400 (EDT)
From: John Capo <jc@irbs.com>
Reply-To: jc@irbs.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: Silence gcc whining about tputs() in libedit/term.c
X-Send-Pr-Version: 3.2

>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:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 26 16:30:01 PDT 1996
>Closed-Date:    Sat Jun 1 06:03:31 PDT 1996
>Last-Modified:  Sat Jun  1 06:08:37 PDT 1996
>Originator:     John Capo
>Release:        FreeBSD 2.1-STABLE i386
>Organization:
>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;
>Release-Note:
>Audit-Trail:

From: J Wunsch <j@uriah.heep.sax.de>
To: jc@irbs.com
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/1255: Silence gcc whining about tputs() in libedit/term.c
Date: Mon, 27 May 1996 17:49:06 +0200 (MET DST)

 As John Capo wrote:
 > 
 > >Number:         1255
 > >Category:       bin
 > >Synopsis:       Silence gcc whining about tputs() in libedit/term.c
 
 Hmm.  I wondered why the patch doesn't make sense for -current, but it
 got immediately obvious: the correct fix is to kill the private
 termcap.h in -stable.  The prototypes there are conflicting with the
 public termcap.h.
 
 -- 
 cheers, J"org
 
 joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
 Never trust an operating system you don't have sources for. ;-)
State-Changed-From-To: open->closed 
State-Changed-By: bde 
State-Changed-When: Sat Jun 1 06:03:31 PDT 1996 
State-Changed-Why:  
Fixed on 1996/05/27 by removing the stale copy of termcap.h. 
>Unformatted:
