Date: Fri, 3 Aug 2001 23:04:47 -0400 From: Mike Barcroft <mike@FreeBSD.org> To: audit@FreeBSD.org Subject: lam(1) warns patch Message-ID: <20010803230447.A4563@coffee.q9media.com>
next in thread | raw e-mail | index | archive | help
I'd appreciate comments on the following patch. If there are no
objections, I'd like to commit this shortly.
Best regards,
Mike Barcroft
----------------------------------------------------------------------
lam.20010803.patch
o Constify, staticize, set WARNS?=2.
Index: lam/Makefile
===================================================================
RCS file: /home/ncvs/src/usr.bin/lam/Makefile,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 Makefile
--- lam/Makefile 1994/05/27 12:31:55 1.1.1.1
+++ lam/Makefile 2001/08/04 02:14:26
@@ -1,5 +1,7 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
+# $FreeBSD$
PROG= lam
+WARNS?= 2
.include <bsd.prog.mk>
Index: lam/lam.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/lam/lam.c,v
retrieving revision 1.7
diff -u -r1.7 lam.c
--- lam/lam.c 2001/02/08 20:15:59 1.7
+++ lam/lam.c 2001/08/04 02:14:26
@@ -64,8 +64,8 @@
short eof; /* eof flag */
short pad; /* pad flag for missing columns */
char eol; /* end of line character */
- char *sepstring; /* string to print before each line */
- char *format; /* printf(3) style string spec. */
+ const char *sepstring; /* string to print before each line */
+ const char *format; /* printf(3) style string spec. */
} input[MAXOFILES];
int morefiles; /* set by getargs(), changed by gatherline() */
@@ -73,13 +73,13 @@
char line[BIGBUFSIZ];
char *linep;
-char *gatherline(struct openfile *);
-void getargs(char *[]);
-char *pad(struct openfile *);
+static char *gatherline(struct openfile *);
+static void getargs(char *[]);
+static char *pad(struct openfile *);
static void usage(void);
int
-main(int argc, char *argv[])
+main(int argc __unused, char *argv[])
{
struct openfile *ip;
@@ -99,7 +99,7 @@
}
}
-void
+static void
getargs(char *av[])
{
struct openfile *ip = input;
@@ -176,7 +176,7 @@
ip->sepstring = "";
}
-char *
+static char *
pad(struct openfile *ip)
{
char *lp = linep;
@@ -190,7 +190,7 @@
return (lp);
}
-char *
+static char *
gatherline(struct openfile *ip)
{
char s[BUFSIZ];
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010803230447.A4563>
