Change the last -Wall cleanup so that the tputs declaration doesn't

conflict with the other declarations in other files.  tputs() is
traditionally declared to return int, not void.  curses.h has it as int.
ncurses has int and actually sets the return value.  This problem has
been causing the ircII port to not compile.

(I've only minimally tested this, I do not have libtermcap on my systems)
This commit is contained in:
Peter Wemm 1996-09-10 12:42:10 +00:00
parent 29dde1ef71
commit 2fdc74a617
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=18209
2 changed files with 7 additions and 6 deletions

View File

@ -24,7 +24,7 @@
* SUCH DAMAGE.
*/
/* $Id: termcap.h,v 1.6 1995/08/05 21:21:54 ache Exp $ */
/* $Id: termcap.h,v 1.7 1996/07/12 18:57:26 jkh Exp $ */
#ifndef _TERMCAP_H_
#define _TERMCAP_H_
@ -41,7 +41,7 @@ extern int tgetflag __P((const char *));
extern int tgetnum __P((const char *));
extern char *tgetstr __P((const char *, char **));
extern void tputs __P((const char *, int, int (*)(int)));
extern int tputs __P((const char *, int, int (*)(int)));
extern char *tgoto __P((const char *, int, int));
extern char *tparm __P((const char *, ...));

View File

@ -57,14 +57,14 @@ char PC;
* The number of affected lines is affcnt, and the routine
* used to output one character is outc.
*/
void
int
tputs(const char *cp, int affcnt, int (*outc)(int))
{
register int i = 0;
register int mspc10;
if (cp == 0)
return;
return 0;
/*
* Convert the number representing the delay.
@ -104,9 +104,9 @@ tputs(const char *cp, int affcnt, int (*outc)(int))
* not comprehensible, then don't try to delay.
*/
if (i == 0)
return;
return 0;
if (ospeed <= 0 || ospeed >= (sizeof tmspc10 / sizeof tmspc10[0]))
return;
return 0;
/*
* Round up by a half a character frame,
@ -119,4 +119,5 @@ tputs(const char *cp, int affcnt, int (*outc)(int))
i += mspc10 / 2;
for (i /= mspc10; i > 0; i--)
(*outc)(PC);
return 0;
}