From owner-cvs-src@FreeBSD.ORG Mon Oct 30 21:50:21 2006 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2E29C16A535; Mon, 30 Oct 2006 21:50:21 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E995743D49; Mon, 30 Oct 2006 21:50:11 +0000 (GMT) (envelope-from marius@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k9ULoBkv041076; Mon, 30 Oct 2006 21:50:11 GMT (envelope-from marius@repoman.freebsd.org) Received: (from marius@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k9ULoBXi041075; Mon, 30 Oct 2006 21:50:11 GMT (envelope-from marius) Message-Id: <200610302150.k9ULoBXi041075@repoman.freebsd.org> From: Marius Strobl Date: Mon, 30 Oct 2006 21:50:11 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/sparc64/include endian.h src/sys/sun4v/include endian.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Oct 2006 21:50:21 -0000 marius 2006-10-30 21:50:11 UTC FreeBSD src repository Modified files: sys/sparc64/include endian.h sys/sun4v/include endian.h Log: In the replacement text of the __bswapN_const() macros encapsulate the argument in parentheses so these macros are safe to use and invocations with an expression as the argument like __bswap32_const(42 << 23 | 13) work as expected. Additionally, mask all the individually shifted bytes as appropriate so the bytes which exceed the width of the respective __bswapN_const() macro in invocations like __bswap16_const(0xdead600d) are ignored like it's the case with the corresponding __bswapN_var() function. MFC after: 3 days Revision Changes Path 1.16 +12 -8 src/sys/sparc64/include/endian.h 1.2 +12 -8 src/sys/sun4v/include/endian.h