httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1334837 - /httpd/site/trunk/content/dev/styleguide.mdtext
Date Sun, 06 May 2012 23:59:46 GMT
Author: joes
Date: Sun May  6 23:59:45 2012
New Revision: 1334837

URL: http://svn.apache.org/viewvc?rev=1334837&view=rev
Log:
various formatting issues

Modified:
    httpd/site/trunk/content/dev/styleguide.mdtext

Modified: httpd/site/trunk/content/dev/styleguide.mdtext
URL: http://svn.apache.org/viewvc/httpd/site/trunk/content/dev/styleguide.mdtext?rev=1334837&r1=1334836&r2=1334837&view=diff
==============================================================================
--- httpd/site/trunk/content/dev/styleguide.mdtext (original)
+++ httpd/site/trunk/content/dev/styleguide.mdtext Sun May  6 23:59:45 2012
@@ -32,30 +32,39 @@ broken if necessary to achieve a clearer
 
 This style can be generated with the following arguments to GNU indent:
 
-`-i4 -npsl -di0 -br -nce -d0 -cli0 -npcs -nfc1 -nut` 
+    -i4 -npsl -di0 -br -nce -d0 -cli0 -npcs -nfc1 -nut
 
 # The Guidelines #
-<UL><li>Opening braces are given on the same lines as statements, or on the
-following line at the start of a function definition.</li><li>Code inside a
+
+- Opening braces are given on the same lines as statements, or on the
+following line at the start of a function definition.
+- Code inside a
 block (whether surrounded by braces or not) is indented by four space
 characters. Tab characters are not used. Comments are indented to the same
-level as the surrounding code.</li><li>Closing braces are always on a
+level as the surrounding code.
+- Closing braces are always on a
 separate line from surrounding code, and are indented to line up with the
 start of the text on the line containing the corresponding opening
-brace.</li><li>Functions are declared with ANSI-style
-arguments.</li><li>There is no space between the function name and the
+brace.
+- Functions are declared with ANSI-style
+arguments.
+- There is no space between the function name and the
 opening bracket of the arguments to the function. There is a single space
 following commas in argument lists and the semi-colons in for
-statements.</li><li>Inside a<samp>switch()</samp>statement,
-the<samp>case</samp>keywords are indented to the same level as
-the<samp>switch</samp>line.</li><li>Operators in expressions should
be
+statements.
+- Inside a `switch()` statement,
+the `case` keywords are indented to the same level as
+the `switch` line.
+- Operators in expressions should be
 surrounded by a single space before and after, except for unary increment
-(++), decrement (--), and negation (!) operators.</li><li>There is no
+(++), decrement (--), and negation (!) operators.
+- There is no
 whitespace between a cast and the item modified (<EM>e.g.</EM>,
-"<samp>(int)j</samp>" and not "<samp>(int) j</samp>").</li><li>If
a cast is
+"<samp>(int)j</samp>" and not "<samp>(int) j</samp>").
+- If a cast is
 to a pointer type, there is a space between the type and
-the<samp>*</samp>character (<EM>e.g.</EM>, "<samp>(char *)i</samp>"
instead
-of "<samp>(char*)i</samp>")</li></UL>
+the `*` character (*e.g.*, "`(char *)i`" instead
+of "`(char*)i`")
 
 # Details and Examples #
 
@@ -65,7 +74,7 @@ never be used. Specific indentation rule
 control-flow keywords are given below.
 
 Example:
-`
+
     main(int argc, char **argc)
     {
 	if (argc != 0) {
@@ -74,7 +83,7 @@ Example:
 	}
 	exit(0);
     }
-` 
+
 <A NAME="long-exps">If an expression</A>(or a routine declaration or
 invocation) would extend past column 80, the terms or arguments are wrapped
 at a convenient spot and the wrapped portion is indented under the first
@@ -84,7 +93,7 @@ atomic as possible, and place Boolean op
 (preferable) or end of the line.
 
 Example:
-`
+
      static const char *really_long_name(int i, int j,
 					 const char *args, void *foo,
 					 int k)
@@ -93,7 +102,7 @@ Example:
 	 &amp;&amp; (item5 || item6) &amp;&amp; item7) {
 	 do_a_thing();
      }
-` 
+
 
 1.  **Comments** 
 Provide comments which explain the function of code where it is not clear
@@ -103,20 +112,20 @@ of code.
 Comments should be indented to same level as the surrounding text.
 
 Example:
-`
+
     code;
     /* comment */
     code;
-` 
+
 
 1.  **Function Declaration and Layout** 
 Functions are laid out as follows:
-`
+
     int main(int argc, char **argv)
     {
 	code;
     }
-` 
+
 The return type is placed on the same line as the function. Arguments (if
 any) are given in ANSI style. If no arguments, declare function
 as<samp>void</samp>. No space between function name and opening bracket,
@@ -130,64 +139,64 @@ invocations</A>.** 
 1.  **Function Calls** 
 Space after commas in function calls. No space between function name and
 opening bracket.
-`
+
     f(a, b);
-` 
+
 **Also see the section on indenting<A HREF="#long-exps">long declarations
 and invocations</A>.** 
 
 1.  **Flow-Control Layout** 
 Flow-control statements
-(<samp>if</samp>,<samp>while</samp>,<samp>for</samp>,<EM>etc.</EM>)
are
+(`if`, `while`, `for`, *etc.*) are
 laid out as in this example:
-`
+
     if (expr) {
 	code;
     }
     else {
 	code;
     }
-` 
+
 There is a space between the keyword and the opening bracket. Opening brace
 placed on same line as the flow keyword. The code itself is indented by
 four spaces. The closing brace is indented to line up with the opening
-brace. If an<samp>else</samp>clause is used, the<samp>else</samp>keyword
is
+brace. If an `else` clause is used, the `else` keyword is
 placed on the line following the closing brace and is indented to line up
-with the corresponding<samp>if</samp>. **Also see the section on
+with the corresponding `if`. **Also see the section on
 indenting<A HREF="#long-exps">long expressions</A>.** 
 
-1.  **<samp>for</samp>Layout** 
+1.  **`for` Layout** 
 Space after the semi-colons. Example:
-`
+
     for (a; b; c)
-` 
+ 
 
-1.  **<samp>switch</samp>Layout** 
-<samp>case</samp>lines within a<samp>switch()</samp>are indented
to same
+1.  **`switch` Layout** 
+`case` lines within a `switch()` are indented to same
 level as the switch statement itself. The code for each case is indented by
 four spaces. Braces are laid out as for other control-flow keywords.
 Example:
-`
+
     switch (x) {
     case a:
 	code;
     case b:
 	code;
     }
-` 
+
 
 1.  **Expressions** 
 Space before and after assignment and other and operators. No space between
 unary operators (increment, decrement, and negation) and the lvalue.
 Examples:
-`
+
     a = b
     a + b
     a &lt; b
     a = -b
     a = !b
     ++a
-` 
+ 
 
 1.  **Capitalisation of Enums** 
 No rule.



Mime
View raw message