On 09/11/2011 12:00 PM, Stefan Weil wrote:
For new C code (and maybe also for existing code), a code formatter
like Artistic Style is helpful because it can fix tabs, indentation
and other style issues.
This option file tries to set astyle options which match QEMU's
coding conventions.
The quality of astyle's code formatting depends on the astyle version
(I got best results with newer versions) and on the code which is going
to be formatted.
For some code, formatting of brackets and operators does not work well.
Fixing indentation and tabs always worked well for me.
Signed-off-by: Stefan Weil<address@hidden>
---
scripts/astylerc | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
create mode 100644 scripts/astylerc
Please put a copyright in this file.
FWIW, this is what I use with emacs:
(c-add-style "qemu"
'("stroustrup"
(indent-tabs-mode . nil)
(c-basic-offset . 4)
(tab-width . 8)
)
nil) ; t = set this style, nil = don't
Regards,
Anthony Liguori