aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlukem <lukem@NetBSD.org>2009-04-12 10:18:52 +0000
committerlukem <lukem@NetBSD.org>2009-04-12 10:18:52 +0000
commitfa5f97966d65a882be4d6bb59b7ca60f3dbedc7a (patch)
treee47da179ba93e396333e45d227d5fadede3da1de
parentbc4c2ad22cd4a459f3d8439b84eb69de9cbdf858 (diff)
downloadbsd-progress-fa5f97966d65a882be4d6bb59b7ca60f3dbedc7a.tar.gz
bsd-progress-fa5f97966d65a882be4d6bb59b7ca60f3dbedc7a.tar.zst
bsd-progress-fa5f97966d65a882be4d6bb59b7ca60f3dbedc7a.zip
Fix numerous WARNS=4 issues (-Wcast-qual -Wsign-compare).
-rw-r--r--include/progressbar.h6
-rw-r--r--progressbar.c10
2 files changed, 8 insertions, 8 deletions
diff --git a/include/progressbar.h b/include/progressbar.h
index bb0c4e0..f627e88 100644
--- a/include/progressbar.h
+++ b/include/progressbar.h
@@ -1,7 +1,7 @@
-/* $NetBSD: progressbar.h,v 1.7 2008/09/30 03:41:53 lukem Exp $ */
+/* $NetBSD: progressbar.h,v 1.8 2009/04/12 10:18:52 lukem Exp $ */
/*-
- * Copyright (c) 1996-2008 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -59,7 +59,7 @@ GLOBAL int fromatty; /* input is from a terminal */
GLOBAL int verbose; /* print messages coming back from server */
GLOBAL int quit_time; /* maximum time to wait if stalled */
-GLOBAL char *direction; /* direction transfer is occurring */
+GLOBAL const char *direction; /* direction transfer is occurring */
GLOBAL sigjmp_buf toplevel; /* non-local goto stuff for cmd scanner */
#endif /* !STANDALONE_PROGRESS */
diff --git a/progressbar.c b/progressbar.c
index 5f6a5e7..d7edd27 100644
--- a/progressbar.c
+++ b/progressbar.c
@@ -1,7 +1,7 @@
-/* $NetBSD: progressbar.c,v 1.20 2008/09/30 03:41:53 lukem Exp $ */
+/* $NetBSD: progressbar.c,v 1.21 2009/04/12 10:18:52 lukem Exp $ */
/*-
- * Copyright (c) 1997-2008 The NetBSD Foundation, Inc.
+ * Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: progressbar.c,v 1.20 2008/09/30 03:41:53 lukem Exp $");
+__RCSID("$NetBSD: progressbar.c,v 1.21 2009/04/12 10:18:52 lukem Exp $");
#endif /* not lint */
/*
@@ -100,7 +100,7 @@ static const char * const suffixes[] = {
"YiB", /* 2^80 Yobibyte */
#endif
};
-#define NSUFFIXES (sizeof(suffixes) / sizeof(suffixes[0]))
+#define NSUFFIXES (int)(sizeof(suffixes) / sizeof(suffixes[0]))
/*
* Display a transfer progress bar if progress is non-zero.
@@ -219,7 +219,7 @@ progressmeter(int flag)
* calculate the length of the `*' bar, ensuring that
* the number of stars won't exceed the buffer size
*/
- barlength = MIN(sizeof(buf) - 1, ttywidth) - BAROVERHEAD;
+ barlength = MIN((int)(sizeof(buf) - 1), ttywidth) - BAROVERHEAD;
if (prefix)
barlength -= (int)strlen(prefix);
if (barlength > 0) {