WARNS=2 fixes with NO_WERROR set because of system-header originating

warnings. Use __FBSDID().
This commit is contained in:
Mark Murray 2001-12-11 23:51:14 +00:00
parent ed155aba4a
commit caa648017b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=87710
14 changed files with 122 additions and 107 deletions

View File

@ -2,10 +2,10 @@
# $FreeBSD$
PROG= talk
DPADD= ${LIBCURSES}
LDADD= -lcurses
CFLAGS+= -Wall -Wstrict-prototypes -Wno-unused
SRCS= ctl.c ctl_transact.c display.c get_addrs.c get_iface.c get_names.c \
init_disp.c invite.c io.c look_up.c msgs.c talk.c
NO_WERROR=yes
DPADD= ${LIBCURSES}
LDADD= -lcurses
.include <bsd.prog.mk>

View File

@ -31,13 +31,13 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef lint
#if 0
static char sccsid[] = "@(#)ctl.c 8.1 (Berkeley) 6/6/93";
static const char sccsid[] = "@(#)ctl.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
/*
* This file handles haggling with the various talk daemons to

View File

@ -31,16 +31,17 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef lint
#if 0
static char sccsid[] = "@(#)ctl_transact.c 8.1 (Berkeley) 6/6/93";
static const char sccsid[] = "@(#)ctl_transact.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <errno.h>
#include <string.h>
#include "talk.h"
#include "talk_ctl.h"
@ -52,9 +53,9 @@ static const char rcsid[] =
* of time
*/
void
ctl_transact(target, msg, type, rp)
ctl_transact(target, lmsg, type, rp)
struct in_addr target;
CTL_MSG msg;
CTL_MSG lmsg;
int type;
CTL_RESPONSE *rp;
{
@ -62,7 +63,7 @@ ctl_transact(target, msg, type, rp)
int nready = 0, cc;
struct timeval wait;
msg.type = type;
lmsg.type = type;
daemon_addr.sin_addr = target;
daemon_addr.sin_port = daemon_port;
FD_ZERO(&ctl_mask);
@ -77,10 +78,10 @@ ctl_transact(target, msg, type, rp)
wait.tv_usec = 0;
/* resend message until a response is obtained */
do {
cc = sendto(ctl_sockt, (char *)&msg, sizeof (msg), 0,
cc = sendto(ctl_sockt, (char *)&lmsg, sizeof (lmsg), 0,
(struct sockaddr *)&daemon_addr,
sizeof (daemon_addr));
if (cc != sizeof (msg)) {
if (cc != sizeof (lmsg)) {
if (errno == EINTR)
continue;
p_error("Error on write to talk daemon");

View File

@ -31,21 +31,22 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef lint
#if 0
static char sccsid[] = "@(#)display.c 8.1 (Berkeley) 6/6/93";
static const char sccsid[] = "@(#)display.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
/*
* The window 'manager', initializes curses and handles the actual
* displaying of text
*/
#include "talk.h"
#include <ctype.h>
#include "talk.h"
xwin_t my_win;
xwin_t his_win;
WINDOW *line_win;
@ -70,11 +71,11 @@ max(a,b)
*/
void
display(win, text, size)
register xwin_t *win;
register char *text;
xwin_t *win;
char *text;
int size;
{
register int i;
int i;
char cch;
for (i = 0; i < size; i++) {
@ -105,7 +106,7 @@ display(win, text, size)
if ( *text == win->werase
|| *text == 027 /* ^W */
) {
int endcol, xcol, i, c;
int endcol, xcol, ii, c;
endcol = win->x_col;
xcol = endcol - 1;
@ -122,7 +123,7 @@ display(win, text, size)
xcol--;
}
wmove(win->x_win, win->x_line, xcol + 1);
for (i = xcol + 1; i < endcol; i++)
for (ii = xcol + 1; ii < endcol; ii++)
waddch(win->x_win, ' ');
wmove(win->x_win, win->x_line, xcol + 1);
getyx(win->x_win, win->x_line, win->x_col);
@ -173,7 +174,7 @@ readwin(win, line, col)
int col;
{
int oldline, oldcol;
register int c;
int c;
getyx(win, oldline, oldcol);
wmove(win, line, col);

View File

@ -31,23 +31,24 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef lint
#if 0
static char sccsid[] = "@(#)get_addrs.c 8.1 (Berkeley) 6/6/93";
static const char sccsid[] = "@(#)get_addrs.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <err.h>
#include <netdb.h>
#include <string.h>
#include "talk.h"
#include "talk_ctl.h"
void
get_addrs(my_machine_name, his_machine_name)
char *my_machine_name, *his_machine_name;
char *my_machine_name __unused, *his_machine_name;
{
struct hostent *hp;
struct servent *sp;

View File

@ -25,18 +25,20 @@
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* From:
* Id: find_interface.c,v 1.1 1995/08/14 16:08:39 wollman Exp
*/
#ifndef lint
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <errno.h>
#include <string.h>
#include "talk.h"
/*
@ -51,7 +53,6 @@ get_iface(dst, iface)
{
static struct sockaddr_in local;
struct sockaddr_in remote;
struct hostent *hp;
int s, rv, namelen;
memcpy(&remote.sin_addr, dst, sizeof remote.sin_addr);

View File

@ -31,19 +31,21 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef lint
#if 0
static char sccsid[] = "@(#)get_names.c 8.1 (Berkeley) 6/6/93";
static const char sccsid[] = "@(#)get_names.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/param.h>
#include <err.h>
#include <pwd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/param.h>
#include "talk.h"
extern CTL_MSG msg;
@ -66,8 +68,8 @@ get_names(argc, argv)
char hostname[MAXHOSTNAMELEN];
char *his_name, *my_name;
char *my_machine_name, *his_machine_name;
char *my_tty, *his_tty;
register char *cp;
const char *his_tty;
char *cp;
if (argc < 2 )
usage();

View File

@ -31,25 +31,27 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef lint
#if 0
static char sccsid[] = "@(#)init_disp.c 8.2 (Berkeley) 2/16/94";
static const char sccsid[] = "@(#)init_disp.c 8.2 (Berkeley) 2/16/94";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
/*
* Initialization code for the display package,
* as well as the signal handling routines.
*/
#include <sys/stat.h>
#include <err.h>
#include <signal.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
#include <termios.h>
#include "talk.h"
/*
@ -156,7 +158,7 @@ set_edit_chars()
/* ARGSUSED */
void
sig_sent(signo)
int signo;
int signo __unused;
{
message("Connection closing. Exiting");

View File

@ -31,21 +31,23 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef lint
#if 0
static char sccsid[] = "@(#)invite.c 8.1 (Berkeley) 6/6/93";
static const char sccsid[] = "@(#)invite.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/types.h>
#include <sys/socket.h>
#include <protocols/talkd.h>
#include <err.h>
#include <errno.h>
#include <setjmp.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <protocols/talkd.h>
#include "talk_ctl.h"
#include "talk.h"
@ -67,7 +69,7 @@ jmp_buf invitebuf;
void
invite_remote()
{
int nfd, read_mask, template, new_sockt;
int new_sockt;
struct itimerval itimer;
CTL_RESPONSE response;
@ -123,7 +125,7 @@ invite_remote()
/* ARGSUSED */
void
re_invite(signo)
int signo;
int signo __unused;
{
message("Ringing your party again");
@ -136,7 +138,7 @@ re_invite(signo)
longjmp(invitebuf, 1);
}
static char *answers[] = {
static const char *answers[] = {
"answer #0", /* SUCCESS */
"Your party is not logged on", /* NOT_HERE */
"Target machine is too confused to talk to us", /* FAILED */

View File

@ -31,13 +31,13 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef lint
#if 0
static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 6/6/93";
static const char sccsid[] = "@(#)io.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
/*
* This file contains the I/O handling and the exchange of
@ -45,12 +45,14 @@ static const char rcsid[] =
* ctl.c
*/
#include <sys/filio.h>
#include <errno.h>
#include <netdb.h>
#include <stdlib.h>
#include <string.h>
#include <sys/filio.h>
#include <unistd.h>
#include "talk.h"
#include "talk_ctl.h"
@ -146,7 +148,7 @@ talk()
*/
void
p_error(string)
char *string;
const char *string;
{
wmove(my_win.x_win, current_line, 0);
wprintw(my_win.x_win, "[%s : %s (%d)]\n",
@ -162,7 +164,7 @@ p_error(string)
*/
void
message(string)
char *string;
const char *string;
{
wmove(my_win.x_win, current_line, 0);
wprintw(my_win.x_win, "[%s]\n", string);

View File

@ -31,18 +31,20 @@
* SUCH DAMAGE.
*/
#ifndef lint
#if 0
static char sccsid[] = "@(#)look_up.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef lint
static const char sccsid[] = "@(#)look_up.c 8.1 (Berkeley) 6/6/93";
#endif
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <protocols/talkd.h>
#include <errno.h>
#include "talk_ctl.h"
#include "talk.h"
@ -53,7 +55,7 @@ int
check_local()
{
CTL_RESPONSE response;
register CTL_RESPONSE *rp = &response;
CTL_RESPONSE *rp = &response;
/* the rest of msg was set up in get_names */
#ifdef MSG_EOR
@ -103,8 +105,6 @@ int
look_for_invite(rp)
CTL_RESPONSE *rp;
{
struct in_addr machine_addr;
current_state = "Checking for invitation on caller's machine";
ctl_transact(his_machine_addr, msg, LOOK_UP, rp);
/* the switch is for later options, such as multiple invitations */

View File

@ -31,13 +31,13 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef lint
#if 0
static char sccsid[] = "@(#)msgs.c 8.1 (Berkeley) 6/6/93";
static const char sccsid[] = "@(#)msgs.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
/*
* A package to display what is happening every MSG_INTERVAL seconds
@ -45,17 +45,18 @@ static const char rcsid[] =
*/
#include <signal.h>
#include "talk.h"
#define MSG_INTERVAL 4
char *current_state;
const char *current_state;
int current_line = 0;
/* ARGSUSED */
void
disp_msg(signo)
int signo;
int signo __unused;
{
message(current_state);
}

View File

@ -31,22 +31,23 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef lint
static const char sccsid[] = "@(#)talk.c 8.1 (Berkeley) 6/6/93";
#endif
#ifndef lint
static const char copyright[] =
"@(#) Copyright (c) 1983, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
#if 0
static char sccsid[] = "@(#)talk.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <locale.h>
#include "talk.h"
#include <locale.h>
/*
* talk: A visual form of write. Using sockets, a two way

View File

@ -31,6 +31,7 @@
* SUCH DAMAGE.
*
* @(#)talk.h 8.1 (Berkeley) 6/6/93
* $FreeBSD$
*/
#include <sys/cdefs.h>
@ -47,7 +48,7 @@ extern int sockt;
extern int curses_initialized;
extern int invitation_waiting;
extern char *current_state;
extern const char *current_state;
extern int current_line;
typedef struct xwin {
@ -79,10 +80,10 @@ extern void init_display __P((void));
extern void invite_remote __P((void));
extern int look_for_invite __P((CTL_RESPONSE *));
extern int max __P((int, int));
extern void message __P((char *));
extern void message __P((const char *));
extern void open_ctl __P((void));
extern void open_sockt __P((void));
extern void p_error __P((char *));
extern void p_error __P((const char *));
extern void print_addr __P((struct sockaddr_in));
extern void quit __P((void));
extern int readwin __P((WINDOW *, int, int));