206
edits
m (fine-tuning) |
|||
Line 1: | Line 1: | ||
== | == Use common sense == | ||
These are conventions which we try to follow when writing code for ScummVM. They are this way mainly for reasons of taste, however, sticking to a common set of formatting rules also makes it slightly easier to read through our sources. If you want to submit patches, please try to follow these rules. | These are conventions which we try to follow when writing code for ScummVM. They are this way mainly for reasons of taste, however, sticking to a common set of formatting rules also makes it slightly easier to read through our sources. If you want to submit patches, please try to follow these rules. | ||
Line 7: | Line 7: | ||
In the following examples tabs are replaced by spaces for visual consistency with the Code Formatting Conventions. | In the following examples tabs are replaced by spaces for visual consistency with the Code Formatting Conventions. | ||
== | == Hugging braces == | ||
Braces in your code should look like the following example: | Braces in your code should look like the following example: | ||
Line 25: | Line 25: | ||
Did you see the {}'s on that? | Did you see the {}'s on that? | ||
== | == Tab indents, with tabstop at four spaces == | ||
Says it all, really. | Says it all, really. | ||
== | == Whitespaces == | ||
'''Conventional operators surrounded by a space character''' | '''Conventional operators surrounded by a space character''' | ||
Line 78: | Line 78: | ||
</pre> | </pre> | ||
== | == Switch / Case constructs == | ||
<pre> | <pre> | ||
Line 94: | Line 94: | ||
</pre> | </pre> | ||
== | == Naming == | ||
'''Constants''' | '''Constants''' | ||
Line 134: | Line 134: | ||
</pre> | </pre> | ||
== | == Special comments == | ||
The following goes slightly beyond code formatting: We use certain keywords (together with an explanatory text) to mark certains sections of our code. In particular: | The following goes slightly beyond code formatting: We use certain keywords (together with an explanatory text) to mark certains sections of our code. In particular: |
edits