We need a coding convention in some parts of our source code.
-
I recommend to avoid prefix or postfix operator inside an array or a function.
For example, avoid the following command.
|
splitCell[numSplitCell++] = c; |
Instead, I recommend to split it into two lines as follows.
splitCell[numSplitCell] = c;
++numSplitCell
-
I recommend to add a single blank line between each logical blocks.
For example, consider the following code.
|
memset(markCell, 0, sizeof(long long)*numNode); |
It can be rewritten like
memset(markCell, 0, sizeof(long long) * numNode);
-
I recommend to state a command in the next line of its conditional statement (not in the same line).
For example,
|
if (coloring->numCell == numNode) break; |
I think it is better to place break; under the if statement.
I just skimmed the source code, so there can be more issues about the coding convention.
Perhaps we can write a document of the coding convention and update it as we develop this project...
We need a coding convention in some parts of our source code.
I recommend to avoid prefix or postfix operator inside an array or a function.
For example, avoid the following command.
GI/src/refine.cpp
Line 286 in 35bdcbb
Instead, I recommend to split it into two lines as follows.
splitCell[numSplitCell] = c;++numSplitCellI recommend to add a single blank line between each logical blocks.
For example, consider the following code.
GI/src/refine.cpp
Line 228 in 35bdcbb
It can be rewritten like
memset(markCell, 0, sizeof(long long) * numNode);I recommend to state a command in the next line of its conditional statement (not in the same line).
For example,
GI/src/refine.cpp
Line 225 in 35bdcbb
I think it is better to place break; under the if statement.
I just skimmed the source code, so there can be more issues about the coding convention.
Perhaps we can write a document of the coding convention and update it as we develop this project...