From fa5f97966d65a882be4d6bb59b7ca60f3dbedc7a Mon Sep 17 00:00:00 2001 From: lukem Date: Sun, 12 Apr 2009 10:18:52 +0000 Subject: Fix numerous WARNS=4 issues (-Wcast-qual -Wsign-compare). --- include/progressbar.h | 6 +++--- progressbar.c | 10 +++++----- 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 #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) { -- cgit v1.2.3-56-ge451