]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
CODING_STYLE: document intended usage of types
authorJan Beulich <jbeulich@suse.com>
Wed, 7 Aug 2019 10:08:38 +0000 (12:08 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 7 Aug 2019 10:08:38 +0000 (12:08 +0200)
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
CODING_STYLE

index 6cc5b774cfbd5816d7dd943a8e4ab19d9ae3a2ec..810b71c16dbf14a14c357e87f38fc39af9d17bd2 100644 (file)
@@ -88,6 +88,19 @@ Braces should be omitted for blocks with a single statement. e.g.,
 if ( condition )
     single_statement();
 
+Types
+-----
+
+Use basic C types and C standard mandated typedef-s where possible (and
+with preference in this order).  This in particular means to avoid u8,
+u16, etc despite those types continuing to exist in our code base.
+Fixed width types should only be used when a fixed width quantity is
+meant (which for example may be a value read from or to be written to a
+register).
+
+Especially with pointer types, whenever the pointed to object is not
+(supposed to be) modified, qualify the pointed to type with "const".
+
 Comments
 --------