From owner-p4-projects@FreeBSD.ORG Mon Sep 24 18:03:04 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4D1E216A473; Mon, 24 Sep 2007 18:03:04 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1524916A41A; Mon, 24 Sep 2007 18:03:04 +0000 (UTC) (envelope-from cnst@FreeBSD.org) Received: from mojo.ru (mojo.ru [84.252.152.63]) by mx1.freebsd.org (Postfix) with ESMTP id 8CF3813C4B7; Mon, 24 Sep 2007 18:03:03 +0000 (UTC) (envelope-from cnst@FreeBSD.org) Received: from [192.168.0.16] (nc-76-4-28-21.dhcp.embarqhsd.net [76.4.28.21]) (authenticated bits=0) by mojo.ru (8.12.11.20060308/8.12.10) with ESMTP id l8OI355p017014 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 24 Sep 2007 22:03:07 +0400 Message-ID: <46F7FBC1.7080300@FreeBSD.org> Date: Mon, 24 Sep 2007 14:02:41 -0400 From: "Constantine A. Murenin" Organization: Google Summer of Code 2007 Student @ The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-gb, en-gb-oed, en, en-us, ru, ru-ru, ru-su MIME-Version: 1.0 To: Hans Petter Selasky References: <200709231625.l8NGPhaR097038@repoman.freebsd.org> <200709232113.34718.hselasky@freebsd.org> <20070924104320.GE38890@cicely12.cicely.de> <200709241737.53572.hselasky@freebsd.org> In-Reply-To: <200709241737.53572.hselasky@freebsd.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: Perforce Change Reviews , ticso@cicely.de, "Constantine A. Murenin" Subject: Re: PERFORCE change 126745 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Sep 2007 18:03:04 -0000 On 24/09/2007 11:37, Hans Petter Selasky wrote: > On Monday 24 September 2007, Bernd Walter wrote: > >>On Sun, Sep 23, 2007 at 09:13:33PM +0200, Hans Petter Selasky wrote: >> >>>Hi Constantine, >>> >>>Thanks for your input and I _know_ that my code is not 100% style >>>compliant. Most of the style misbehaves are probably there due to the way >>>my "xemacs" autoformatting behaves. And I love curly brackets and >>>parenthesis, by the way :-) >>> >>>My plan is to clean up all the style stuff by a small C-program in the >>>end, because doing it by hand is waste of my time. Probably it will take >>>less time to write that program than the actual manual edit when we are >>>talking about doing alot of edits. It wonders me if such a tool already >>>exists, because the code is technically OK. >> >>There is indent(1) in src, but it doesn't produce 100% style(9) clean >>code either. >>I usually use it as a starting point for very ugly formated code. >>I'm not shure it will make things easier in this special case, maybe >>just different. >>But very likely you can use it to automatically fix at least a few >>common points. >>Enhancing indent to produce style(9) code would be a great feature... > > > Hi Bernd Walter, > > Yes, I think I will go for that. Start with "indent" as is and then extend the > functionality. > > Some things I have in mind: > > Automatic __FBSDID() at top of C-files. > > Automatic "static prototypes". > > Automatic comments before every C-function is defined. > > Automatic use of typedefs when declaring certain device method functions: > > static device_attach_t my_attach; > > Automatically reorder the code so that it follows generic device driver > layout. Automatic renaming of function names like hid_get_descriptor_from_usb() and usbreq_get_report_descriptor() into something less wordy. Good luck! :-) C.