[hipl-commit] [trunk] Rev 4073: Fix coding style examples to actually use K&R style.

  • From: Diego Biurrun <diego@xxxxxxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Mon, 29 Mar 2010 20:47:58 +0300

Committer: Diego Biurrun <diego@xxxxxxxxxx>
Date: 29/03/2010 at 20:47:58
Revision: 4073
Revision-id: diego@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: trunk

Log:
  Fix coding style examples to actually use K&R style.

Modified:
  M  doc/HACKING
  M  doc/doxygen.h

=== modified file 'doc/HACKING'
--- doc/HACKING 2010-03-18 12:09:47 +0000
+++ doc/HACKING 2010-03-29 17:47:36 +0000
@@ -661,14 +661,16 @@
 
 - Memory (de)allocation procedure is as follows:
 
-  int f() {
-    char *mem = NULL;
-  HIP_IFEL(!(mem = HIP_ALLOC(256, 0)), -1, "alloc\n");
+  int f(void)
+  {
+      char *mem = NULL;
+      HIP_IFEL(!(mem = HIP_ALLOC(256, 0)), -1, "alloc\n");
 
   out_err:
-    if (mem)
-      free(mem);
-    return err;
+      if (mem) {
+          free(mem);
+      }
+      return err;
   }
 
 ECLIPSE
@@ -827,9 +829,9 @@
 
 /** A HIP FROM parameter. */
 struct hip_from {
-     hip_tlv_type_t type;  /**< Type code for the parameter. */
-     hip_tlv_len_t  length; /**< Length of the parameter contents in bytes. */
-     uint8_t address[16]; /**< IPv6 address */
+     hip_tlv_type_t type;         /**< type code for the parameter */
+     hip_tlv_len_t  length;       /**< length of the parameter contents in 
bytes */
+     uint8_t        address[16];  /**< IPv6 address */
 } __attribute__ ((packed));
 
 Here the whole structure gets Doxygen comment "A HIP FROM parameter", and the

=== modified file 'doc/doxygen.h'
--- doc/doxygen.h       2010-03-19 09:00:54 +0000
+++ doc/doxygen.h       2010-03-29 17:47:36 +0000
@@ -124,13 +124,14 @@
  * label named @c out_err at the end of the function. For example, memory
  * allocation/deallocation procedure is as follows:
  * <pre>
- * int f() {
+ * int f(void)
+ * {
  *     char *mem = NULL;
  *     HIP_IFEL(!(mem = HIP_ALLOC(256, 0)), -1, "alloc\n");
  *
- *   out_err:
+ * out_err:
  *     if (mem != NULL) {
- *       free(mem);
+ *         free(mem);
  *     }
  *     return err;
  * }

Other related posts:

  • » [hipl-commit] [trunk] Rev 4073: Fix coding style examples to actually use K&R style. - Diego Biurrun