Menu

#488 Indentation inside switch

open
nobody
None
2018-02-15
2018-02-15
cJM
No

Hi ,I'm using AStyle with this configuration file to format a C application code :

Bracket

--style=ansi

Tab

--indent=spaces=2

Indentation

--indent-switches --min-conditional-indent=0 --max-instatement-indent=60
--indent-preproc-block
--indent-preproc-define

Padding

--pad-oper --pad-header --unpad-paren --align-pointer=name

Formatting

--add-brackets --convert-tabs

Other

--lineend=linux

--suffix=none

--max-code-length=120
--suffix=.orig

****what I found instead of indenting the entire case block :

switch (foo)

{

case 1:

a += 1;

break;

case 2:

{

a += 2;

break;

}

}
****what i supposed get:

switch (foo)
{
case 1:
a += 1;
break;

case 2:
{
    a += 2;
    break;
}

}

Discussion


Log in to post a comment.