minor additions
This commit is contained in:
parent
649210fcad
commit
818a96965e
39
standard.txt
39
standard.txt
@ -1,19 +1,22 @@
|
|||||||
//* xolatile present... */
|
|
||||||
// ### Compialation ###
|
// ### 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
|
+ under all cicumstances have (atleast a wrapper) Makefile for frenliness
|
||||||
+ GNU Make ok, that other Make with a prefix shall burn in hell
|
+ GNU Make ok, that other Make with a prefix shall burn in hell
|
||||||
|
+ NOTE: (to Xolatile in particular) fuck splint
|
||||||
|
|
||||||
// ### Including ###
|
// ### Including ###
|
||||||
+ never use relative paths, manipulate the compiler
|
+ never use relative paths, manipulate the compiler
|
||||||
|
|
||||||
// ### Multi-line comments ###
|
// ### Multi-line comments ###
|
||||||
options
|
+ single line for separating logical blocks inside the same block
|
||||||
// all the way
|
+ multiline for exaplaining code
|
||||||
pick one. just /* and as featured below works just fine */
|
/* stuff
|
||||||
/* stuff
|
* and more
|
||||||
* and more -- xolatile's vote goes here
|
*/
|
||||||
*/
|
+ use them very sparsely
|
||||||
|
|
||||||
// ### Macros ###
|
// ### Macros ###
|
||||||
+ only with consensus can any new macro be added to the codebase
|
+ only with consensus can any new macro be added to the codebase
|
||||||
@ -37,9 +40,24 @@ options
|
|||||||
|
|
||||||
// ### Declarations ###
|
// ### Declarations ###
|
||||||
+ pointer '*'s always to the middle { char * s; }
|
+ pointer '*'s always to the middle { char * s; }
|
||||||
|
+ dont concat pointer '*'s { char * * s; }
|
||||||
+ function heads belong on the same line
|
+ function heads belong on the same line
|
||||||
+ [static|extern] [const] [inline] [type]
|
+ [static|extern] [inline] [type]
|
||||||
+ align adjecent ones horizontally
|
+ 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 ###
|
||||||
switch(...) {
|
switch(...) {
|
||||||
@ -66,6 +84,9 @@ options
|
|||||||
+ *_t on all typedefs
|
+ *_t on all typedefs
|
||||||
+ LOCAL variables shall be short enough to not use snake_case
|
+ LOCAL variables shall be short enough to not use snake_case
|
||||||
|
|
||||||
|
// ### Misc ###
|
||||||
|
+ keep a line width of 80
|
||||||
|
|
||||||
// ------ //
|
// ------ //
|
||||||
// chad.h //
|
// chad.h //
|
||||||
#define UNUSED(x) ((void)x)
|
#define UNUSED(x) ((void)x)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user