Skip to contentSkip to conversation

Coding style: do_this(a,b) vs. do_this(a, b)

PATCH Pavel Machek 4 participants 5 messages Aug 17, 2004 Documentation

lore
Share & tools
lore
#0 lore raw

Hi!

Coding style document is not consistent with itself on whether there should be space after ","... This makes it standartize on ", " option.

Pavel

Documentation/CodingStyle renamed from linux/Documentation/CodingStyle +3 -3
@@ -356,11 +356,11 @@
 
 Macros with multiple statements should be enclosed in a do - while block:
 
-#define macrofun(a,b,c) 			\
+#define macrofun(a, b, c) 			\
 	do {					\
 		if (a == 5)			\
-			do_this(b,c);		\
-	} while (0)
+			do_this(b, c);		\
+	} while(0)
 
 Things to avoid when using macros:
 
Signature · 2 lines
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
#1 lore raw

Speaking of style preferences, does anybody else feel that there are too many spaces in the indentations? I personally prefer no more than two or three spaces, as I can fit a lot more code per line that way.

Signature · 1 line
Sean
#2 lore raw

Hi!

Quoted 3 lines

Speaking of style preferences, does anybody else feel that there are too many spaces in the indentations? I personally prefer no more than two or three spaces, as I can fit a lot more code per line that way.

Better not start *that* flamewar.

[Its on purpose, see archives.]
Pavel

Signature · 2 lines
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
#3 lore raw
In reply to Pavel Machek

Documentation/CodingStyle line 363

Quoted 4 lines · Pavel Machek

Hi!

Documentation/CodingStyle renamed from linux/Documentation/CodingStyle +1 -1
-	} while (0)
+	} while(0)

"while" is not a function so I'd keep the space. Both coding style and kernel/*.c (had to pick something) seem to agree upon this: put a space between keyword and expression.

Signature · 1 line
Frank
#4 lore raw
Quoted 8 lines · Frank van Maarseveen

Documentation/CodingStyle line 363

Quoted 4 lines · Pavel Machek

Hi!

Documentation/CodingStyle renamed from linux/Documentation/CodingStyle +1 -1
-	} while (0)
+	} while(0)

"while" is not a function so I'd keep the space.

My stealth error corrector already did that ;)