init
This commit is contained in:
commit
91120748f2
71
standard.txt
Normal file
71
standard.txt
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
//* xolatile present... */
|
||||||
|
// ### Compialation ###
|
||||||
|
+ try to clear all 'clang -Weverything', 'gcc -Wall -Wextra -Wpedantic' and Valgrind warnings
|
||||||
|
+ under all cicumstances have (atleast a wrapper) Makefile for frenliness
|
||||||
|
+ GNU Make ok, that other Make with a prefix shall burn in hell
|
||||||
|
|
||||||
|
// ### Including ###
|
||||||
|
+ never use relative paths, manipulate the compiler
|
||||||
|
|
||||||
|
// ### Multi-line comments ###
|
||||||
|
options
|
||||||
|
// all the way
|
||||||
|
pick one. just /* and as featured below works just fine */
|
||||||
|
/* stuff
|
||||||
|
* and more -- xolatile's vote goes here
|
||||||
|
*/
|
||||||
|
|
||||||
|
// ### Macros ###
|
||||||
|
+ only with consensus can any new macro be added to the codebase
|
||||||
|
+ always parenthesize values
|
||||||
|
|
||||||
|
// ### Header Guards ###
|
||||||
|
+ #define type
|
||||||
|
+ all caps
|
||||||
|
'<namespace>_<unit>'
|
||||||
|
|
||||||
|
// ### Identaion ###
|
||||||
|
+ tabs
|
||||||
|
+ max 4 levels
|
||||||
|
|
||||||
|
// ### Parenthesizing ###
|
||||||
|
+ do not parenthesize return statements
|
||||||
|
+ always add spacing around when after a control statement { if (condition) {...} }
|
||||||
|
+ do not pad the insides { (stuff) ; and not: ( stuff ) }
|
||||||
|
+ do not pad after function context { myfun(); }
|
||||||
|
+ always use to avoid relying on operator precedence { (a * b) + c }
|
||||||
|
|
||||||
|
// ### Declarations ###
|
||||||
|
+ pointer '*'s always to the middle { char * s; }
|
||||||
|
+ function heads belong on the same line
|
||||||
|
+ [static|extern] [const] [inline] [type]
|
||||||
|
+ align adjecent ones horizontally
|
||||||
|
|
||||||
|
// ### Switch ###
|
||||||
|
switch(...) {
|
||||||
|
case ...: {
|
||||||
|
} beak;
|
||||||
|
}
|
||||||
|
+ GNU range extensions allowed
|
||||||
|
|
||||||
|
// ### Loops ###
|
||||||
|
+ declare the iterator inside the loop
|
||||||
|
+ variables to use for iteration 'i' -> 'j' -> 'k'
|
||||||
|
+ use "while(1)" for infinit loops
|
||||||
|
+ no coma in condition unless its an assignment
|
||||||
|
+ never ommit brackets at empyt loop bodies
|
||||||
|
|
||||||
|
// ### Operators ###
|
||||||
|
+ prefer prefix crementors when possible { ++i }
|
||||||
|
+ use spaces (if you dont intuetively know what this means, kys)
|
||||||
|
|
||||||
|
|
||||||
|
// ### Naming ###
|
||||||
|
+ namer chooses spelling, consistency must follow
|
||||||
|
+ snake_case
|
||||||
|
+ *_t on all typedefs
|
||||||
|
+ LOCAL variables shall be short enough to not use snake_case
|
||||||
|
|
||||||
|
// ------ //
|
||||||
|
// chad.h //
|
||||||
|
#define UNUSED(x) ((void)x)
|
0
structure/README.md
Normal file
0
structure/README.md
Normal file
0
structure/source/.gitkeep
Normal file
0
structure/source/.gitkeep
Normal file
Loading…
x
Reference in New Issue
Block a user