Module Name:    src
Committed By:   lukem
Date:           Sat Apr 18 08:08:37 UTC 2009

Modified Files:
        src/usr.sbin/pwd_mkdb: pwd_mkdb.c

Log Message:
Fix WARNS=4 issues (-Wsign-compare -Wcast-qual)


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/usr.sbin/pwd_mkdb/pwd_mkdb.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.sbin/pwd_mkdb/pwd_mkdb.c
diff -u src/usr.sbin/pwd_mkdb/pwd_mkdb.c:1.39 src/usr.sbin/pwd_mkdb/pwd_mkdb.c:1.40
--- src/usr.sbin/pwd_mkdb/pwd_mkdb.c:1.39	Fri Mar  6 19:05:11 2009
+++ src/usr.sbin/pwd_mkdb/pwd_mkdb.c	Sat Apr 18 08:08:36 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pwd_mkdb.c,v 1.39 2009/03/06 19:05:11 apb Exp $	*/
+/*	$NetBSD: pwd_mkdb.c,v 1.40 2009/04/18 08:08:36 lukem Exp $	*/
 
 /*
  * Copyright (c) 2000, 2009 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
   Copyright (c) 1991, 1993, 1994\
  The Regents of the University of California.  All rights reserved.");
 __SCCSID("from: @(#)pwd_mkdb.c	8.5 (Berkeley) 4/20/94");
-__RCSID("$NetBSD: pwd_mkdb.c,v 1.39 2009/03/06 19:05:11 apb Exp $");
+__RCSID("$NetBSD: pwd_mkdb.c,v 1.40 2009/04/18 08:08:36 lukem Exp $");
 #endif /* not lint */
 
 #if HAVE_NBTOOL_CONFIG_H
@@ -416,7 +416,7 @@
 		} else if (rv == -1 ||
 			strcmp(username, tpwd->pw_name) != 0)
 			inconsistancy();
-		else if (olduid != pwd.pw_uid) {
+		else if ((uid_t)olduid != pwd.pw_uid) {
 			/*
 			 * If we're changing UID, remove the BYUID
 			 * record for the old UID only if it has the
@@ -676,7 +676,7 @@
 		bailout();
 	}
 
-	if (ret == 1 || *(int *)data.data != getversion()) {
+	if (ret == 1 || (uint32_t)(*(int *)data.data) != getversion()) {
 		warnx("databases are laid out according to an old version");
 		warnx("re-build the databases without -u");
 		bailout();
@@ -913,7 +913,7 @@
 {
 	DBT data, key;
 
-	key.data = (u_char *)__yp_token;
+	key.data = __UNCONST(__yp_token);
 	key.size = strlen(__yp_token);
 	data.data = (u_char *)NULL;
 	data.size = 0;

Reply via email to