From owner-freebsd-net@FreeBSD.ORG Wed Jun 23 17:02:02 2010 Return-Path: Delivered-To: net@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8F63106564A for ; Wed, 23 Jun 2010 17:02:02 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 8D87B8FC08 for ; Wed, 23 Jun 2010 17:02:02 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id A87EF73098; Wed, 23 Jun 2010 19:12:22 +0200 (CEST) Date: Wed, 23 Jun 2010 19:12:22 +0200 From: Luigi Rizzo To: Randall Stewart Message-ID: <20100623171222.GA7981@onelab2.iet.unipi.it> References: <20100622221228.GA93249@onelab2.iet.unipi.it> <20100623232402.X45536@delplex.bde.org> <9C936FEB-4858-4D8D-89CC-182EA3A80365@lakerest.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9C936FEB-4858-4D8D-89CC-182EA3A80365@lakerest.net> User-Agent: Mutt/1.4.2.3i Cc: net@FreeBSD.org Subject: Re: Observations from an old timer playing with 64 bit numbers... X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 17:02:02 -0000 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 cheers luigi