aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/cmp
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>1999-04-25 22:37:58 +0000
committerWarner Losh <imp@FreeBSD.org>1999-04-25 22:37:58 +0000
commit96846ff64680fa4945300ede843b93311fea74fc (patch)
treeaba3886e3e0083bd6b42e0eaf90d3866b045b70a /usr.bin/cmp
parentebe70c8f689aca6d1c8800d98f0582f6213cf129 (diff)
downloadsrc-96846ff64680fa4945300ede843b93311fea74fc.tar.gz
src-96846ff64680fa4945300ede843b93311fea74fc.zip
More egcs warning fixes:
o main returns int not void o use return 0 at end of main when needed o use braces to avoid potentially ambiguous else o don't default to type int o #ifdef 0 -> #if 0 Reviewed by: obrien and chuckr
Notes
Notes: svn path=/head/; revision=46081
Diffstat (limited to 'usr.bin/cmp')
-rw-r--r--usr.bin/cmp/regular.c3
-rw-r--r--usr.bin/cmp/special.c6
2 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/cmp/regular.c b/usr.bin/cmp/regular.c
index 3b82bae11a69..c5a1e3bbba08 100644
--- a/usr.bin/cmp/regular.c
+++ b/usr.bin/cmp/regular.c
@@ -93,13 +93,14 @@ c_regular(fd1, file1, skip1, len1, fd2, file2, skip2, len2)
p1 += skip1 - off1;
p2 += skip2 - off2;
for (byte = line = 1; length--; ++p1, ++p2, ++byte) {
- if ((ch = *p1) != *p2)
+ if ((ch = *p1) != *p2) {
if (lflag) {
dfound = 1;
(void)printf("%6qd %3o %3o\n", byte, ch, *p2);
} else
diffmsg(file1, file2, byte, line);
/* NOTREACHED */
+ }
if (ch == '\n')
++line;
}
diff --git a/usr.bin/cmp/special.c b/usr.bin/cmp/special.c
index b843cc8fc9cc..a9033b363c86 100644
--- a/usr.bin/cmp/special.c
+++ b/usr.bin/cmp/special.c
@@ -73,13 +73,15 @@ c_special(fd1, file1, skip1, fd2, file2, skip2)
ch2 = getc(fp2);
if (ch1 == EOF || ch2 == EOF)
break;
- if (ch1 != ch2)
+ if (ch1 != ch2) {
if (lflag) {
dfound = 1;
(void)printf("%6qd %3o %3o\n", byte, ch1, ch2);
- } else
+ } else {
diffmsg(file1, file2, byte, line);
/* NOTREACHED */
+ }
+ }
if (ch1 == '\n')
++line;
}