[Crossfire-wiki] [Crossfire DokuWiki] page changed: coding_style_guide

no-reply_wiki at metalforge.org no-reply_wiki at metalforge.org
Fri Dec 29 12:43:08 CST 2006


A page in your DokuWiki was added or changed. Here are the details:

Date        : 2006/12/29 12:43
User        : ryo
Edit Summary: add function commenting.

@@ -8,8 +8,9 @@
    - Some structure elements should never be accessed directly - rather, there are other functions to use the values.
      * object->owner:  This contains the owner id for this object.  Use set_owner and get_owner instead.  Directly using object->owner is likely to get unpredictable results.
      * object->nrof:  This contains the number of an object. Since changing this will change the weight of an object, direct access should also be avoided.  Use decrease_ob_nr, split_ob, and insert_ob_in_... - the later will merge the objects if applicable.
    - If using insert_ob_in_map and plan to do further actions with the object, check and make sure the object still exists after insertion - it is possible that the object gets destroyed while being inserted.
+ 
  
  
  ====== Section 2 - Style guide for new additions: ======
  
@@ -36,8 +37,16 @@
      like this
     */
  
    /* if you are doing a single line comment, this method is fine */</code>Its much easier to spot the block comments if they all start with *, and these comments tend to be worth noticing.
+   - <code> /**
+   * Functions should be commented like this.
+   *
+   * @param bla
+   * this is a parameter
+   * @return
+   * returns NULL
+   */</code> This lets doxygen generate nice documentation.
    - As discussed on irc, the preferred style for expressions is like this:<code>
  if (expression) {
    statement;
    statement;


IP-Address  : 82.236.87.204
Old Revision: http://wiki.metalforge.net/doku.php/coding_style_guide?rev=1166450436
New Revision: http://wiki.metalforge.net/doku.php/coding_style_guide

-- 
This mail was generated by DokuWiki at
http://wiki.metalforge.net/




More information about the crossfire-wiki mailing list