tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] Reformatting Tinycc source code


From: Tyge Løvset
Subject: [Tinycc-devel] Reformatting Tinycc source code
Date: Wed, 2 Dec 2020 10:56:50 +0100

I have slowly started to look into the core code of tinycc, but can't help being annoyed by the inconsistent formatting of the code, in particular the mixing of tabs and spaces. (sometimes tabs means 4 indents, sometimes 8). Here is a suggestion for an Artistic Style - Index (sourceforge.net) configuration, which follows the overall existing formatting style (save it e.g.  as tcc_astyle):

### use K&R brackets style with 4 spaces indent
--style=kr

### indenting
--min-conditional-indent=0
--max-continuation-indent=50

### add/remove paddings
--pad-header
--pad-oper
--unpad-paren

### keep one-liners
--keep-one-line-blocks
--keep-one-line-statements

### considered...
#--indent-preproc-block
#--indent-col1-comments
#--indent=spaces=2
#--indent-labels

### create no backup file (already in git)
--suffix=none

Reformat the code in-place by: astyle --options=tcc_astyle *.c *.h

I omitted --indent-labels, but default K&R style is to have labels at first column, and they are much easier to spot, e.g. those in between switch case labels...

Would anyone care to review the changes it creates, before a possible commit? So far it looks good, and I haven't spotted any errors created by the reformatting so far.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]