Date: Wed, 23 Jun 2010 12:41:08 -0700 From: Julian Elischer <julian@elischer.org> To: Luigi Rizzo <rizzo@iet.unipi.it> Cc: Randall Stewart <rrs@lakerest.net>, net@FreeBSD.org Subject: Re: Observations from an old timer playing with 64 bit numbers... Message-ID: <4C226354.80601@elischer.org> In-Reply-To: <20100623171222.GA7981@onelab2.iet.unipi.it> References: <E3C4102C-3106-4D5B-86E5-8D5BDD7FD442@lakerest.net> <20100622221228.GA93249@onelab2.iet.unipi.it> <20100623232402.X45536@delplex.bde.org> <9C936FEB-4858-4D8D-89CC-182EA3A80365@lakerest.net> <20100623171222.GA7981@onelab2.iet.unipi.it>
next in thread | previous in thread | raw e-mail | index | archive | help
On 6/23/10 10:12 AM, Luigi Rizzo wrote: > On Wed, Jun 23, 2010 at 09:50:26AM -0700, Randall Stewart wrote: > ... >>>> strong objection! >>>> We should instead use names with exact sizes (16,32,64). >> >> So please tell me why you object so strongly? We have the 16/32/64 bit >> names which >> are nice but are not expected so folks seem to not use them. I have > > people's ignorance is not an excuse for not doing things right. > We'd still be using BYTE, WORD and DWORD otherwise. > > I think there is no doubt that we should use the 16/32/64 bit names > if we could start from scratch, and the only reason for not doing > so is avoiding gratuitous changes to existing/stable code. > > The case of *to*ll does not apply, in that there is no actual legacy > to adapt to. And btw there is tons of places which use the 16/32/64 bit > names in the filesystem, usb and generic device drivers. In fact, > many more than ntohl/htonl > > > grep -r be32 ~/FreeBSD/head/sys/ | grep -v .svn | wc > 1438 6397 145174 > > grep -r le32 ~/FreeBSD/head/sys/ | grep -v .svn | wc > 2203 10269 210989 > > grep -r ntohl ~/FreeBSD/head/sys/ | grep -v .svn | wc > 854 4009 84855 > > grep -r htonl ~/FreeBSD/head/sys/ | grep -v .svn | wc > 738 3604 72970 what he said.. if you want to have ntohll in SCTP then that is your choice, but I think it should be a local define to be64toh or ntoh64 I do prefer the ntoh64 version but beXXtoh or whatever it looks like others are using is ok to me too since 'net' is a pretty wide definition and not ALL protocols are big endian.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C226354.80601>