~ubuntu-branches/ubuntu/quantal/libdmapsharing/quantal

« back to all changes in this revision

Viewing changes to docs/html/coding-standards.html

  • Committer: Bazaar Package Importer
  • Author(s): Josselin Mouette
  • Date: 2011-03-29 19:52:57 UTC
  • mfrom: (0.1.2 experimental) (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20110329195257-0zas0lq4c03gwo46
Tags: 2.9.7-1
Initial release. (Closes: #620060)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
 
2
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
3
<html xmlns="http://www.w3.org/1999/xhtml">
 
4
  <head>
 
5
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
 
6
    <title>Libdmapsharing Coding Standards</title>
 
7
    <meta name="generator" content="DocBook XSL Stylesheets V1.75.2" />
 
8
    <link rel="home" href="index.html" title="libdmapsharing Reference Manual" />
 
9
    <link rel="up" href="ch03.html" title="Libdmapsharing Internals" />
 
10
    <link rel="prev" href="ch03.html" title="Libdmapsharing Internals" />
 
11
    <link rel="next" href="server-internals.html" title="Libdmapsharing Server Internals" />
 
12
    <meta xmlns="" name="generator" content="GTK-Doc V1.15 (XML mode)" />
 
13
    <link xmlns="" rel="stylesheet" href="style.css" type="text/css" />
 
14
  </head>
 
15
  <body>
 
16
    <table xmlns="" class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
 
17
      <tr valign="middle">
 
18
        <td>
 
19
          <a accesskey="p" href="ch03.html">
 
20
            <img src="left.png" width="24" height="24" border="0" alt="Prev" />
 
21
          </a>
 
22
        </td>
 
23
        <td>
 
24
          <a accesskey="u" href="ch03.html">
 
25
            <img src="up.png" width="24" height="24" border="0" alt="Up" />
 
26
          </a>
 
27
        </td>
 
28
        <td>
 
29
          <a accesskey="h" href="index.html">
 
30
            <img src="home.png" width="24" height="24" border="0" alt="Home" />
 
31
          </a>
 
32
        </td>
 
33
        <th width="100%" align="center">libdmapsharing Reference Manual</th>
 
34
        <td>
 
35
          <a accesskey="n" href="server-internals.html">
 
36
            <img src="right.png" width="24" height="24" border="0" alt="Next" />
 
37
          </a>
 
38
        </td>
 
39
      </tr>
 
40
    </table>
 
41
    <div class="refentry" title="Libdmapsharing Coding Standards">
 
42
      <a id="coding-standards"></a>
 
43
      <div class="titlepage"></div>
 
44
      <div xmlns="" class="refnamediv">
 
45
        <table width="100%">
 
46
          <tr>
 
47
            <td valign="top">
 
48
              <h2>
 
49
                <span xmlns="http://www.w3.org/1999/xhtml" class="refentrytitle">Libdmapsharing Coding Standards</span>
 
50
              </h2>
 
51
              <p>Libdmapsharing Coding Standards &#8212; 
 
52
                        Description of libdmapsharing's coding standards
 
53
                </p>
 
54
            </td>
 
55
            <td valign="top" align="right"></td>
 
56
          </tr>
 
57
        </table>
 
58
      </div>
 
59
      <div class="refsect1" title="Libdmapsharing Coding Standards">
 
60
        <a id="id651627"></a>
 
61
        <h2>Libdmapsharing Coding Standards</h2>
 
62
        <div class="itemizedlist">
 
63
          <ul class="itemizedlist" type="disc">
 
64
            <li class="listitem">Use tabs to indent</li>
 
65
            <li class="listitem">Use spaces to align</li>
 
66
            <li class="listitem">Attempt to limit lines to 80 characters</li>
 
67
            <li class="listitem">Use whitespace to keep expressions clear:
 
68
<pre class="programlisting">
 
69
int foo = x + 1 - bar (y);
 
70
</pre></li>
 
71
            <li class="listitem">In order to protect against an accidental use of assignment in a Boolean expression, use:
 
72
<pre class="programlisting">if (CONSTANT == variable)</pre>
 
73
        not: 
 
74
<pre class="programlisting">if (variable == CONSTANT)</pre></li>
 
75
            <li class="listitem">Braces should be formatted as follows:
 
76
<pre class="programlisting">
 
77
if (foo) {
 
78
        something ();
 
79
}
 
80
</pre>
 
81
        or, in the case of function definitions:
 
82
<pre class="programlisting">
 
83
void foo (void)
 
84
{
 
85
        something ();
 
86
}
 
87
</pre></li>
 
88
            <li class="listitem">Place a semicolon following function-like preprocessor macros because the lack of one might confuse tools such as <span class="application">indent</span> (even if the semicolon is actually repetitive):
 
89
<pre class="programlisting">
 
90
CPPFUNC(foo);
 
91
</pre></li>
 
92
            <li class="listitem">Perform a Git commit after finishing a single
 
93
        task</li>
 
94
            <li class="listitem">Patches submitted should perform one task (e.g.,
 
95
        don't add functionality and reformat existing code in the same
 
96
        patch)</li>
 
97
            <li class="listitem">Git commit messages should be of the following form:
 
98
<div class="literallayout"><p>single�line�summary�with�no�period<br />
 
99
<br />
 
100
Optional�detailed�description.�This�should�use�paragraph�grammar,<br />
 
101
including�periods.�This�may�be�any�number�of�lines�long.�Paragraphs�are<br />
 
102
separated�by�an�empty�line�but�are�not�indented.�Lines�are�less�than�80<br />
 
103
characters�long.<br />
 
104
</p></div></li>
 
105
            <li class="listitem">Use GObject conventions for things not covered here</li>
 
106
            <li class="listitem">You may use the following indent command to format libdmapsharing code:
 
107
<pre class="programlisting">
 
108
indent -i8 -bad -bap -br -ce -d0 -ndj -lp -pcs -psl -sc -sob foo.c
 
109
</pre></li>
 
110
          </ul>
 
111
        </div>
 
112
      </div>
 
113
    </div>
 
114
    <div xmlns="" class="footer"><hr />
 
115
          Generated by GTK-Doc V1.15</div>
 
116
  </body>
 
117
</html>
 
 
b'\\ No newline at end of file'