coding-style: Don't use hex with shift operator
authorJeevaka Badrappan <jeevaka.badrappan@elektrobit.com>
Sat, 5 Feb 2011 14:29:05 +0000 (06:29 -0800)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 5 Feb 2011 15:03:32 +0000 (07:03 -0800)
doc/coding-style.txt

index 40bb36b..287e9e9 100644 (file)
@@ -294,6 +294,18 @@ void foo() // Wrong
 {
 }
 
+M16: Don't use hex value with shift operators
+==============================================
+The expression argument to the shift operators should not be in hex.
+
+Example:
+
+1)
+1 << y
+
+2)
+0x1 << y       // Wrong
+
 O1: Shorten the name
 ====================
 Better to use abbreviation, rather than full name, to name a variable,