Skip to contentSkip to conversation

libxl/CODING_STYLE: Clarify the singular statement in a conditional statement explanation.

PATCH In review Konrad Rzeszutek Wilk 3 participants 3 messages Apr 1, 2016 – Apr 6, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxl/CODING_STYLE: Clarify the singular statement in a conditional statement explanation.

It takes a bit of thinking to parse the original statement. It looks like it is missing an ',' - right after the 'braced' to make it obvious that:

if (X)
return XYZ;

is OK, while multiple conditionals require braces.

Changing the 'apart from' with 'except' makes it more obvious (I hope).

---
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
---

---
 tools/libxl/CODING_STYLE | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/CODING_STYLE +1 -1
index 522d1c9..01ee25b 100644
@@ -294,7 +294,7 @@ Libxenlight coding style is super simple.  Avoid tricky expressions.
 
 5. Block structure
 
-Every indented statement is braced apart from blocks that contain just
+Every indented statement is braced, except blocks that contain just
 one statement.
 The opening brace is on the line that contains the control flow
 statement that introduces the new block; the closing brace is on the
Signature · 7 lines
2.5.0


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#1 lore raw
Quoted 9 lines · Konrad Rzeszutek Wilk

It takes a bit of thinking to parse the original statement. It looks like it is missing an ',' - right after the 'braced' to make it obvious that:

if (X)
return XYZ;

is OK, while multiple conditionals require braces.

Quoted 7 lines

Changing the 'apart from' with 'except' makes it more obvious (I hope).

---
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>

Not a native speaker, so I will defer this to Ian.

Quoted 21 lines

---

---
 tools/libxl/CODING_STYLE | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/CODING_STYLE +1 -1
index 522d1c9..01ee25b 100644
@@ -294,7 +294,7 @@ Libxenlight coding style is super simple.  Avoid tricky expressions.
 
 5. Block structure
 
-Every indented statement is braced apart from blocks that contain just
+Every indented statement is braced, except blocks that contain just
 one statement.
 The opening brace is on the line that contains the control flow
 statement that introduces the new block; the closing brace is on the
Signature · 1 line
2.5.0

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Acked-by on v1 1/1
#2 lore raw
In reply to Konrad Rzeszutek Wilk

Konrad Rzeszutek Wilk writes ("[PATCH] libxl/CODING_STYLE: Clarify the singular statement in a conditional statement explanation."):

Quoted 3 lines

It takes a bit of thinking to parse the original statement. It looks like it is missing an ',' - right after the 'braced' to make it obvious that:

And queued, thanks.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel