qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] astyle: Formatting rules for QEMU


From: Stefan Weil
Subject: Re: [Qemu-devel] [PATCH] astyle: Formatting rules for QEMU
Date: Sat, 18 Feb 2012 12:13:26 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.26) Gecko/20120131 Thunderbird/3.1.18

Am 18.02.2012 11:10, schrieb Blue Swirl:
There are still indentation problems when expressions continue to next
line, also this does not look OK:
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -36,7 +36,7 @@

#define DYNAMIC_PC 1 /* dynamic pc value */
#define JUMP_PC 2 /* dynamic pc value which takes only two values
- according to jump_pc[T2] */
+according to jump_pc[T2] */

Writing comments like this looks nice, but needs more work when
the comments are written. Maintenance of the code is also more
difficult: any time a new line with a longer name is added, you
have to reformat all other lines to preserve the good look.

Just add this line to the code given above to see what I mean:
    #define ANY_LONG_PC 3 /* just an example */

This is why I usually write comments in an extra line before the
code statement.

Regards,
Stefan




reply via email to

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