Re: a simple formatter

From: Amos Jeffries <squid3@dont-contact.us>
Date: Fri, 8 Feb 2008 12:39:04 +1300 (NZDT)

>
>> Tested.
>>
>> I have made a (small) file of the structures I've noticed past
>> formatting
>> errors on. With a manual fix-up to what I think it should look like in
>> readable C++ under the published squid formatting description.
>>
>> The output of your script does this:
>> ......................
>
> It is the "--break-blocks" option of the astyle. I think it can removed.
>
>> Also, I noticed that the formatter will accept _anything_ given to it as
>> a
>> filename and create the files. Thats rather nasty when non-valid
>> filename
>> sequences are entered. ie "--help"
>>
>
> OK fixed :-). Now accepts only files with .cc,.h,.cci and .c extensions
> and ignore all other files.
> I am re-sending the fixed script . In this version also I removed the
> "--break-blocks" astyle option. Formated code looks better without it.
>

Excellent. That dropit it down to:

--- astyle-test-cases.cc 2008-02-08 12:37:14.000000000 +1300
+++ astyle-test-cases.cc-original 2008-02-07 12:13:07.000000000 +1300
@@ -10,9 +10,9 @@

 /// structures with bit-fields
 struct t1 {
- unsigned int a:1;
- unsigned int b:1;
- unsigned int c:1;
+ unsigned int a:1;
+ unsigned int b:1;
+ unsigned int c:1;
 };

I suppose we could live with that. Though I think it may be a problem with
the formatter.pl final replacement.

Amos
Received on Thu Feb 07 2008 - 16:39:07 MST

This archive was generated by hypermail pre-2.1.9 : Sat Mar 01 2008 - 12:00:09 MST