Module Name:    src
Committed By:   mrg
Date:           Mon Jun 20 09:11:17 UTC 2011

Modified Files:
        src/common/lib/libc/gen: rb.c
        src/crypto/dist/heimdal/lib/krb5: convert_creds.c init_creds_pw.c
            rd_req.c
        src/crypto/external/bsd/openssh/dist: progressmeter.c
        src/external/bsd/bind/dist/lib/isc/unix: time.c
        src/external/bsd/openldap/dist/libraries/liblutil: detach.c
        src/lib/libc/compat/sys: compat_getdents.c
        src/lib/libc/db/btree: bt_split.c
        src/lib/libc/db/recno: rec_put.c
        src/lib/libc/gdtoa: strtof.c
        src/lib/libc/rpc: clnt_dg.c
        src/lib/libedit: eln.c
        src/lib/libpuffs: puffs_priv.h
        src/sys/arch/amd64/include: stdarg.h

Log Message:
various build fixes for gcc 4.5.  from chuq.  XXX i'm not sure all of
these work properly wtf pointer aliasing, but there are no casts at
least...

the lib/libpuffs/puffs_priv.h is definately a real bug fix.

from chuq.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/common/lib/libc/gen/rb.c
cvs rdiff -u -r1.2 -r1.3 src/crypto/dist/heimdal/lib/krb5/convert_creds.c \
    src/crypto/dist/heimdal/lib/krb5/init_creds_pw.c \
    src/crypto/dist/heimdal/lib/krb5/rd_req.c
cvs rdiff -u -r1.2 -r1.3 src/crypto/external/bsd/openssh/dist/progressmeter.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/bind/dist/lib/isc/unix/time.c
cvs rdiff -u -r1.1.1.3 -r1.2 \
    src/external/bsd/openldap/dist/libraries/liblutil/detach.c
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/compat/sys/compat_getdents.c
cvs rdiff -u -r1.19 -r1.20 src/lib/libc/db/btree/bt_split.c
cvs rdiff -u -r1.17 -r1.18 src/lib/libc/db/recno/rec_put.c
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/gdtoa/strtof.c
cvs rdiff -u -r1.24 -r1.25 src/lib/libc/rpc/clnt_dg.c
cvs rdiff -u -r1.9 -r1.10 src/lib/libedit/eln.c
cvs rdiff -u -r1.43 -r1.44 src/lib/libpuffs/puffs_priv.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/amd64/include/stdarg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libc/gen/rb.c
diff -u src/common/lib/libc/gen/rb.c:1.10 src/common/lib/libc/gen/rb.c:1.11
--- src/common/lib/libc/gen/rb.c:1.10	Tue Apr 12 16:19:44 2011
+++ src/common/lib/libc/gen/rb.c	Mon Jun 20 09:11:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rb.c,v 1.10 2011/04/12 16:19:44 matt Exp $	*/
+/*	$NetBSD: rb.c,v 1.11 2011/06/20 09:11:16 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -39,10 +39,10 @@
 #else
 #define KASSERT(s)	do { } while (/*CONSTCOND*/ 0)
 #endif
-__RCSID("$NetBSD: rb.c,v 1.10 2011/04/12 16:19:44 matt Exp $");
+__RCSID("$NetBSD: rb.c,v 1.11 2011/06/20 09:11:16 mrg Exp $");
 #else
 #include <lib/libkern/libkern.h>
-__KERNEL_RCSID(0, "$NetBSD: rb.c,v 1.10 2011/04/12 16:19:44 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rb.c,v 1.11 2011/06/20 09:11:16 mrg Exp $");
 #endif
 
 #ifdef _LIBC
