diff options
author | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2010-11-23 19:16:36 +0000 |
---|---|---|
committer | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2010-11-23 19:16:36 +0000 |
commit | 776d0f34595fd616129d4816a337662ff39de7c6 (patch) | |
tree | 3fbcf0ee1967e7ee51745b6e89520ca37185c6ba /coding.txt | |
parent | e4ff4e6898d378b1a3e83791034a7af455fde3ab (diff) |
new getwork
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@189 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'coding.txt')
-rw-r--r-- | coding.txt | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/coding.txt b/coding.txt new file mode 100644 index 0000000000..4707476697 --- /dev/null +++ b/coding.txt @@ -0,0 +1,41 @@ +Please be consistent with the existing coding style.
+
+Block style:
+
+bool Function(char* psz, int n)
+{
+ // Comment summarising what this section of code does
+ for (int i = 0; i < n; i++)
+ {
+ // When something fails, return early
+ if (!Something())
+ return false;
+ ...
+ }
+
+ // Success return is usually at the end
+ return true;
+}
+
+- ANSI/Allman block style
+- 4 space indenting, no tabs
+- No extra spaces inside parenthesis; please don't do ( this )
+- No space after function names, one space after if, for and while
+
+Variable names begin with the type in lowercase, like nSomeVariable.
+Please don't put the first word of the variable name in lowercase like
+someVariable.
+
+Common types:
+n integer number: short, unsigned short, int, unsigned int,
+ int64, uint64, sometimes char if used as a number
+d double, float
+f flag
+hash uint256
+p pointer or array, one p for each level of indirection
+psz pointer to null terminated string
+str string object
+v vector or similar list objects
+map map or multimap
+set set or multiset
+bn CBigNum
|