|
|
<table style="border-collapse: collapse; border: none;">
|
|
|
<tr style="border-collapse: collapse; border: none;">
|
|
|
<td style="border-collapse: collapse; border: none;">
|
|
|
<a href="http://www.openairinterface.org/">
|
|
|
<img src="../images/oai_final_logo.png" alt="" border=3 height=50 width=150>
|
|
|
</img>
|
|
|
</a>
|
|
|
</td>
|
|
|
<td style="border-collapse: collapse; border: none; vertical-align: center;">
|
|
|
<b><font size = "5">Indentation</font></b>
|
|
|
</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
|
|
|
# 1. Indentation #
|
|
|
|
|
|
Indentation is **'2 spaces'**. **No tabs**.
|
|
|
|
|
|
# 2. One statement per line #
|
|
|
|
|
|
Don’t put multiple statements on a single line.
|
|
|
The code is easier to read.
|
|
|
|
|
|
For variables, it is also better to have only one definition per line:
|
|
|
** NOT **
|
|
|
|
|
|
```c
|
|
|
char **a, *x;
|
|
|
```
|
|
|
|
|
|
** DO **
|
|
|
|
|
|
```c
|
|
|
char **a = 0; /* add doc */
|
|
|
char *x = 0; /* add doc */
|
|
|
```
|
|
|
|
|
|
# 3. Line Length #
|
|
|
|
|
|
Most of modern screens are wide.
|
|
|
The limit on the length of lines is 240 columns.
|
|
|
|
|
|
Don't leave whitespace at the end of lines. |