@@ -91,7 +91,7 @@
 {
 
 	rbt->rbt_ops = ops;
-	*((const struct rb_node **)&rbt->rbt_root) = RB_SENTINEL_NODE;
+	rbt->rbt_root = RB_SENTINEL_NODE;
 	RB_TAILQ_INIT(&rbt->rbt_nodes);
 #ifndef RBSMALL
 	rbt->rbt_minmax[RB_DIR_LEFT] = rbt->rbt_root;	/* minimum node */

Index: src/crypto/dist/heimdal/lib/krb5/convert_creds.c
diff -u src/crypto/dist/heimdal/lib/krb5/convert_creds.c:1.2 src/crypto/dist/heimdal/lib/krb5/convert_creds.c:1.3
--- src/crypto/dist/heimdal/lib/krb5/convert_creds.c:1.2	Sat Mar 22 08:37:13 2008
+++ src/crypto/dist/heimdal/lib/krb5/convert_creds.c	Mon Jun 20 09:11:16 2011
@@ -33,7 +33,7 @@
 
 #include "krb5_locl.h"
 __RCSID("$Heimdal: convert_creds.c 22050 2007-11-11 11:20:46Z lha $"
-        "$NetBSD: convert_creds.c,v 1.2 2008/03/22 08:37:13 mlelstv Exp $");
+        "$NetBSD: convert_creds.c,v 1.3 2011/06/20 09:11:16 mrg Exp $");
 
 #include "krb5-v4compat.h"
 
@@ -172,7 +172,7 @@
 
     keytype = v5_creds->session.keytype;
 
