Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 05 Sep 2014 16:32:22 +0200
From:      Hans Petter Selasky <hps@selasky.org>
To:        Glen Barber <gjb@FreeBSD.org>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: patchchecker for FreeBSD ?
Message-ID:  <5409C976.3030308@selasky.org>
In-Reply-To: <20140905141741.GZ36287@hub.FreeBSD.org>
References:  <CAHsXFKHeSNbeuU7YnWqr=niHhst2NSd9ohPE6pYbenQXkXUkrQ@mail.gmail.com> <CAF6rxgk=JB_qeU%2BAaWxqkFW_5A86u70BH4yEtiCfQhNdBUuGiA@mail.gmail.com> <5409C4DD.9020703@selasky.org> <20140905141741.GZ36287@hub.FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 09/05/14 16:17, Glen Barber wrote:
> On Fri, Sep 05, 2014 at 04:12:45PM +0200, Hans Petter Selasky wrote:
>> The attached script does the trick for me at least. Might be useful to
>> others too :-)
>>
>
> I think mailman ate it.
>
> Glen
>

#!/bin/sh

#
# This script should be run on every USB C- and H- file before
# commit to enforce correct style.
#

[ -z "$1" ] && (echo "Please specify a filename.") && exit

#
# The "-ta" option is an extension to indent.
# Contact hselasky@freebsd.org to receive a
# patch that adds support for this option to
# indent !
#

#
# sed -E 's/&\(([^, \)]*)\)/\&\1/' |
#

for F in $*
do

echo "Now styling $F"

(cat $F | indent -Toss_mixerinfo -TFILE -Tu_char -Tu_int -Tu_long \
  -TTAILQ_HEAD -TLIST_HEAD -TTAILQ_ENTRY -TLIST_ENTRY \
  -TSTAILQ_HEAD -TSTAILQ_ENTRY \
  -Tu_short -Tfd_set -ta -st -bad -bap -nbbb -nbc -br -nbs \
  -c41 -cd41 -cdb -ce -ci4 -cli0 -d0 -di8 -ndj -ei -nfc1 \
  -nfcb -i8 -ip8 -l79 -lc77 -ldi0 -nlp -npcs -psl -sc \
  -nsob -nv |
  sed -e "s/_HEAD [(]/_HEAD(/g" |
  sed -e "s/_ENTRY [(]/_ENTRY(/g" |
  sed -e "s/	__packed/ __packed/g" |
  sed -e "s/	__aligned/ __aligned/g" |
  sed -e "s/^#define /#define	/g") > temp

(diff temp $F > /dev/null) || (cp temp $F)

done




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5409C976.3030308>