summaryrefslogtreecommitdiffstats
path: root/CODING_STYLE
Commit message (Collapse)AuthorAgeFilesLines
* CODING_STYLE: update mixed declaration rulesPaolo Bonzini2015-09-091-4/+9
| | | | | | | | Mixed declarations do come in handy at the top of #ifdef blocks. Reluctantly allow this particular usage and suggest an alternative. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* CODING_STYLE: Section about conditional statementGonglei2014-08-151-0/+14
| | | | | | | | | | Yoda conditions lack readability, and QEMU has a strict compiler configuration for checking a common mistake like "if (dev = NULL)". Make it a written rule. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* CODING_STYLE: Section about mixed declarationsEduardo Habkost2014-03-271-0/+7
| | | | | | | | | | | We had an unwritten rule about declarations having to be at beginning of blocks. Make it a written rule. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* Replace Qemu by QEMU in internal documentationStefan Weil2012-04-071-1/+1
| | | | | | | | The official spelling is QEMU. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* CODING_STYLE: Clarify style for enum and function type namesPeter Maydell2012-02-101-1/+2
| | | | | | | | Clarify that enum type names and function type names should follow the CamelCase style used for structured type names. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* CODING_STYLE: explicitly allow braceless 'else if'Avi Kivity2011-07-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's already allowed by the example; there are about 1800 instances in the tree; and disallowing it would lead to if (a) { ... } else { if (b) { ... } else { if (c) { ... } else { if (d) { ... } else { ... } } } } instead of if (a) { ... } else if (b) { ... } else if (c) { ... } else if (d) { ... } else { ... } which is more readable. Acked-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* checkpatch: adjust to QEMUismsBlue Swirl2011-01-201-0/+3
| | | | | | | | | | | | | | Change checkpatch.pl for QEMU use: - Root directory detection - Forbid tabs - Indent at 4 spaces - Allow typedefs - Enforce brace use even for single statement blocks - Don't suggest nonexistent cleanup tools Mention the script in CODING_STYLE. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* HACKING: add C type rulesBlue Swirl2010-09-101-3/+0
| | | | | | | | | | Add C type rules, adapted from libvirt HACKING. Also include a description of special QEMU scalar types. Move typedef rule from CODING_STYLE rule 3 to HACKING rule 6 where it belongs. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* CODING_STYLE: Reserve qemu_ prefix for library wrappersAvi Kivity2010-03-191-0/+3
| | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Revert "Get rid of _t suffix"Anthony Liguori2009-10-011-4/+8
| | | | | | | | | | | | In the very least, a change like this requires discussion on the list. The naming convention is goofy and it causes a massive merge problem. Something like this _must_ be presented on the list first so people can provide input and cope with it. This reverts commit 99a0949b720a0936da2052cb9a46db04ffc6db29. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Get rid of _t suffixmalc2009-10-011-8/+4
| | | | | | | Some not so obvious bits, slirp and Xen were left alone for the time being. Signed-off-by: malc <av1474@comtv.ru>
* Remove potentially offensive humor.edgar_igl2009-04-071-1/+1
| | | | | | | Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7014 c046a42c-6fe2-441c-8c8c-71466251a162
* Document QEMU coding style (v2) (Avi Kivity)aliguori2009-04-051-0/+78
With the help of some Limoncino I noted several aspects of the QEMU coding style, particularly where it differs from the Linux coding style as many contributors work on both projects. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6976 c046a42c-6fe2-441c-8c8c-71466251a162
OpenPOWER on IntegriCloud