datapath-windows: update CodingStyle guideline for variable names
authorNithin Raju <nithin@vmware.com>
Tue, 9 Sep 2014 16:02:36 +0000 (09:02 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 10 Sep 2014 15:28:31 +0000 (08:28 -0700)
During a review, it seemed that some of the conventions were not clear.
Fixing them in this patch.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Reported-by: Samuel Ghinet <sghinet@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Samuel Ghinet <sghinet@cloudbasesolutions.com>
datapath-windows/CodingStyle

index 006adfd..3550cdb 100644 (file)
@@ -40,8 +40,14 @@ guidelines:
 
   Use lower case to begin the name of a variable.
 
+  Do not use '_' to begin the name of the variable. '_' is to be used to begin
+  the parameters of a pre-processor macro.
+
   Use upper case to begin the name of a function, enum, file name etc.
 
+  Static functions whose scope is limited to the file they are defined in can
+  be prefixed with '_'. This is not mandatory though.
+
   For types, use all upper case for all letters with words separated by '_'. If
   camel casing is preferred, use  upper case for the first letter.
 
@@ -72,6 +78,13 @@ OvsDetectTunnelRxPkt(POVS_FORWARDING_CONTEXT ovsFwdCtx,
     return FALSE;
 }
 
+  For declaring variables of pointer type, use of the pointer data type
+prefixed with 'P' is preferred over using '*'. This is not mandatory though,
+and is only prescribed since it is a common practice in Windows.
+
+  Example, #1 is preferred over #2 though #2 is also equally correct:
+  1. PNET_BUFFER_LIST curNbl;
+  2. NET_BUFFER_LIST *curNbl;
 
 COMMENTS