summaryrefslogtreecommitdiffstats
path: root/usr.bin/column
diff options
context:
space:
mode:
authorarchie <archie@FreeBSD.org>1998-12-06 22:58:23 +0000
committerarchie <archie@FreeBSD.org>1998-12-06 22:58:23 +0000
commit167c036e91fb24a62d627d16a2f3afa6d875c9e2 (patch)
treee40a696092a51458b052ff258b3700d51fc2ca09 /usr.bin/column
parent3f56407712318be6faa0b98ad8db4b5a83ef4c93 (diff)
downloadFreeBSD-src-167c036e91fb24a62d627d16a2f3afa6d875c9e2.zip
FreeBSD-src-167c036e91fb24a62d627d16a2f3afa6d875c9e2.tar.gz
Tweaks to allow compiling -Wall (mostly adding "const" to char rcsid[]).
Diffstat (limited to 'usr.bin/column')
-rw-r--r--usr.bin/column/Makefile1
-rw-r--r--usr.bin/column/column.c14
2 files changed, 8 insertions, 7 deletions
diff --git a/usr.bin/column/Makefile b/usr.bin/column/Makefile
index 1c304e2..33de9f6 100644
--- a/usr.bin/column/Makefile
+++ b/usr.bin/column/Makefile
@@ -1,5 +1,6 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= column
+CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/column/column.c b/usr.bin/column/column.c
index cf8c7a9..043ab9d 100644
--- a/usr.bin/column/column.c
+++ b/usr.bin/column/column.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1989, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)column.c 8.4 (Berkeley) 5/4/95";
+static const char sccsid[] = "@(#)column.c 8.4 (Berkeley) 5/4/95";
#endif /* not lint */
#include <sys/types.h>
@@ -79,7 +79,7 @@ main(argc, argv)
char *p;
if (ioctl(1, TIOCGWINSZ, &win) == -1 || !win.ws_col) {
- if (p = getenv("COLUMNS"))
+ if ((p = getenv("COLUMNS")))
termwidth = atoi(p);
} else
termwidth = win.ws_col;
@@ -109,7 +109,7 @@ main(argc, argv)
if (!*argv)
input(stdin);
else for (; *argv; ++argv)
- if (fp = fopen(*argv, "r")) {
+ if ((fp = fopen(*argv, "r"))) {
input(fp);
(void)fclose(fp);
} else {
@@ -150,7 +150,7 @@ c_columnate()
endcol = maxlength;
putchar('\n');
} else {
- while ((cnt = (chcnt + TAB & ~(TAB - 1))) <= endcol) {
+ while ((cnt = ((chcnt + TAB) & ~(TAB - 1))) <= endcol) {
(void)putchar('\t');
chcnt = cnt;
}
@@ -178,7 +178,7 @@ r_columnate()
chcnt += printf("%s", list[base]);
if ((base += numrows) >= entries)
break;
- while ((cnt = (chcnt + TAB & ~(TAB - 1))) <= endcol) {
+ while ((cnt = ((chcnt + TAB) & ~(TAB - 1))) <= endcol) {
(void)putchar('\t');
chcnt = cnt;
}
@@ -218,7 +218,7 @@ maketbl()
cols = emalloc((maxcols = DEFCOLS) * sizeof(char *));
lens = emalloc(maxcols * sizeof(int));
for (cnt = 0, lp = list; cnt < entries; ++cnt, ++lp, ++t) {
- for (coloff = 0, p = *lp; cols[coloff] = strtok(p, separator);
+ for (coloff = 0, p = *lp; (cols[coloff] = strtok(p, separator));
p = NULL)
if (++coloff == maxcols) {
if (!(cols = realloc(cols, (u_int)maxcols +
OpenPOWER on IntegriCloud