diff options
author | delphij <delphij@FreeBSD.org> | 2005-01-17 17:45:38 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2005-01-17 17:45:38 +0000 |
commit | 49cacc83a552fca5c0d47b830a6c89c3328b18ed (patch) | |
tree | 0f2293f11f3531ee1f2137f8ee2f4b6abff67c5f | |
parent | 69da99d939f877d2b1765cb25406449126bb1c03 (diff) | |
download | FreeBSD-src-49cacc83a552fca5c0d47b830a6c89c3328b18ed.zip FreeBSD-src-49cacc83a552fca5c0d47b830a6c89c3328b18ed.tar.gz |
Cleanup:
- Change signedness of nxtfld() to make msgs(1) WARNS=6 clean
- Add several static's
-rw-r--r-- | usr.bin/msgs/Makefile | 1 | ||||
-rw-r--r-- | usr.bin/msgs/msgs.c | 34 |
2 files changed, 18 insertions, 17 deletions
diff --git a/usr.bin/msgs/Makefile b/usr.bin/msgs/Makefile index 21cb151..9f59c6a 100644 --- a/usr.bin/msgs/Makefile +++ b/usr.bin/msgs/Makefile @@ -2,6 +2,7 @@ # $FreeBSD$ PROG= msgs +WARNS?= 6 DPADD= ${LIBTERMCAP} LDADD= -ltermcap diff --git a/usr.bin/msgs/msgs.c b/usr.bin/msgs/msgs.c index c56c3aa..23f2240 100644 --- a/usr.bin/msgs/msgs.c +++ b/usr.bin/msgs/msgs.c @@ -151,14 +151,14 @@ bool clean = NO; bool lastcmd = NO; jmp_buf tstpbuf; -void ask(const char *); -void gfrsub(FILE *); -int linecnt(FILE *); -int next(char *); -char *nxtfld(unsigned char *); -void onsusp(int); -void onintr(int); -void prmesg(int); +static void ask(const char *); +static void gfrsub(FILE *); +static int linecnt(FILE *); +static int next(char *); +static char *nxtfld(char *); +static void onsusp(int); +static void onintr(int); +static void prmesg(int); static void usage(void); int @@ -628,7 +628,7 @@ usage(void) exit(1); } -void +static void prmesg(int length) { FILE *outf; @@ -675,7 +675,7 @@ prmesg(int length) tcdrain(fileno(stdout)); } -void +static void onintr(int unused __unused) { signal(SIGINT, onintr); @@ -700,7 +700,7 @@ onintr(int unused __unused) /* * We have just gotten a susp. Suspend and prepare to resume. */ -void +static void onsusp(int unused __unused) { signal(SIGTSTP, SIG_DFL); @@ -711,7 +711,7 @@ onsusp(int unused __unused) longjmp(tstpbuf, 0); } -int +static int linecnt(FILE *f) { off_t oldpos = ftello(f); @@ -725,7 +725,7 @@ linecnt(FILE *f) return (l); } -int +static int next(char *buf) { int i; @@ -734,7 +734,7 @@ next(char *buf) return(--i); } -void +static void ask(const char *prompt) { char inch; @@ -820,7 +820,7 @@ ask(const char *prompt) } } -void +static void gfrsub(FILE *infile) { off_t frompos; @@ -900,8 +900,8 @@ gfrsub(FILE *infile) strncpy(subj, "(No Subject)\n", sizeof subj); } -char * -nxtfld(unsigned char *s) +static char * +nxtfld(char *s) { if (*s) while (*s && !isspace(*s)) s++; /* skip over this field */ if (*s) while (*s && isspace(*s)) s++; /* find start of next field */ |