From owner-svn-src-all@FreeBSD.ORG Tue Jun 18 00:24:20 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 371BA59F; Tue, 18 Jun 2013 00:24:20 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id F31AA19C3; Tue, 18 Jun 2013 00:24:19 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id E63A810415BA; Tue, 18 Jun 2013 10:24:16 +1000 (EST) Date: Tue, 18 Jun 2013 10:24:16 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: David Chisnall Subject: Re: svn commit: r251855 - head/sys/sys In-Reply-To: <201306171530.r5HFUmx5035189@svn.freebsd.org> Message-ID: <20130618093254.L1323@besplex.bde.org> References: <201306171530.r5HFUmx5035189@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=K8x6hFqI c=1 sm=1 a=LiowyP3STkkA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=FSHVhTTuonsA:10 a=cbgORYylU8o8n0NilroA:9 a=CjuIK1q_8ugA:10 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 00:24:20 -0000 On Mon, 17 Jun 2013, David Chisnall wrote: > Log: > Rename a parameter in sys/time.h so that you don't get warnings for things > like libdialog that include both this header and math.h. All the bintime stuff has similar namespace errors, starting with the field names 'sec' and 'frac' not having a prefix, despite the good example set by struct tm and good style requiring a prefix. 'sec' and 'frac' are paticularly bad field names since they are close to both English words and to good names for application variables. > Modified: head/sys/sys/time.h > ============================================================================== > --- head/sys/sys/time.h Mon Jun 17 15:16:14 2013 (r251854) > +++ head/sys/sys/time.h Mon Jun 17 15:30:47 2013 (r251855) > @@ -103,17 +103,17 @@ bintime_mul(struct bintime *bt, u_int x) > } > > static __inline void > -bintime_shift(struct bintime *bt, int exp) > +bintime_shift(struct bintime *__bt, int __exp) The new names have excessive underscores and are thus now just style bugs. Single underscores are ugly enough. 'exp' us only reserved by system headers when is included, and even then it is not normally a problem since it is not a macro. But bt is in the application namespace. #define bt bintime variables should be named _bt in inline functions #include This is now fixed, but only for this function. > { > > - if (exp > 0) { > - bt->sec <<= exp; > - bt->sec |= bt->frac >> (64 - exp); > - bt->frac <<= exp; > - } else if (exp < 0) { > - bt->frac >>= -exp; > - bt->frac |= (uint64_t)bt->sec << (64 + exp); > - bt->sec >>= -exp; > + if (__exp > 0) { > + __bt->sec <<= __exp; > + __bt->sec |= __bt->frac >> (64 - __exp); > + __bt->frac <<= __exp; > + } else if (__exp < 0) { > + __bt->frac >>= -__exp; > + __bt->frac |= (uint64_t)__bt->sec << (64 + __exp); > + __bt->sec >>= -__exp; > } > } __bt has another naming error. It is not a bintime variable, but a pointer to one. It should be named _btp. This style bug is everywhere dense in bintime code. 'sec' and 'frac' are in the application namespace. #define sec namespace errors in bintime bite me if I do this #define frac the errors are just as undocumented as the namespace #include This is not fixed. Bruce