-/* $NetBSD: progressbar.c,v 1.19 2008/04/28 20:24:13 martin Exp $ */
+/* $NetBSD: progressbar.c,v 1.22 2012/06/27 22:07:36 riastradh Exp $ */
/*-
- * Copyright (c) 1997-2007 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
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: progressbar.c,v 1.19 2008/04/28 20:24:13 martin Exp $");
+__RCSID("$NetBSD: progressbar.c,v 1.22 2012/06/27 22:07:36 riastradh Exp $");
#endif /* not lint */
/*
* FTP User Program -- Misc support routines
*/
-#include <sys/types.h>
#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/time.h>
#include <err.h>
#include <errno.h>
"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.
* 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) {