- Change signedness of nxtfld() to make msgs(1) WARNS=6 clean
 - Add several static's
This commit is contained in:
Xin LI 2005-01-17 17:45:38 +00:00
parent f1858c523b
commit 617efa7ad5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=140389
2 changed files with 18 additions and 17 deletions

View File

@ -2,6 +2,7 @@
# $FreeBSD$ # $FreeBSD$
PROG= msgs PROG= msgs
WARNS?= 6
DPADD= ${LIBTERMCAP} DPADD= ${LIBTERMCAP}
LDADD= -ltermcap LDADD= -ltermcap

View File

@ -151,14 +151,14 @@ bool clean = NO;
bool lastcmd = NO; bool lastcmd = NO;
jmp_buf tstpbuf; jmp_buf tstpbuf;
void ask(const char *); static void ask(const char *);
void gfrsub(FILE *); static void gfrsub(FILE *);
int linecnt(FILE *); static int linecnt(FILE *);
int next(char *); static int next(char *);
char *nxtfld(unsigned char *); static char *nxtfld(char *);
void onsusp(int); static void onsusp(int);
void onintr(int); static void onintr(int);
void prmesg(int); static void prmesg(int);
static void usage(void); static void usage(void);
int int
@ -628,7 +628,7 @@ usage(void)
exit(1); exit(1);
} }
void static void
prmesg(int length) prmesg(int length)
{ {
FILE *outf; FILE *outf;
@ -675,7 +675,7 @@ prmesg(int length)
tcdrain(fileno(stdout)); tcdrain(fileno(stdout));
} }
void static void
onintr(int unused __unused) onintr(int unused __unused)
{ {
signal(SIGINT, onintr); signal(SIGINT, onintr);
@ -700,7 +700,7 @@ onintr(int unused __unused)
/* /*
* We have just gotten a susp. Suspend and prepare to resume. * We have just gotten a susp. Suspend and prepare to resume.
*/ */
void static void
onsusp(int unused __unused) onsusp(int unused __unused)
{ {
signal(SIGTSTP, SIG_DFL); signal(SIGTSTP, SIG_DFL);
@ -711,7 +711,7 @@ onsusp(int unused __unused)
longjmp(tstpbuf, 0); longjmp(tstpbuf, 0);
} }
int static int
linecnt(FILE *f) linecnt(FILE *f)
{ {
off_t oldpos = ftello(f); off_t oldpos = ftello(f);
@ -725,7 +725,7 @@ linecnt(FILE *f)
return (l); return (l);
} }
int static int
next(char *buf) next(char *buf)
{ {
int i; int i;
@ -734,7 +734,7 @@ next(char *buf)
return(--i); return(--i);
} }
void static void
ask(const char *prompt) ask(const char *prompt)
{ {
char inch; char inch;
@ -820,7 +820,7 @@ ask(const char *prompt)
} }
} }
void static void
gfrsub(FILE *infile) gfrsub(FILE *infile)
{ {
off_t frompos; off_t frompos;
@ -900,8 +900,8 @@ gfrsub(FILE *infile)
strncpy(subj, "(No Subject)\n", sizeof subj); strncpy(subj, "(No Subject)\n", sizeof subj);
} }
char * static char *
nxtfld(unsigned char *s) nxtfld(char *s)
{ {
if (*s) while (*s && !isspace(*s)) s++; /* skip over this field */ if (*s) while (*s && !isspace(*s)) s++; /* skip over this field */
if (*s) while (*s && isspace(*s)) s++; /* find start of next field */ if (*s) while (*s && isspace(*s)) s++; /* find start of next field */