[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen staging] CODING_STYLE: document intended usage of types



commit 6954c93e08236323ccf19a1a426883eb27bead54
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Aug 7 12:08:38 2019 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Aug 7 12:08:38 2019 +0200

    CODING_STYLE: document intended usage of types
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: George Dunlap <george.dunlap@xxxxxxxxxx>
---
 CODING_STYLE | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/CODING_STYLE b/CODING_STYLE
index 6cc5b774cf..810b71c16d 100644
--- a/CODING_STYLE
+++ b/CODING_STYLE
@@ -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
 --------
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.