Module Name:    src
Committed By:   christos
Date:           Sat Nov 21 15:01:43 UTC 2015

Modified Files:
        src/usr.bin/who: Makefile utmpentry.c utmpentry.h who.c

Log Message:
WARNS=6


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/who/Makefile
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/who/utmpentry.c
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/who/utmpentry.h
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/who/who.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/who/Makefile
diff -u src/usr.bin/who/Makefile:1.9 src/usr.bin/who/Makefile:1.10
--- src/usr.bin/who/Makefile:1.9	Tue Apr 14 18:15:29 2009
+++ src/usr.bin/who/Makefile	Sat Nov 21 10:01:43 2015
@@ -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

Index: src/usr.bin/who/utmpentry.c
diff -u src/usr.bin/who/utmpentry.c:1.17 src/usr.bin/who/utmpentry.c:1.18
--- src/usr.bin/who/utmpentry.c:1.17	Fri May  1 10:26:10 2009
+++ src/usr.bin/who/utmpentry.c	Sat Nov 21 10:01:43 2015
@@ -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 int setup(const char *);
 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 @@ endutentries(void)
 	numutmp = 0;
 }
 
-int
+size_t
 getutentries(const char *fname, struct utmpentry **epp)
 {
 #ifdef SUPPORT_UTMPX

Index: src/usr.bin/who/utmpentry.h
diff -u src/usr.bin/who/utmpentry.h:1.7 src/usr.bin/who/utmpentry.h:1.8
--- src/usr.bin/who/utmpentry.h:1.7	Sun Jul 13 16:07:49 2008
+++ src/usr.bin/who/utmpentry.h	Sat Nov 21 10:01:43 2015
@@ -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 {
 	struct utmpentry *next;
 };
 
-extern int maxname, maxline, maxhost;
+extern size_t maxname, maxline, maxhost;
 extern int etype;
 
 /*
@@ -72,5 +72,5 @@ extern int etype;
  * endutentries clears and frees the cached data.
  */
 
-int getutentries(const char *, struct utmpentry **);
+size_t getutentries(const char *, struct utmpentry **);
 void endutentries(void);

Index: src/usr.bin/who/who.c
diff -u src/usr.bin/who/who.c:1.24 src/usr.bin/who/who.c:1.25
--- src/usr.bin/who/who.c:1.24	Sun Jun  8 05:53:43 2014
+++ src/usr.bin/who/who.c	Sat Nov 21 10:01:43 2015
@@ -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 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19
 #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 @@ print(const char *name, const char *line
 		
 	}
 
-	(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 @@ print(const char *name, const char *line
 	}
 	
 	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 @@ quick(const char *fname)
 
 	(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');
 	}

Reply via email to