Module Name: src
Committed By: lukem
Date: Mon Apr 13 07:10:25 UTC 2009
Modified Files:
src/usr.bin/ruptime: ruptime.c
Log Message:
Fix WARNS=4 issues (-Wcast-qual -Wsign-compare)
To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/ruptime/ruptime.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/ruptime/ruptime.c
diff -u src/usr.bin/ruptime/ruptime.c:1.13 src/usr.bin/ruptime/ruptime.c:1.14
--- src/usr.bin/ruptime/ruptime.c:1.13 Mon Jul 21 14:19:25 2008
+++ src/usr.bin/ruptime/ruptime.c Mon Apr 13 07:10:25 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: ruptime.c,v 1.13 2008/07/21 14:19:25 lukem Exp $ */
+/* $NetBSD: ruptime.c,v 1.14 2009/04/13 07:10:25 lukem Exp $ */
/*
* Copyright (c) 1983, 1993, 1994
@@ -37,7 +37,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)ruptime.c 8.2 (Berkeley) 4/5/94";*/
-__RCSID("$NetBSD: ruptime.c,v 1.13 2008/07/21 14:19:25 lukem Exp $");
+__RCSID("$NetBSD: ruptime.c,v 1.14 2009/04/13 07:10:25 lukem Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -69,7 +69,7 @@
int rflg = 1;
int hscmp(const void *, const void *);
-char *interval(time_t, char *);
+char *interval(time_t, const char *);
int lcmp(const void *, const void *);
int main(int, char **);
void morehosts(void);
@@ -85,8 +85,8 @@
struct whod *wd;
struct whoent *we;
DIR *dirp;
- size_t hspace;
- int aflg, cc, ch, fd, i, maxloadav;
+ size_t hspace, i;
+ int aflg, cc, ch, fd, maxloadav;
char buf[sizeof(struct whod)];
int (*cmp)(const void *, const void *);
@@ -133,7 +133,7 @@
cc = read(fd, buf, sizeof(struct whod));
(void)close(fd);
- if (cc < WHDRSIZE)
+ if (cc < (int)WHDRSIZE)
continue;
if (nhosts == hspace) {
if ((hs =
@@ -187,7 +187,7 @@
}
char *
-interval(time_t tval, char *updown)
+interval(time_t tval, const char *updown)
{
static char resbuf[32];
int days, hours, minutes;
@@ -211,7 +211,7 @@
return (resbuf);
}
-#define HS(a) ((struct hs *)(a))
+#define HS(a) ((const struct hs *)(a))
/* Alphabetical comparison. */
int