-    if (keytype != ENCTYPE_DES_CBC_CRC) {
+    if (keytype != (krb5_keytype)ENCTYPE_DES_CBC_CRC) {
 	/* MIT krb524d doesn't like nothing but des-cbc-crc tickets,
            so go get one */
 	krb5_creds template;
Index: src/crypto/dist/heimdal/lib/krb5/init_creds_pw.c
diff -u src/crypto/dist/heimdal/lib/krb5/init_creds_pw.c:1.2 src/crypto/dist/heimdal/lib/krb5/init_creds_pw.c:1.3
--- src/crypto/dist/heimdal/lib/krb5/init_creds_pw.c:1.2	Sat Mar 22 08:37:13 2008
+++ src/crypto/dist/heimdal/lib/krb5/init_creds_pw.c	Mon Jun 20 09:11:16 2011
@@ -34,7 +34,7 @@
 #include "krb5_locl.h"
 
 __RCSID("$Heimdal: init_creds_pw.c 21931 2007-08-27 14:11:55Z lha $"
-        "$NetBSD: init_creds_pw.c,v 1.2 2008/03/22 08:37:13 mlelstv Exp $");
+        "$NetBSD: init_creds_pw.c,v 1.3 2011/06/20 09:11:16 mrg Exp $");
 
 typedef struct krb5_get_init_creds_ctx {
     KDCOptions flags;
@@ -806,7 +806,7 @@
 		   heim_octet_string *data)
 {
     krb5_error_code ret;
-    if (paid->etype == ENCTYPE_NULL)
+    if (paid->etype == (krb5_enctype)ENCTYPE_NULL)
 	return NULL;
     ret = set_paid(paid, context, 
 		   paid->etype,
Index: src/crypto/dist/heimdal/lib/krb5/rd_req.c
diff -u src/crypto/dist/heimdal/lib/krb5/rd_req.c:1.2 src/crypto/dist/heimdal/lib/krb5/rd_req.c:1.3
--- src/crypto/dist/heimdal/lib/krb5/rd_req.c:1.2	Sat Mar 22 08:37:15 2008
+++ src/crypto/dist/heimdal/lib/krb5/rd_req.c	Mon Jun 20 09:11:16 2011
@@ -34,7 +34,7 @@
 #include <krb5_locl.h>
 
 __RCSID("$Heimdal: rd_req.c 22235 2007-12-08 21:52:07Z lha $"
-        "$NetBSD: rd_req.c,v 1.2 2008/03/22 08:37:15 mlelstv Exp $");
+        "$NetBSD: rd_req.c,v 1.3 2011/06/20 09:11:16 mrg Exp $");
 
 static krb5_error_code
 decrypt_tkt_enc_part (krb5_context context,
@@ -482,7 +482,7 @@
 
     if (ap_req_options) {
 	*ap_req_options = 0;
-	if (ac->keytype != ETYPE_NULL)
+	if (ac->keytype != (krb5_keytype)ETYPE_NULL)
 	    *ap_req_options |= AP_OPTS_USE_SUBKEY;
 	if (ap_req->ap_options.use_session_key)
 	    *ap_req_options |= AP_OPTS_USE_SESSION_KEY;

Index: src/crypto/external/bsd/openssh/dist/progressmeter.c
diff -u src/crypto/external/bsd/openssh/dist/progressmeter.c:1.2 src/crypto/external/bsd/openssh/dist/progressmeter.c:1.3
--- src/crypto/external/bsd/openssh/dist/progressmeter.c:1.2	Sun Jun  7 22:38:47 2009
+++ src/crypto/external/bsd/openssh/dist/progressmeter.c	Mon Jun 20 09:11:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: progressmeter.c,v 1.2 2009/06/07 22:38:47 christos Exp $	*/
+/*	$NetBSD: progressmeter.c,v 1.3 2011/06/20 09:11:16 mrg Exp $	*/
 /* $OpenBSD: progressmeter.c,v 1.37 2006/08/03 03:34:42 deraadt Exp $ */
 /*
  * Copyright (c) 2003 Nils Nordman.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include "includes.h"
-__RCSID("$NetBSD: progressmeter.c,v 1.2 2009/06/07 22:38:47 christos Exp $");
+__RCSID("$NetBSD: progressmeter.c,v 1.3 2011/06/20 09:11:16 mrg Exp $");
 #include <sys/types.h>
 #include <sys/ioctl.h>
 #include <sys/uio.h>
@@ -182,7 +182,7 @@
 		percent = ((float)cur_pos / end_pos) * 100;
 	else
 		percent = 100;
-	snprintf(buf + strlen(buf), win_size - strlen(buf-8),
+	snprintf(buf + strlen(buf), win_size - strlen(buf) - 8,
 	    " %3d%% ", percent);
 
 	/* amount transferred */

Index: src/external/bsd/bind/dist/lib/isc/unix/time.c
diff -u src/external/bsd/bind/dist/lib/isc/unix/time.c:1.2 src/external/bsd/bind/dist/lib/isc/unix/time.c:1.3
--- src/external/bsd/bind/dist/lib/isc/unix/time.c:1.2	Wed Feb 16 03:47:15 2011
+++ src/external/bsd/bind/dist/lib/isc/unix/time.c	Mon Jun 20 09:11:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: time.c,v 1.2 2011/02/16 03:47:15 christos Exp $	*/
+/*	$NetBSD: time.c,v 1.3 2011/06/20 09:11:16 mrg Exp $	*/
 
 /*
  * Copyright (C) 2004-2008  Internet Systems Consortium, Inc. ("ISC")
@@ -373,7 +373,7 @@
 	    (time_t)0.5 != 0.5 &&	       /* Not a floating point type. */
 	    (i = (time_t)-1) != 4294967295u &&		       /* Is signed. */
 	    (seconds &
-	     (1U << (sizeof(time_t) * CHAR_BIT - 1))) != 0U) {   /* Negative. */
+	     (1ULL << (sizeof(time_t) * CHAR_BIT - 1))) != 0ULL) {   /* Negative. */
 		/*
 		 * This UNUSED() is here to shut up the IRIX compiler:
 		 *	variable "i" was set but never used

Index: src/external/bsd/openldap/dist/libraries/liblutil/detach.c
diff -u src/external/bsd/openldap/dist/libraries/liblutil/detach.c:1.1.1.3 src/external/bsd/openldap/dist/libraries/liblutil/detach.c:1.2
--- src/external/bsd/openldap/dist/libraries/liblutil/detach.c:1.1.1.3	Sun Dec 12 15:22:08 2010
+++ src/external/bsd/openldap/dist/libraries/liblutil/detach.c	Mon Jun 20 09:11:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: detach.c,v 1.1.1.3 2010/12/12 15:22:08 adam Exp $	*/
+/*	$NetBSD: detach.c,v 1.2 2011/06/20 09:11:17 mrg Exp $	*/
 
 /* detach.c -- routines to daemonize a process */
 /* OpenLDAP: pkg/ldap/libraries/liblutil/detach.c,v 1.18.2.5 2010/04/13 20:23:05 kurt Exp */
@@ -130,7 +130,7 @@
 
 #ifdef HAVE_SETSID
 		(void) setsid();
-#elif TIOCNOTTY
+#elif defined(TIOCNOTTY)
 		if ( (sd = open( "/dev/tty", O_RDWR )) != -1 ) {
 			(void) ioctl( sd, TIOCNOTTY, NULL );
 			(void) close( sd );

Index: src/lib/libc/compat/sys/compat_getdents.c
diff -u src/lib/libc/compat/sys/compat_getdents.c:1.3 src/lib/libc/compat/sys/compat_getdents.c:1.4
--- src/lib/libc/compat/sys/compat_getdents.c:1.3	Mon Apr 28 20:22:59 2008
+++ src/lib/libc/compat/sys/compat_getdents.c	Mon Jun 20 09:11:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_getdents.c,v 1.3 2008/04/28 20:22:59 martin Exp $	*/
+/*	$NetBSD: compat_getdents.c,v 1.4 2011/06/20 09:11:17 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: compat_getdents.c,v 1.3 2008/04/28 20:22:59 martin Exp $");
+__RCSID("$NetBSD: compat_getdents.c,v 1.4 2011/06/20 09:11:17 mrg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #define __LIBC12_SOURCE__
@@ -50,6 +50,7 @@
 {
 	struct dirent *ndp, *nndp, *endp;
 	struct dirent12 *odp;
+	ino_t ino;
 	int rv;
 
 	if ((rv = __getdents30(fd, buf, nbytes)) == -1)
@@ -67,7 +68,9 @@
 	for (; ndp < endp; ndp = nndp) {
 		nndp = _DIRENT_NEXT(ndp);
 		/* XXX: avoid unaligned 64-bit access on sparc64 */
-		odp->d_ino = ((u_int32_t *)(void *)&ndp->d_ino)[_QUAD_LOWWORD];
+		/* XXX: does this work? */
+		memcpy(&ino, &ndp->d_ino, sizeof(ino_t));
+		odp->d_ino = (uint32_t)ino;
 		if (ndp->d_namlen >= sizeof(odp->d_name))
 			odp->d_namlen = sizeof(odp->d_name) - 1;
 		else

Index: src/lib/libc/db/btree/bt_split.c
diff -u src/lib/libc/db/btree/bt_split.c:1.19 src/lib/libc/db/btree/bt_split.c:1.20
--- src/lib/libc/db/btree/bt_split.c:1.19	Wed Apr 22 18:44:06 2009
+++ src/lib/libc/db/btree/bt_split.c	Mon Jun 20 09:11:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bt_split.c,v 1.19 2009/04/22 18:44:06 christos Exp $	*/
+/*	$NetBSD: bt_split.c,v 1.20 2011/06/20 09:11:17 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -37,7 +37,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: bt_split.c,v 1.19 2009/04/22 18:44:06 christos Exp $");
+__RCSID("$NetBSD: bt_split.c,v 1.20 2011/06/20 09:11:17 mrg Exp $");
 
 #include "namespace.h"
 #include <sys/types.h>
@@ -245,10 +245,12 @@
 			WR_BINTERNAL(dest, nksize ? nksize : bl->ksize,
 			    rchild->pgno, bl->flags & P_BIGKEY);
 			memmove(dest, bl->bytes, nksize ? nksize : bl->ksize);
-			if (bl->flags & P_BIGKEY &&
-			    bt_preserve(t, *(pgno_t *)(void *)bl->bytes) ==
-			    RET_ERROR)
-				goto err1;
+			if (bl->flags & P_BIGKEY) {
+				pgno_t pgno;
+				memcpy(&pgno, bl->bytes, sizeof(pgno));
+				if (bt_preserve(t, pgno) == RET_ERROR)
+					goto err1;
+			}
 			break;
 		case P_RINTERNAL:
 			/*
@@ -564,9 +566,12 @@
 		 * If the key is on an overflow page, mark the overflow chain
 		 * so it isn't deleted when the leaf copy of the key is deleted.
 		 */
-		if (bl->flags & P_BIGKEY &&
-		    bt_preserve(t, *(pgno_t *)(void *)bl->bytes) == RET_ERROR)
-			return (RET_ERROR);
+		if (bl->flags & P_BIGKEY) {
+			pgno_t pgno;
+			memcpy(&pgno, bl->bytes, sizeof(pgno));
+			if (bt_preserve(t, pgno) == RET_ERROR)
+				return (RET_ERROR);
+		}
 		break;
 	case P_BINTERNAL:
 		bi = GETBINTERNAL(r, 0);

Index: src/lib/libc/db/recno/rec_put.c
diff -u src/lib/libc/db/recno/rec_put.c:1.17 src/lib/libc/db/recno/rec_put.c:1.18
--- src/lib/libc/db/recno/rec_put.c:1.17	Thu Sep 11 12:58:00 2008
+++ src/lib/libc/db/recno/rec_put.c	Mon Jun 20 09:11:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rec_put.c,v 1.17 2008/09/11 12:58:00 joerg Exp $	*/
+/*	$NetBSD: rec_put.c,v 1.18 2011/06/20 09:11:17 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -34,7 +34,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: rec_put.c,v 1.17 2008/09/11 12:58:00 joerg Exp $");
+__RCSID("$NetBSD: rec_put.c,v 1.18 2011/06/20 09:11:17 mrg Exp $");
 
 #include "namespace.h"
 #include <sys/types.h>
@@ -208,7 +208,7 @@
 			return (RET_ERROR);
 		tdata.data = db;
 		tdata.size = NOVFLSIZE;
-		*(pgno_t *)(void *)db = pg;
+		memcpy(db, &pg, sizeof(*db));
 		_DBFIT(data->size, uint32_t);
 		*(uint32_t *)(void *)(db + sizeof(pgno_t)) =
 		    (uint32_t)data->size;

Index: src/lib/libc/gdtoa/strtof.c
diff -u src/lib/libc/gdtoa/strtof.c:1.4 src/lib/libc/gdtoa/strtof.c:1.5
--- src/lib/libc/gdtoa/strtof.c:1.4	Sun Mar 20 23:15:35 2011
+++ src/lib/libc/gdtoa/strtof.c	Mon Jun 20 09:11:17 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: strtof.c,v 1.4 2011/03/20 23:15:35 christos Exp $ */
+/* $NetBSD: strtof.c,v 1.5 2011/06/20 09:11:17 mrg Exp $ */
 
 /****************************************************************
 
@@ -82,6 +82,11 @@
 
 	  case STRTOG_NaN:
 		u.L[0] = f_QNAN;
+		break;
+
+	  default:
+		u.L[0] = 0; /* for gcc warning */
+		break;
 	  }
 	if (k & STRTOG_Neg)
 		u.L[0] |= 0x80000000L;

Index: src/lib/libc/rpc/clnt_dg.c
diff -u src/lib/libc/rpc/clnt_dg.c:1.24 src/lib/libc/rpc/clnt_dg.c:1.25
--- src/lib/libc/rpc/clnt_dg.c:1.24	Wed Dec  8 02:06:38 2010
+++ src/lib/libc/rpc/clnt_dg.c	Mon Jun 20 09:11:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: clnt_dg.c,v 1.24 2010/12/08 02:06:38 joerg Exp $	*/
+/*	$NetBSD: clnt_dg.c,v 1.25 2011/06/20 09:11:17 mrg Exp $	*/
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)clnt_dg.c 1.19 89/03/16 Copyr 1988 Sun Micro";
 #else
-__RCSID("$NetBSD: clnt_dg.c,v 1.24 2010/12/08 02:06:38 joerg Exp $");
+__RCSID("$NetBSD: clnt_dg.c,v 1.25 2011/06/20 09:11:17 mrg Exp $");
 #endif
 #endif
 
@@ -415,12 +415,12 @@
 				cu->cu_error.re_status = RPC_CANTRECV;
 				goto out;
 			}
-			if (recvlen >= (ssize_t)sizeof(uint32_t) &&
-			    (*((uint32_t *)(void *)(cu->cu_inbuf)) == 
-				*((uint32_t *)(void *)(cu->cu_outbuf)))) {
-				/* We now assume we have the proper reply. */
-				break;
-			}	       
+			if (recvlen >= (ssize_t)sizeof(uint32_t)) {
+				if (memcmp(cu->cu_inbuf, cu->cu_outbuf,
+				    sizeof(uint32_t)) == 0)
+					/* Assume we have the proper reply. */
+					break;
+			}
 		}
 		if (n == -1) {
 			cu->cu_error.re_errno = errno;

Index: src/lib/libedit/eln.c
diff -u src/lib/libedit/eln.c:1.9 src/lib/libedit/eln.c:1.10
--- src/lib/libedit/eln.c:1.9	Thu Nov  4 13:53:12 2010
+++ src/lib/libedit/eln.c	Mon Jun 20 09:11:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: eln.c,v 1.9 2010/11/04 13:53:12 christos Exp $	*/
+/*	$NetBSD: eln.c,v 1.10 2011/06/20 09:11:17 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: eln.c,v 1.9 2010/11/04 13:53:12 christos Exp $");
+__RCSID("$NetBSD: eln.c,v 1.10 2011/06/20 09:11:17 mrg Exp $");
 #endif /* not lint && not SCCSID */
 
 #include "histedit.h"
@@ -275,7 +275,7 @@
 	case EL_RPROMPT_ESC: {
 		el_pfunc_t *p = va_arg(ap, el_pfunc_t *);
 		char *c = va_arg(ap, char *);
-		wchar_t wc;
+		wchar_t wc = 0;
 		ret = prompt_get(el, p, &wc, op);
 		*c = (unsigned char)wc;
 		break;

Index: src/lib/libpuffs/puffs_priv.h
diff -u src/lib/libpuffs/puffs_priv.h:1.43 src/lib/libpuffs/puffs_priv.h:1.44
--- src/lib/libpuffs/puffs_priv.h:1.43	Mon Dec  6 14:50:34 2010
+++ src/lib/libpuffs/puffs_priv.h	Mon Jun 20 09:11:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_priv.h,v 1.43 2010/12/06 14:50:34 pooka Exp $	*/
+/*	$NetBSD: puffs_priv.h,v 1.44 2011/06/20 09:11:17 mrg Exp $	*/
 
 /*
  * Copyright (c) 2006, 2007, 2008 Antti Kantee.  All Rights Reserved.
@@ -114,7 +114,7 @@
 #define PU_SETSTATE(pu, s) (pu->pu_state = (s) | (pu->pu_state & ~PU_STATEMASK))
 #define PU_SETSFLAG(pu, s) (pu->pu_state |= (s))
 #define PU_CLRSFLAG(pu, s) \
-    (pu->pu_state = ((pu->pu_state &= ~(s)) | (pu->pu_state & PU_STATEMASK)))
+    (pu->pu_state = ((pu->pu_state & ~(s)) | (pu->pu_state & PU_STATEMASK)))
 	int			pu_dpipe[2];
 
 	struct puffs_node	*pu_pn_root;

Index: src/sys/arch/amd64/include/stdarg.h
diff -u src/sys/arch/amd64/include/stdarg.h:1.6 src/sys/arch/amd64/include/stdarg.h:1.7
--- src/sys/arch/amd64/include/stdarg.h:1.6	Sun Oct 26 00:08:15 2008
+++ src/sys/arch/amd64/include/stdarg.h	Mon Jun 20 09:11:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: stdarg.h,v 1.6 2008/10/26 00:08:15 mrg Exp $	*/
+/*	$NetBSD: stdarg.h,v 1.7 2011/06/20 09:11:17 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -44,12 +44,17 @@
 #ifdef __lint__
 #define __builtin_next_arg(t)		((t) ? 0 : 0)
 #define	__builtin_stdarg_start(a, l)	((a) = (va_list)(void *)&(l))
+#define	__builtin_va_start(a, l)	((a) = (va_list)(void *)&(l))
 #define	__builtin_va_arg(a, t)		((a) ? (t) 0 : (t) 0)
 #define	__builtin_va_end(a)		/* nothing */
 #define	__builtin_va_copy(d, s)		((d) = (s))
 #endif
 
+#if __GNUC_PREREQ__(4, 5)
+#define	va_start(ap, last)	__builtin_va_start((ap), (last))
+#else
 #define	va_start(ap, last)	__builtin_stdarg_start((ap), (last))
+#endif
 #define	va_arg			__builtin_va_arg
 #define	va_end(ap)		__builtin_va_end(ap)
 #define	__va_copy(dest, src)	__builtin_va_copy((dest), (src))

Reply via email to