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

no-reply_wiki at metalforge.org no-reply_wiki at metalforge.org
Thu Jun 15 15:59:13 CDT 2006


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



Date        : 2006/06/15 20:59

User        : 

Edit Summary: 



@@ -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 s
et_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 changi
ng 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 w
ill merge the objects if applicable.

    - If using insert_ob_in_map and plan to do further actions with the ob
ject, 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: ===
===

  

    - Use descriptive variable names.  op and pl should only be used for t
emporary variables (cycling through the list or the like).  For variables 
well defined, use an accurate name (ie, hitter, sack, etc).

@@ -52,10 +53,10 @@

    statement;

    statement;

  }</code>No space after the left paren, no space before the right paren. 
Comma right after the formal param, space right after the comma.  

    - Local variable names. Just a rules of thumb. This are ok:<code>

-   int mylongvarname;

-   int my_long_var_name;

+ int mylongvarname;

+ int my_long_var_name;

  </code>Please do NOT use caps expect for typedefs, enums and defines.

  

  ------------------------------------------------------------------------
------

  Section 3 - sending in patches:





IP-Address  : 192.139.27.18

Old Revision: http://wiki.metalforge.net/doku.php/coding_style_guide?rev
=1150405041

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