minor additions
This commit is contained in:
parent
649210fcad
commit
818a96965e
39
standard.txt
39
standard.txt
@ -1,19 +1,22 @@
|
||||
//* xolatile present... */
|
||||
// ### Compialation ###
|
||||
+ try to clear all 'clang -Weverything', 'gcc -Wall -Wextra -Wpedantic' and Valgrind warnings
|
||||
+ remove all warnings
|
||||
clang -Weverything
|
||||
gcc -Wall -Wextra -Wpedantic
|
||||
valgrind --show-leak-kinds=all --leak-check=full
|
||||
+ under all cicumstances have (atleast a wrapper) Makefile for frenliness
|
||||
+ GNU Make ok, that other Make with a prefix shall burn in hell
|
||||
+ NOTE: (to Xolatile in particular) fuck splint
|
||||
|
||||
// ### 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
|
||||
*/
|
||||
+ single line for separating logical blocks inside the same block
|
||||
+ multiline for exaplaining code
|
||||
/* stuff
|
||||
* and more
|
||||
*/
|
||||
+ use them very sparsely
|
||||
|
||||
// ### Macros ###
|
||||
+ only with consensus can any new macro be added to the codebase
|
||||
@ -37,9 +40,24 @@ options
|
||||
|
||||
// ### Declarations ###
|
||||
+ pointer '*'s always to the middle { char * s; }
|
||||
+ dont concat pointer '*'s { char * * s; }
|
||||
+ function heads belong on the same line
|
||||
+ [static|extern] [const] [inline] [type]
|
||||
+ [static|extern] [inline] [type]
|
||||
+ align adjecent ones horizontally
|
||||
+ always typedef structs or make them anonymous
|
||||
|
||||
// ### If ###
|
||||
+ align logical operators under the keyword if
|
||||
if (a
|
||||
&& b
|
||||
&& c) {}
|
||||
+ align negating operators and the lack of there of
|
||||
if (!a
|
||||
&& b
|
||||
&& !c) {}
|
||||
+ always omit useless comperasions
|
||||
if (a) // good
|
||||
if (a != 0) // bad
|
||||
|
||||
// ### Switch ###
|
||||
switch(...) {
|
||||
@ -66,6 +84,9 @@ options
|
||||
+ *_t on all typedefs
|
||||
+ LOCAL variables shall be short enough to not use snake_case
|
||||
|
||||
// ### Misc ###
|
||||
+ keep a line width of 80
|
||||
|
||||
// ------ //
|
||||
// chad.h //
|
||||
#define UNUSED(x) ((void)x)
|
||||
|
Loading…
x
Reference in New Issue
Block a user