summaryrefslogtreecommitdiffstats
path: root/usr.bin/rcs
diff options
context:
space:
mode:
authorokan <okan@openbsd.org>2016-10-16 13:35:51 +0000
committerokan <okan@openbsd.org>2016-10-16 13:35:51 +0000
commit257be8780c70ada6450496d4c1ee39463eedb8a2 (patch)
treee5a0d29374df703aeeaddc7fc2e758fd4a499327 /usr.bin/rcs
parentRemove useless n=n assignment in the first parse of a for(). (diff)
downloadwireguard-openbsd-257be8780c70ada6450496d4c1ee39463eedb8a2.tar.xz
wireguard-openbsd-257be8780c70ada6450496d4c1ee39463eedb8a2.zip
Quiet compiler warnings; as applied to usr.bin/cvs by millert@
ok millert@
Diffstat (limited to 'usr.bin/rcs')
-rw-r--r--usr.bin/rcs/buf.c4
-rw-r--r--usr.bin/rcs/diff.c6
-rw-r--r--usr.bin/rcs/diff3.c4
-rw-r--r--usr.bin/rcs/rlog.c4
4 files changed, 9 insertions, 9 deletions
diff --git a/usr.bin/rcs/buf.c b/usr.bin/rcs/buf.c
index 24d9427862b..1a9450da11f 100644
--- a/usr.bin/rcs/buf.c
+++ b/usr.bin/rcs/buf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: buf.c,v 1.26 2015/11/02 16:45:21 nicm Exp $ */
+/* $OpenBSD: buf.c,v 1.27 2016/10/16 13:35:51 okan Exp $ */
/*
* Copyright (c) 2003 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -100,7 +100,7 @@ buf_load(const char *path)
if (fstat(fd, &st) == -1)
goto out;
- if (st.st_size > SIZE_MAX) {
+ if ((uintmax_t)st.st_size > SIZE_MAX) {
errno = EFBIG;
goto out;
}
diff --git a/usr.bin/rcs/diff.c b/usr.bin/rcs/diff.c
index da9649d8c41..868288cf9f6 100644
--- a/usr.bin/rcs/diff.c
+++ b/usr.bin/rcs/diff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff.c,v 1.38 2015/06/13 20:15:21 nicm Exp $ */
+/* $OpenBSD: diff.c,v 1.39 2016/10/16 13:35:51 okan Exp $ */
/*
* Copyright (C) Caldera International Inc. 2001-2002.
* All rights reserved.
@@ -437,13 +437,13 @@ prepare(int i, FILE *fd, off_t filesize, int flags)
rewind(fd);
- sz = (filesize <= SIZE_MAX ? filesize : SIZE_MAX) / 25;
+ sz = ((uintmax_t)filesize <= SIZE_MAX ? (size_t)filesize : SIZE_MAX) / 25;
if (sz < 100)
sz = 100;
p = xcalloc(sz + 3, sizeof(*p));
for (j = 0; (h = readhash(fd, flags));) {
- if (j == sz) {
+ if ((size_t)j == sz) {
sz = sz * 3 / 2;
p = xreallocarray(p, sz + 3, sizeof(*p));
}
diff --git a/usr.bin/rcs/diff3.c b/usr.bin/rcs/diff3.c
index ef96d0dcc9b..a019b8e967f 100644
--- a/usr.bin/rcs/diff3.c
+++ b/usr.bin/rcs/diff3.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff3.c,v 1.39 2016/08/26 09:02:54 guenther Exp $ */
+/* $OpenBSD: diff3.c,v 1.40 2016/10/16 13:35:51 okan Exp $ */
/*
* Copyright (C) Caldera International Inc. 2001-2002.
@@ -887,7 +887,7 @@ edscript(int n)
(void)fseek(fp[2], (long)de[n].new.from, SEEK_SET);
for (k = de[n].new.to-de[n].new.from; k > 0; k-= j) {
j = k > BUFSIZ ? BUFSIZ : k;
- if (fread(block, 1, j, fp[2]) != j)
+ if (fread(block, 1, j, fp[2]) != (size_t)j)
return (-1);
block[j] = '\0';
diff_output("%s", block);
diff --git a/usr.bin/rcs/rlog.c b/usr.bin/rcs/rlog.c
index 3df4334680b..b01830a867f 100644
--- a/usr.bin/rcs/rlog.c
+++ b/usr.bin/rcs/rlog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rlog.c,v 1.73 2016/08/31 13:09:09 jcs Exp $ */
+/* $OpenBSD: rlog.c,v 1.74 2016/10/16 13:35:51 okan Exp $ */
/*
* Copyright (c) 2005, 2009 Joris Vink <joris@openbsd.org>
* Copyright (c) 2005, 2006 Xavier Santolaria <xsa@openbsd.org>
@@ -359,7 +359,7 @@ rlog_file(const char *fname, RCSFILE *file)
if (rflag == 1)
nrev = rcs_rev_select(file, revisions);
else if (dflag == 1) {
- if ((nrev = rlog_select_daterev(file, rlog_dates)) == -1)
+ if ((nrev = rlog_select_daterev(file, rlog_dates)) == (u_int)-1)
errx(1, "invalid date: %s", rlog_dates);
} else
nrev = file->rf_ndelta;