From owner-cvs-sys Fri Mar 14 09:32:12 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id JAA00484 for cvs-sys-outgoing; Fri, 14 Mar 1997 09:32:12 -0800 (PST) Received: from nic.follonett.no (nic.follonett.no [194.198.43.10]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id JAA00434; Fri, 14 Mar 1997 09:31:36 -0800 (PST) Received: (from uucp@localhost) by nic.follonett.no (8.8.5/8.8.3) with UUCP id SAA07876; Fri, 14 Mar 1997 18:29:41 +0100 (MET) Received: from oo7 (oo7.dimaga.com [192.0.0.65]) by dimaga.com (8.7.5/8.7.2) with SMTP id SAA02277; Fri, 14 Mar 1997 18:35:08 +0100 (MET) Message-Id: <3.0.32.19970314183320.00a52100@dimaga.com> X-Sender: eivind@dimaga.com X-Mailer: Windows Eudora Pro Version 3.0 (32) Date: Fri, 14 Mar 1997 18:33:21 +0100 To: Nate Williams From: Eivind Eklund Subject: Re: cvs commit: src/sys/i386/include endian.h Cc: Nate Williams , CVS-committers@freefall.freebsd.org, cvs-all@freefall.freebsd.org, cvs-sys@freefall.freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-cvs-sys@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk At 10:21 AM 3/14/97 -0700, Nate Williams wrote: >> > Branch: sys/i386/include RELENG_2_1_0 >> > Modified: sys/i386/include endian.h >> >> While you're in there, why not reverse the sense of the LINT flag? > >Huh? I have *NO* idea what you're talking about here. If you have code >that explains what you are trying to say. --- /usr/include/machine/endian.h Sun Feb 12 09:31:31 1995 +++ /tmp/endian.h Fri Mar 14 18:31:40 1997 @@ -94,7 +94,7 @@ /* * Macros for network/external number representation conversion. */ -#if BYTE_ORDER == BIG_ENDIAN && !defined(lint) +#if BYTE_ORDER == BIG_ENDIAN || defined(lint) #define ntohl(x) (x) #define ntohs(x) (x) #define htonl(x) (x) @@ -112,9 +112,9 @@ #define htonl __byte_swap_long #define htons __byte_swap_word -#define NTOHL(x) (x) = ntohl((u_long)x) -#define NTOHS(x) (x) = ntohs((u_short)x) -#define HTONL(x) (x) = htonl((u_long)x) -#define HTONS(x) (x) = htons((u_short)x) +#define NTOHL(x) do{(x) = ntohl((u_long)x)}while(0) +#define NTOHS(x) do{(x) = ntohs((u_short)x)}while(0) +#define HTONL(x) do{(x) = htonl((u_long)x)}while(0) +#define HTONS(x) do{(x) = htons((u_short)x)}while(0) #endif #endif /* _MACHINE_ENDIAN_H_ */ The first part is switching the sense of the lint flag, to avoid the GCC specific assembly macros when linting. The second is securing against precedence errors. (I'm keeping my hands away from the include files - that's more than I'm willing to risk breaking.) Eivind Eklund perhaps@yes.no http://maybe.yes.no/perhaps/ eivind@freebsd.org