CodingStyle: mention bitfields/whitespace style, prefer (!foo) in examples
Mention whitespace and bitfields style, prefer (!foo) to (foo == NULL) in examples.
Signed-off-by Pavel Machek <[email protected]>
Documentation/CodingStyle +10 -1
@@ -71,6 +71,15 @@ used for indentation, and the above exam Get a decent editor and don't leave whitespace at the end of lines. +Bitfield variables should be indented like this: + + unsigned int foo :1; + +Do not put whitespace between any of the unary operators and their operand. + +It is usually unnecessary to have whitespace around parentheses as +part of expressions, around brackets, or around the operators . and +->. Chapter 2: Breaking long lines and strings
@@ -403,7 +412,7 @@ int fun(int a) int result = 0; char *buffer = kmalloc(SIZE); - if (buffer == NULL) + if (!buffer) return -ENOMEM; if (condition1) {
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Documentation/CodingStyle used for indentation, and the above exam · line 76
Quoted 11 lines · Pavel Machek
Documentation/CodingStyle +0
-0@@ -71,6 +71,15 @@ used for indentation, and the above examGet a decent editor and don't leave whitespace at the end of lines.
Documentation/CodingStyle +3
-0+Bitfield variables should be indented like this: + + unsigned int foo :1;
Current code uses foo:1.
Quoted 8 lines · Jan Engelhardt
Quoted 6 lines · Pavel Machek
Documentation/CodingStyle +0
-0@@ -71,6 +71,15 @@ used for indentation, and the above exam
Quoted 7 lines
Documentation/CodingStyle used for indentation, and the above exam · line 76
Quoted 5 lines
Get a decent editor and don't leave whitespace at the end of lines.
Documentation/CodingStyle +3
-0+Bitfield variables should be indented like this: + + unsigned int foo :1;Current code uses foo:1.
I'm fine with foo :1 or foo:1. It just would be nice to have example specifying one way...
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 1 line · Pavel Machek
It just would be nice to have example specifying one way...
I don't see a necessity.
Signature · 3 lines
Stefan Richter -=====-=-=== =-=- --==- http://arcgraph.de/sr/