diff options
author | markm <markm@FreeBSD.org> | 2001-12-11 23:51:14 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2001-12-11 23:51:14 +0000 |
commit | a82545dcd4cfdc337e6904afa3ab43097134c360 (patch) | |
tree | f29bbbc79d4e1b190fcac1c308cb1862054576e2 | |
parent | 7f940dc06cf848e2e7af8e1dbc9c03d85f37d267 (diff) | |
download | FreeBSD-src-a82545dcd4cfdc337e6904afa3ab43097134c360.zip FreeBSD-src-a82545dcd4cfdc337e6904afa3ab43097134c360.tar.gz |
WARNS=2 fixes with NO_WERROR set because of system-header originating
warnings. Use __FBSDID().
-rw-r--r-- | usr.bin/talk/Makefile | 6 | ||||
-rw-r--r-- | usr.bin/talk/ctl.c | 10 | ||||
-rw-r--r-- | usr.bin/talk/ctl_transact.c | 21 | ||||
-rw-r--r-- | usr.bin/talk/display.c | 25 | ||||
-rw-r--r-- | usr.bin/talk/get_addrs.c | 13 | ||||
-rw-r--r-- | usr.bin/talk/get_iface.c | 15 | ||||
-rw-r--r-- | usr.bin/talk/get_names.c | 18 | ||||
-rw-r--r-- | usr.bin/talk/init_disp.c | 16 | ||||
-rw-r--r-- | usr.bin/talk/invite.c | 24 | ||||
-rw-r--r-- | usr.bin/talk/io.c | 18 | ||||
-rw-r--r-- | usr.bin/talk/look_up.c | 18 | ||||
-rw-r--r-- | usr.bin/talk/msgs.c | 15 | ||||
-rw-r--r-- | usr.bin/talk/talk.c | 19 | ||||
-rw-r--r-- | usr.bin/talk/talk.h | 7 |
14 files changed, 120 insertions, 105 deletions
diff --git a/usr.bin/talk/Makefile b/usr.bin/talk/Makefile index 649bfa0..76f868c 100644 --- a/usr.bin/talk/Makefile +++ b/usr.bin/talk/Makefile @@ -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> diff --git a/usr.bin/talk/ctl.c b/usr.bin/talk/ctl.c index c8094b4..3da8e79 100644 --- a/usr.bin/talk/ctl.c +++ b/usr.bin/talk/ctl.c @@ -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 diff --git a/usr.bin/talk/ctl_transact.c b/usr.bin/talk/ctl_transact.c index fa3ebad..1d68b69 100644 --- a/usr.bin/talk/ctl_transact.c +++ b/usr.bin/talk/ctl_transact.c @@ -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"); diff --git a/usr.bin/talk/display.c b/usr.bin/talk/display.c index 16c7605..7bdf38e 100644 --- a/usr.bin/talk/display.c +++ b/usr.bin/talk/display.c @@ -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); diff --git a/usr.bin/talk/get_addrs.c b/usr.bin/talk/get_addrs.c index 871dc9a..f212a20 100644 --- a/usr.bin/talk/get_addrs.c +++ b/usr.bin/talk/get_addrs.c @@ -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; diff --git a/usr.bin/talk/get_iface.c b/usr.bin/talk/get_iface.c index 05a8368..1191e50 100644 --- a/usr.bin/talk/get_iface.c +++ b/usr.bin/talk/get_iface.c @@ -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); diff --git a/usr.bin/talk/get_names.c b/usr.bin/talk/get_names.c index 7fb341a..f2346ee 100644 --- a/usr.bin/talk/get_names.c +++ b/usr.bin/talk/get_names.c @@ -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(); diff --git a/usr.bin/talk/init_disp.c b/usr.bin/talk/init_disp.c index 850bdf4..547164f 100644 --- a/usr.bin/talk/init_disp.c +++ b/usr.bin/talk/init_disp.c @@ -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"); diff --git a/usr.bin/talk/invite.c b/usr.bin/talk/invite.c index 1fdec29..c783161 100644 --- a/usr.bin/talk/invite.c +++ b/usr.bin/talk/invite.c @@ -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 */ diff --git a/usr.bin/talk/io.c b/usr.bin/talk/io.c index 782314f..bcbfe6f 100644 --- a/usr.bin/talk/io.c +++ b/usr.bin/talk/io.c @@ -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); diff --git a/usr.bin/talk/look_up.c b/usr.bin/talk/look_up.c index 3c6f3ed..d251e1c 100644 --- a/usr.bin/talk/look_up.c +++ b/usr.bin/talk/look_up.c @@ -31,18 +31,20 @@ * SUCH DAMAGE. */ +#include <sys/cdefs.h> + +__FBSDID("$FreeBSD$"); + #ifndef lint -#if 0 -static char sccsid[] = "@(#)look_up.c 8.1 (Berkeley) 6/6/93"; +static const char sccsid[] = "@(#)look_up.c 8.1 (Berkeley) 6/6/93"; #endif -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ -#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 */ diff --git a/usr.bin/talk/msgs.c b/usr.bin/talk/msgs.c index 82c5038..e4a0977 100644 --- a/usr.bin/talk/msgs.c +++ b/usr.bin/talk/msgs.c @@ -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); } diff --git a/usr.bin/talk/talk.c b/usr.bin/talk/talk.c index d71d49a..c59c96c 100644 --- a/usr.bin/talk/talk.c +++ b/usr.bin/talk/talk.c @@ -31,23 +31,24 @@ * 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 "talk.h" #include <locale.h> +#include "talk.h" + /* * talk: A visual form of write. Using sockets, a two way * connection is set up between the two people talking. diff --git a/usr.bin/talk/talk.h b/usr.bin/talk/talk.h index 63bd373..5b38027 100644 --- a/usr.bin/talk/talk.h +++ b/usr.bin/talk/talk.h @@ -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)); |