[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:57:22 CDT 2006


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



Date        : 2006/06/15 20:57

User        : 

Edit Summary: Completed wikification



@@ -1,7 +1,5 @@

  The following is a wikified mirror of //crossfire/doc/Developers/program
ming_guide// from the server source.

- 

- ----

  

  ====== Section 1 - currently used conventions/hints for new 
code writers: ======

  

    - variable abbreviations - op is short for object pointer, ob is for o
bject, and pl is for player.

@@ -53,70 +51,25 @@

  void myFooFunction(param1, param2, param3) {

    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.  

- 

- 

- 16) Local variable names. Just a rules of thumb.

- 

- This are ok:

- 

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

    int mylongvarname;

    int my_long_var_name;

- 

- Please do NOT use caps expect for typedefs, enums and defines.

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

  

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

  Section 3 - sending in patches:

  

- 1) Please send patches on a bug fix or feature enhancement basis

- individually, and not make mega patches.  A diff that changes 10

- things is first more difficult for me to look over and understand as

- unrelated changes might be going on.  It is also harder for me to reject

- part of a patch (feature X is nice, but Y doesn't work).

- 

- 2) Please state in the message included with the patch what it fixes/cha
nges.

- Too often, I get patches which is just a bunch of source code, and I hav
e

- no idea if I want to incorporate it, or even if the bug is still there.

- Please also state what version of crossfire the diff is for.

- 

- 3) I will assume any patches mailed directly to me are to be included.

- If posting a patch on the mailing list (either source or ftp location),

- please explicity state whether or not you want that patch incorporated

- into the master source.  Many times, a patch may be made available on

- an expiremental basis which is not ready for widespread distribution. 
 

- 

- 4) When making patches, please make context diffs.  Please also include

- the directory that the file is in (run the diff in the top level

- directory).  Please make 5 line context diffs - large line context diffs

- are fine if you think that may make it easier.

- 

-  Example:

- 

- 	   'diff -c5 (oldfile) (newfile)'

- 

- 	You can also do diffs of entire directories.  Do do this, type:

- 

- 	    'diff -c5 -r (old_directory) (new_directory)'

- 

- 	An example:

- 

- 	    'diff -c5 -r crossfire-0.90.1 crossfire-0.90.2'

- 

- 5) Gnu diff will include files that did not exist before.  Other diff

- programs may not do this.

- 

- 6) If your diff looks excessively long and you made a lot of formatting

- changes, you can add -w to the diff options to have it ignore whitespace
.

- Note that this will then mean that those formatting changes will then be
 lost.

- 

- 7) There is no need to make a seperate diff file for each file

- different (ie, treasure.diff, player.diff, etc).  Assuming you follow st
eps

- 1-6, all the diffs can be contained in one file, and patch will deal wit
h

- it just fine.

- 

- 8) If you need to send a map, new archetypes, or other new files where

- a diff doesn't make since, a uuencoded tar file will work just fine.

+   - Please send patches on a bug fix or feature enhancement basis indivi
dually, and not make mega patches.  A diff that changes 10 things is first
 more difficult for me to look over and understand as unrelated changes mi
ght be going on.  It is also harder for me to reject part of a patch (feat
ure X is nice, but Y doesn't work).

+   - Please state in the message included with the patch what it fixes/ch
anges. Too often, I get patches which is just a bunch of source code, and 
I have no idea if I want to incorporate it, or even if the bug is still th
ere. Please also state what version of crossfire the diff is for.

+   - I will assume any patches mailed directly to me are to be included. 
If posting a patch on the mailing list (either source or ftp location), pl
ease explicity state whether or not you want that patch incorporated into 
the master source.  Many times, a patch may be made available on an expire
mental basis which is not ready for widespread distribution.  

+   - When making patches, please make context diffs.  Please also include
 the directory that the file is in (run the diff in the top level director
y).  Please make 5 line context diffs - large line context diffs are fine 
if you think that may make it easier.\\ Example:<code>

+ diff -c5 (oldfile) (newfile)</code>You can also do diffs of entire direc
tories.  Do do this, type:<code>

+ diff -c5 -r (old_directory) (new_directory)</code>An example:<code>

+ diff -c5 -r crossfire-0.90.1 crossfire-0.90.2</code>

+   - Gnu diff will include files that did not exist before.  Other diff p
rograms may not do this.

+   - If your diff looks excessively long and you made a lot of formatting
 changes, you can add -w to the diff options to have it ignore whitespace.
 Note that this will then mean that those formatting changes will then be 
lost.

+   - There is no need to make a seperate diff file for each file differen
t (ie, treasure.diff, player.diff, etc).  Assuming you follow steps 1-6, a
ll the diffs can be contained in one file, and patch will deal with it jus
t fine.

+   - If you need to send a map, new archetypes, or other new files where 
a diff doesn't make since, a uuencoded tar file will work just fine.

  

- Submit all patches to the Sourceforge patch tracker on

- http://sourceforge.net/projects/crossfire., and mail an announcement to

- crossfire-devel at lists.real-time.com.

+ Submit all patches to the Sourceforge patch tracker on http://sourceforg
e.net/projects/crossfire, and mail an announcement to [[crossfire-devel at li
sts.real-time.com]].





IP-Address  : 192.139.27.18

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

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