Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/who WARNS=6
details: https://anonhg.NetBSD.org/src/rev/79c523841577
branches: trunk
changeset: 341764:79c523841577
user: christos <christos%NetBSD.org@localhost>
date: Sat Nov 21 15:01:43 2015 +0000
description:
WARNS=6
diffstat:
usr.bin/who/Makefile | 3 ++-
usr.bin/who/utmpentry.c | 12 ++++++------
usr.bin/who/utmpentry.h | 6 +++---
usr.bin/who/who.c | 16 ++++++++--------
4 files changed, 19 insertions(+), 18 deletions(-)
diffs (149 lines):
diff -r c568e745bbd0 -r 79c523841577 usr.bin/who/Makefile
--- a/usr.bin/who/Makefile Sat Nov 21 14:59:51 2015 +0000
+++ b/usr.bin/who/Makefile Sat Nov 21 15:01:43 2015 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.9 2009/04/14 22:15:29 lukem Exp $
+# $NetBSD: Makefile,v 1.10 2015/11/21 15:01:43 christos Exp $
# @(#)Makefile 8.1 (Berkeley) 6/6/93
+WARNS= 6
PROG= who
SRCS= who.c utmpentry.c
CPPFLAGS+= -DSUPPORT_UTMPX -DSUPPORT_UTMP
diff -r c568e745bbd0 -r 79c523841577 usr.bin/who/utmpentry.c
--- a/usr.bin/who/utmpentry.c Sat Nov 21 14:59:51 2015 +0000
+++ b/usr.bin/who/utmpentry.c Sat Nov 21 15:01:43 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: utmpentry.c,v 1.17 2009/05/01 14:26:10 christos Exp $ */
+/* $NetBSD: utmpentry.c,v 1.18 2015/11/21 15:01:43 christos Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: utmpentry.c,v 1.17 2009/05/01 14:26:10 christos Exp $");
+__RCSID("$NetBSD: utmpentry.c,v 1.18 2015/11/21 15:01:43 christos Exp $");
#endif
#include <sys/stat.h>
@@ -69,16 +69,16 @@
static void adjust_size(struct utmpentry *e);
#endif
-int maxname = 8, maxline = 8, maxhost = 16;
+size_t maxname = 8, maxline = 8, maxhost = 16;
int etype = 1 << USER_PROCESS;
-static int numutmp = 0;
+static size_t numutmp = 0;
static struct utmpentry *ehead;
#if defined(SUPPORT_UTMPX) || defined(SUPPORT_UTMP)
static void
adjust_size(struct utmpentry *e)
{
- int max;
+ size_t max;
if ((max = strlen(e->name)) > maxname)
maxname = max;
@@ -178,7 +178,7 @@
numutmp = 0;
}
-int
+size_t
getutentries(const char *fname, struct utmpentry **epp)
{
#ifdef SUPPORT_UTMPX
diff -r c568e745bbd0 -r 79c523841577 usr.bin/who/utmpentry.h
--- a/usr.bin/who/utmpentry.h Sat Nov 21 14:59:51 2015 +0000
+++ b/usr.bin/who/utmpentry.h Sat Nov 21 15:01:43 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: utmpentry.h,v 1.7 2008/07/13 20:07:49 dholland Exp $ */
+/* $NetBSD: utmpentry.h,v 1.8 2015/11/21 15:01:43 christos Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
struct utmpentry *next;
};
-extern int maxname, maxline, maxhost;
+extern size_t maxname, maxline, maxhost;
extern int etype;
/*
@@ -72,5 +72,5 @@
* endutentries clears and frees the cached data.
*/
-int getutentries(const char *, struct utmpentry **);
+size_t getutentries(const char *, struct utmpentry **);
void endutentries(void);
diff -r c568e745bbd0 -r 79c523841577 usr.bin/who/who.c
--- a/usr.bin/who/who.c Sat Nov 21 14:59:51 2015 +0000
+++ b/usr.bin/who/who.c Sat Nov 21 15:01:43 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: who.c,v 1.24 2014/06/08 09:53:43 mlelstv Exp $ */
+/* $NetBSD: who.c,v 1.25 2015/11/21 15:01:43 christos Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)who.c 8.1 (Berkeley) 6/6/93";
#endif
-__RCSID("$NetBSD: who.c,v 1.24 2014/06/08 09:53:43 mlelstv Exp $");
+__RCSID("$NetBSD: who.c,v 1.25 2015/11/21 15:01:43 christos Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -307,12 +307,12 @@
}
- (void)printf("%-*.*s ", maxname, maxname, name);
+ (void)printf("%-*.*s ", (int)maxname, (int)maxname, name);
if (show_term)
(void)printf("%c ", state);
- (void)printf("%-*.*s ", maxline, maxline, line);
+ (void)printf("%-*.*s ", (int)maxline, (int)maxline, line);
tstr = ctime(&t);
(void)printf("%.12s ", tstr ? tstr + 4 : "?");
@@ -339,19 +339,19 @@
}
if (*host)
- (void)printf("\t(%.*s)", maxhost, host);
+ (void)printf("\t(%.*s)", (int)maxhost, host);
(void)putchar('\n');
}
static void
output_labels(void)
{
- (void)printf("%-*.*s ", maxname, maxname, "USER");
+ (void)printf("%-*.*s ", (int)maxname, (int)maxname, "USER");
if (show_term)
(void)printf("S ");
- (void)printf("%-*.*s ", maxline, maxline, "LINE");
+ (void)printf("%-*.*s ", (int)maxline, (int)maxline, "LINE");
(void)printf("WHEN ");
if (show_idle) {
@@ -372,7 +372,7 @@
(void)getutentries(fname, &ehead);
for (ep = ehead; ep != NULL; ep = ep->next) {
- (void)printf("%-*s ", maxname, ep->name);
+ (void)printf("%-*s ", (int)maxname, ep->name);
if ((++num % 8) == 0)
(void)putchar('\n');
}
Home |
Main Index |
Thread Index |
Old Index